Page 1 of 1

How to list devices ? PCI scan OR SMBIOS ?

Posted: Thu Oct 30, 2008 3:57 pm
by posman
Hi to all

I have some questions (and hope someone can clarify my doubts)
I'm trying to enumerate all the devices. Right now I've implemented PCI enumeration. But I've been reading the forum/wiki and saw that this task could be implemented using SMBIOS. (Or am I wrong? :^o )

If both could be used for the same task (enumerate devices):
Are there any advantages using SMBIOS instead of PCI?
Does one of this replace the other or they complement each other?
Could PCI/SMBIOS list some devices that the other can't?

Or maybe they should be used for totally different things?
should I implement both?

Re: How to list devices ? PCI scan OR SMBIOS ?

Posted: Thu Oct 30, 2008 8:14 pm
by Brendan
Hi,
posman wrote:I'm trying to enumerate all the devices. Right now I've implemented PCI enumeration. But I've been reading the forum/wiki and saw that this task could be implemented using SMBIOS. (Or am I wrong? :^o )
SMBIOS is intended to provide administrators (end users) with information about the hardware, to make it easier to track the hardware in a company (e.g. asset management), and for finding out what sort of RAM/PCI/ISA sockets/slots are there for upgrades purposes, etc. It's not intended for OS configuration, may not be supported by the BIOS (especially older BIOSs), and it can return dodgy results, or no results, or results that lack the information an OS needs.

For example, someone upgrading the hardware in a computer might be glad to know that there's 2 RAM slots and one 512 MiB DDR RAM chip in the first RAM slot; but an OS doesn't care about this - an OS needs to know which areas of RAM are *usable*, including where these areas are in the physical address space.
posman wrote:Does one of this replace the other or they complement each other?
Scanning PCI won't tell you about ISA devices (including ISA devices built into the motherboard, like PIT, PIC, etc), or RAM sockets, or empty PCI slots, or motherboard vendor, motherboard model number/product code, etc. SMBIOS might tell you this information.

IMHO, for software configuration purposes, any information you can get from interfaces designed for software configuration should take precedence over any information you can get from interfaces that weren't designed for software configuration... ;)

This means that (for e.g.) for information on PCI devices, you should ignore SMBIOS and get everything from PCI configuration space.
posman wrote:Or maybe they should be used for totally different things?
should I implement both?
They are *intended* to be used for totally different things; but, in some cases you may not have any choice and might need to use SMBIOS for something it wasn't intended for. For example, if you need to know the motherboard manufacturer and model number (e.g. to work around hardware or firmware bugs), then SMBIOS is probably the only sane way to get it.


Cheers,

Brendan

Re: How to list devices ? PCI scan OR SMBIOS ?

Posted: Fri Oct 31, 2008 7:24 am
by djmauretto
Ciao,
For enumerate standard device ( keyboard,PIT,PIC,Real-Time Cloc,Speaker and so on) use BIOSPnP function
for other device use PCI ;-)