Entry
Does anyone know how to read the PCI configuration space with Python under Win 98 or Linux?
Jul 29th, 2000 21:25
unknown unknown, Shae Erisson, Erno Kuusela, Moshe Zadka, Tim Roberts
Under linux you have 3 options:
* use the lspci program. try lspci -x or lspci -vvv
* read the files under /proc/bus/pci/ (this is actually what the lspci
program does, but using lspci might save you from future format changes
in these files...)
* read /proc/pci
do this if you are using an older version of linux (2.0.x)
cat /proc/pci
Or, in Python,
open("/proc/pci").read()
Doing this under Windows requires a C extension, and even then it isn't
easy. Under Windows 98, you can scan the BIOS for the PCI entry point
and call it directly. Under Windows NT, even this doesn't work; you
need the help of a kernel driver.
Much of the interesting PCI information is buried in the registry, which
IS accessible from Python.