I/O addressing related
-
- Posts: 16
- Joined: Sat Aug 23, 2008 4:13 am
I/O addressing related
When the CPU generates an I/O address,how does a device know it is being addressed?I mean,what & how association is made between the CPU generated number(address) & a device?Where is this association stored for future use?
Re: I/O addressing related
A few legacy devices have hardcoded "traditional" IO port addresses that can be found in the wiki articles for those particular devices, or in RBIL.
Other devices have internal registers that allow the driver to choose from a very short list of "legal" IO ports for that device. The setup procedure for those is device-specific.
PCI devices usually have their IO port addresses set by the BIOS during bootup. Their IO addresses are stored in the BARs in their PCI Configuration Spaces.
Other devices have internal registers that allow the driver to choose from a very short list of "legal" IO ports for that device. The setup procedure for those is device-specific.
PCI devices usually have their IO port addresses set by the BIOS during bootup. Their IO addresses are stored in the BARs in their PCI Configuration Spaces.
-
- Posts: 16
- Joined: Sat Aug 23, 2008 4:13 am
Re: I/O addressing related
But my question remains-how does the CPU know which is the intended device?Is the device address specified in the instruction?bewing wrote:A few legacy devices have hardcoded "traditional" IO port addresses that can be found in the wiki articles for those particular devices, or in RBIL.
Other devices have internal registers that allow the driver to choose from a very short list of "legal" IO ports for that device. The setup procedure for those is device-specific.
PCI devices usually have their IO port addresses set by the BIOS during bootup. Their IO addresses are stored in the BARs in their PCI Configuration Spaces.
Re: I/O addressing related
Hi,
Typically, the I/O hub (or PCI host controller) would recognize the I/O port as something it should forward to the PCI bus, so it does, and everything on the PCI bus will check to see if it's something it should respond to. This means an actual device on the PCI bus might respond and send it's response to the PCI host controller (via. the PCI bus) and the PCI host controller would forward the response to the CPU (via. the FSB).
It's also possible for the request to be forwarded through a PCI to PCI bridge or through a PCI to LPC bridge, and it's possible for a request to pass through many different buses until something actually responds (instead of forwarding it). Still, the basic idea is the same - any device could respond to any request and only the device itself really knows what it will respond to (but devices are designed to only respond when they should, depending on device type, standards, etc).
Cheers,
Brendan
The CPU doesn't know or care. It says "I want to read from I/O port 0x1234" on the front-side bus and waits for a response. Everything else on the front-side bus checks to see if it should respond.abhishekmaharana wrote:But my question remains-how does the CPU know which is the intended device?Is the device address specified in the instruction?
Typically, the I/O hub (or PCI host controller) would recognize the I/O port as something it should forward to the PCI bus, so it does, and everything on the PCI bus will check to see if it's something it should respond to. This means an actual device on the PCI bus might respond and send it's response to the PCI host controller (via. the PCI bus) and the PCI host controller would forward the response to the CPU (via. the FSB).
It's also possible for the request to be forwarded through a PCI to PCI bridge or through a PCI to LPC bridge, and it's possible for a request to pass through many different buses until something actually responds (instead of forwarding it). Still, the basic idea is the same - any device could respond to any request and only the device itself really knows what it will respond to (but devices are designed to only respond when they should, depending on device type, standards, etc).
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.