views:

829

answers:

1

When you need to access registers in the PCI configuration space, do you simply need to used built-in BIOS functions to read/write DWORDs into the configuration space?

For example, if I am trying to use an IDE controller that is on B0:D31:F1 do I proceed to read/write the configuration register using that BDF as the parameters to the BIOS functions? So if I wanted to get the vendor id I would read the first DWORD in a given BDF?

Or am I just way off base?

EDIT:

In the PCI BIOS specification, I have been looking over the definitions of the BIOS functions for reading and writing words into the configuration space. Which I believe means that I can write into the registers at various offsets within the configuration space. I guess my question is, is this the correct way of accessing these registers at this level?

+1  A: 

After reading the PCI specification, I simply need to call the PCI BIOS functions through a given interrupt vector (1Ah). However, this is complicated by the PCI configuration which must happen before hand.

The PCI configuration space appears to not use an explicit address for access, but BIOS function calls.

EDIT: Actually, turns out the BIOS does a lot more than I knew. All I had to do was enumerate the PCI bus until I found the IDE controller's device and vendor ID. The only assembly needed was the in/out port wrappers.

TURBOxSPOOL