简体   繁体   中英

Common way to get BIOS information via C

After reading some stuff it seems I can map the SMBIOS memory and parse it. I have no idea on how to go about this. I can't use any managed code as I would like this to be compilable under any OS.

Does anyone have any code examples how to go about this?

On most systems, it is not mapped into user-mode accessible memory, so you need to call some system API.

On Windows, you can call GetSystemFirmwareTable .

For Linux I guess you should have a look at the dmidecode source (GPL) for concrete code...

Using and parsing dmidecode output may be all you need...

I wrote a reusable class to read all the SMBIOS stuff.

It is very clean code with a proper error handling and easy to extend. You can derive a class from this class that uses the parsed data to display it or do whatever you want with it.

You find also a link to the actual SMBios documentation in the code's comments.

You can download it from my homepage: ftp://ftp.netcult.ch/mirror/elmue/SMBiosClass.zip

Elmue

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM