I/O Handling Methods
How can the CPU access an I/O device?
The CPU can use these registers in one of two ways:
- Port-mapped I/O (or Isolated I/O): A CPU would issue special I/O instructions that are transferred via busses to the registers of the device controller of the device that is specified by the instructions.
- Memory-mapped I/O: The contents of the device controller registers are copied (mapped) regularly to the main memory, so the CPU simply reads and writes to the memory addresses associated with the registers, which is faster than issuing I/O instructions. The controller, on the other hand, reads these memory locations to update its registers and writes data to memory if, for example, the device's status changes or when new I/O data is ready to be transferred.
Today, most I/O actions are performed by using memory-mapped I/O.