In kernel.org's documentation on proc
I found "[The latest version of this document is available online". There I says: "… lspci
is a synonym for cat /proc/pci
".
Which isn't the case here, on a Crunchbang 10 system (Debian based). No such directory. I do get the basic idea and, as far as I know, the content of proc
is (mainly) created during runtime. (Wrong?). This made me curious:
Question: Where does lspci
gather it's information from? And where is this documented? (Where did I miss something?)
Another difference I found: In kernel.org's documentation, under "Table 1-5: Kernel info in /proc
"
pci
Deprecated info of PCI bus (new way ->/proc/bus/pci/
, decoupled by `lspci)
Best Answer
lspci
is part of pciutils, which is portable to a variety of unix-like OS's and windows, so it presumably uses different methods depending on platform.You should be able to tell where it gets its info from in your case via
strace lspci
. After the preamble accessing libraries, etc, I (using fedora linux) get a lot ofopen()
+pread()
calls on stuff in/sys/bus/pci/
, e.g.:That's binary data. After this it reads in
/usr/share/hwdata/pci.ids
, which is a static universal list distributed with the pciutils package. These are four digit codes which presumably correspond to the info from/sys
.