There's a long standing request to extend the output of dmidecode to something that would be machine-readable. Something like an XML or JSON-based format. Unfortunately this can't be implemented right now because the output of dmidecode is generated by open-coded printfs as the DMI table is being parsed, with no intermediate structures nor temporary buffers.

While implementing a machine-parseable output is out of scope for a single hack week, let's remember that even the longest journey starts with a single footstep. I would like to try and rewrite the 5200 lines of code of dmidecode in such a way that printing the output would be somewhat separated from parsing the DMI table and done by a limited set of dedicated functions. Alternative output formats could later hook into such functions.

Looking for hackers with the skills:

dmidecode c

This project is part of:

Hack Week 19

Activity

  • almost 5 years ago: bmwiedemann liked this project.
  • almost 5 years ago: mkubecek liked this project.
  • almost 5 years ago: ematsumiya liked this project.
  • almost 5 years ago: jdelvare added keyword "c" to this project.
  • almost 5 years ago: jdelvare added keyword "dmidecode" to this project.
  • almost 5 years ago: jdelvare started this project.
  • almost 5 years ago: jdelvare originated this project.

  • Comments

    • bmwiedemann
      almost 5 years ago by bmwiedemann | Reply

      I think there are tools parsing output of dmidecode: ohai and salt at least. Probably more. hwinfo?

      • jdelvare
        over 4 years ago by jdelvare | Reply

        hwinfo has its own DMI table decoder, it does not rely on dmidecode.

        I didn't know about ohai (I don't even know what it is) and salt. The output of dmidecode is plain text currently, it can be parsed if you are motivated enough, just you have to write your own parser and hope that the output format will never change in a way that will break your parser. I can understand why people would prefer a more structured output format.

    • jdelvare
      over 4 years ago by jdelvare | Reply

      Last week I posted preliminary clean-up patches that I came up with during the project:

      https://lists.nongnu.org/archive/html/dmidecode-devel/2020-03/threads.html

      There were no objections, so I committed them yesterday.

    • jdelvare

    Similar Projects

    Add a machine-readable output to dmidecode by jdelvare

    Description

    There have been repeated requests for a machine-friendly dmidecode output over the last decade. During Hack Week 19, 5 years ago, I prepared the code to support alternative output formats, but didn't have the time to go further. Last year, Jiri Hnidek from Red Hat Linux posted a proof-of-concept implementation to add JSON output support. This is a fairly large pull request which needs to be carefully reviewed and tested.

    Goals

    Review Jiri's work and provide constructive feedback. Merge the code if acceptable. Evaluate the costs and benefits of using a library such as json-c.


    Add a machine-readable output to dmidecode by jdelvare

    Description

    There have been repeated requests for a machine-friendly dmidecode output over the last decade. During Hack Week 19, 5 years ago, I prepared the code to support alternative output formats, but didn't have the time to go further. Last year, Jiri Hnidek from Red Hat Linux posted a proof-of-concept implementation to add JSON output support. This is a fairly large pull request which needs to be carefully reviewed and tested.

    Goals

    Review Jiri's work and provide constructive feedback. Merge the code if acceptable. Evaluate the costs and benefits of using a library such as json-c.


    FizzBuzz OS by mssola

    Project Description

    FizzBuzz OS (or just fbos) is an idea I've had in order to better grasp the fundamentals of the low level of a RISC-V machine. In practice, I'd like to build a small Operating System kernel that is able to launch three processes: one that simply prints "Fizz", another that prints "Buzz", and the third which prints "FizzBuzz". These processes are unaware of each other and it's up to the kernel to schedule them by using the timer interrupts as given on openSBI (fizz on % 3 seconds, buzz on % 5 seconds, and fizzbuzz on % 15 seconds).

    This kernel provides just one system call, write, which allows any program to pass the string to be written into stdout.

    This project is free software and you can find it here.

    Goal for this Hackweek

    • Better understand the RISC-V SBI interface.
    • Better understand RISC-V in privileged mode.
    • Have fun.

    Resources