3

I am trying to develop a C function for getting some motherboard info (name, id, etc.) but I can't find where these info are stored. I had a look at CPUID but I could't find anything related to the motherboard there (although lots of info regarding the CPU).

Does anyone know from where can I get these info?

Thanks a lot.

bdonlan
  • 224,562
  • 31
  • 268
  • 324
limp
  • 889
  • 2
  • 14
  • 22

2 Answers2

6

CPUID returns information about the CPU itself (hence the name); it does not return information about the motherboard. Your OS will likely have some way of querying ACPI data, which may (if the motherboard's manufacturer bothered to record such information) have what you're looking for; the exact method to do so depends on your OS, however.

If you're coding to the bare metal, your first stop is the ACPI tables. Of particular interest may be the OEMID and OEM Table ID in the DSDT; you might find model information elsewhere as well. Be warned, however, that BIOSes tend to be full of interesting bugs, and there's no guarantee that the manufacturer has filled in anything that's not absolutely necessary to get Windows to boot.

Non-ACPI systems are generally obsolete, at least for PC hardware. If you're on a non-ACPI system, good luck. There is no standardized location for motherboard identification information on a non-ACPI system. You can try to probe the hardware and guess based on a table of known hardware profiles, but that's the best you can do.

bdonlan
  • 224,562
  • 31
  • 268
  • 324
  • +1: Agreed. It's motherboard firmware that's going to have this information, and it must be queried using the appropriate interfaces. – Aaron Klotz Jul 12 '11 at 15:31
  • That's a bit vague. How CPU-Z get's this info for instance? If this is ACPI, which table has that (but then, what happens to non-ACPI systems)? – limp Jul 12 '11 at 16:57
  • @limp, like I said, we need your OS before giving any specific advice. The exact methods for retrieving hardware information depend on the OS. – bdonlan Jul 12 '11 at 17:10
1

I would start with the dmidecode source and the standards it references (SMBIOS/DMI).

Nemo
  • 70,042
  • 10
  • 116
  • 153