I'm trying to understand PCI system architecture. As I know there are several PCI commands like i/o read-write, memory read-write, configuration read-write etc. If CPU communicates peripherals with their port registers(status,control,data) what is memory read-write command for?

Is it about reading data from onboard memory of PCI device?


Basic answer

Many devices have some memory used to communicate with another devices or CPU.

RAM memory is not only memory in your computer. It is just "general purpose memory".

Hard disk controller has some memory used as buffer. If you are saving file - your CPU puts data into memory of hard disk controller, puts data into control registers and disk controller starts working on it. CPU just puts data into that disk controller memory and is not busy anymore.

Similar with graphics cards, sound cards, network cards. They must have some memory in order to work.

Lets say, we are building very simple "graphics card" for PCI that supports 1 pixel "screen" and that pixel is just a LED with 8-bit brightness control (0-255). We connect that diode to some microcontroller, and add 1 byte memory outside. We connect that memory to PCI and microcontroller.

Our microcontroller reads memory every frame and controls our LED according to data read from memory. On computer side - we just use PCI memory write command and we write 0-255 numbers into that memory.

This is how simple PCI devices work. All information above is very simplified for better understanding.

More advanced answer (if you already know something about PC hardware)

In PCI there are few adress spaces.

Memory addresses are 32 bit wide (there is also 64-bit PCI-X / not PCI Express!), support caching and can be burst transactions.

There are also I/O addresses and they are compatybile Intel x86 architecture's I/O port address space.

  • thanks for ur answer but I'm not sure that i understood the mechanism, why pci slot has 32 pins for addressing? In x86 architecture I/O instructions(in,out,ins,outs) purpose is accessing I/O devices port registers,u can check the status of a peripheral by reading status register,u can give a command to peripheral by writing data to command register so why a lot of pins are used for addressing PCI devices if cpu talks with device registers with limited count? – spartacus Nov 26 '14 at 15:54
  • These address pins are used for accessing whole PCI device memory, not just for accesing few tiny command registers. Commands are only used for something like "hello PCI card, I wrote 1GB of data in your memory, start working on it". – Kamil Nov 26 '14 at 16:06
  • But I may be wrong at some details. Please refer to PCI specyfications if you want more reliable information source. – Kamil Nov 26 '14 at 16:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.