On Mon, May 21, 2007 at 06:18:53AM -0700, Andon Tschauschev wrote:
- Did I understood correctly how this pci mechanism for accessing
registers works? If not, how can I access them?
Yes and no.
- Why does the system crash, since I'm accessing registers only
read-only (except "outl(0xCF8, address)")?
Because the operating system may also be doing PCI accesses and there may be a conflict between your program and the kernel.
Using ports cf8/cfc is one way that PCI registers can be accessed, but it is only suitable if you are certain that you will be the only process using it.
If there is an operating system running, you should use the PCI enumeration API that the operating system provides. For Linux, look at libpci and/or pciutils. The application setpci can be used to peek and poke values in PCI config space.
//Peter