Unit content
Device controllers and memory-mapped I/O
A processor communicates with hardware devices through device controllers that expose a small interface of status, control and data registers.
A controller register can be mapped into the processor's ordinary address space. Reading or writing that address then communicates with hardware rather than ordinary RAM. This is memory-mapped I/O.
Registers often contain packed fields: one bit may enable a peripheral, another may report that data is ready, while other bits select an operating mode. Software uses masks and carefully defined reads and writes because a register can have side effects that normal memory does not.
A simple driver can poll a status register until a condition becomes true and then read or write the associated data register. Polling is straightforward, but repeatedly checking an idle device spends processor time.
The controller therefore forms a hardware/software boundary. Software does not need to reproduce the device's internal electronics; it needs to obey the documented semantics of the registers that the device exposes.