The CPU cannot directly manipulate hardware signals (move disk arm, read magnetic flux). It needs a hardware intermediary that understands both the CPU’s bus interface and the device’s physical interface.
A device controller is a hardware component that interfaces between the system bus and the physical I/O device, containing registers for commands, data, and status, plus local buffers for data transfer.
- CPU (via driver) writes commands and parameters to controller’s registers
- Controller parses registers to determine operation (read/write/seek)
- Controller executes operation on the physical device
- Data transfers to/from controller’s local buffer
- Controller raises interrupt when operation completes
- CPU reads status register to check success/failure
- Contains three types of registers: control, data, and status
- Has local buffer to hold data during transfer
- Can operate asynchronously from CPU (using DMA)
- Sits on the system bus, addressed like memory (memory-mapped I/O)
- Built from: System Bus, O System
- Builds into: O Request to Hardware Operation
- Related: Device Driver, DMA, Interrupt Handler
- Contrasts with: Device Driver (software vs hardware)
- Register addresses vary by device — driver must know the correct addresses
- Local buffer size limits transfer size per operation
- Status register must be read before another command is issued
- Some controllers have buggy implementations causing race conditions