Question

Probably a super basic question, however I was reading this: http://www.tldp.org/LDP/tlk/dd/pci.html and I was curious, when I write to a PCI memory space address, exactly what am I writing to?

Am I writing to memory modules on the PCI device? A special sub-section of my system's memory? Memory attached to the mainboard specifically for the use of the PCI bus? Is it completely architecture dependent and intentionally left vague?

Was it helpful?

Solution

So what happens is that there's this thing called a 'Memory Controller' that sits between the CPU and the RAM. Whenever you address anything in memory, it passes through the memory controller.

When the system starts up, the memory controller (google for 'Intel GMCH' for more info on the intel version) that is typically integrated with the PCI root hub scans the PCI bus for all devices and their capabilities. It then sets aside 'virtual' addresses for all the PCI memory spaces.

When you write to these virtual addresses, the memory controller knows to forward anything in that address range to the PCI device instead of main memory (or other device).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top