I/O hardware: polling, interrupts and DMA
Compare the three transfer methods, animated.
Module 5
Session 5.1
Lesson 1 of 3
Programmed I/O, Interrupts, and DMA
Who copies the bytes, and how often the CPU is bothered.
Three ways to talk to a device
| Method | CPU role | When to use |
|---|---|---|
| Polling / programmed I/O | Spin on a status register; copy every byte | Tiny, cheap, or no interrupt line |
| Interrupt-driven | Sleep; handler runs per byte or per buffer | Typical character devices |
| DMA | Program the DMA engine; one interrupt per buffer | Disks, NICs, bulk transfer |
Software layers: syscall → file/socket layer → generic block/char → driver → bus. Buffering and caching sit in the middle so a read is not always a device access.