Without DMA, the CPU must handle every byte of data transferred between I/O devices and memory. For large transfers like disk reads or network packets, this wastes CPU cycles on simple copy operations, leaving no time for actual computation.
Programmed I/O is a method where the CPU actively participates in every byte/word transfer between I/O devices and memory, using special I/O instructions or memory-mapped I/O reads/writes.
- CPU issues a read/write command to the I/O device
- CPU polls the device status register to check if ready
- For each byte/word: CPU reads from device → writes to memory (or vice versa)
- CPU repeats step 3 for the entire data block
- CPU is fully occupied during the entire transfer — no other work can be done
- CPU is blocked during entire transfer — cannot do other work
- Simple to implement — no special hardware needed beyond basic I/O interface
- Slow for large transfers — each byte requires CPU intervention
- CPU overhead is proportional to data size
- Contrasts with: DMA — DMA frees CPU during transfer, Programmed I/O keeps CPU busy
- Built from: O System, Device Controller
- Builds into: O Request to Hardware Operation (when DMA not available)
- Related: Polling — CPU busy-waits for device ready
- For very small data sizes, Programmed I/O can be faster than DMA setup overhead
- Some embedded systems use Programmed I/O exclusively (no DMA controller)
- CPU cache effects: repeated loads/stores may pollute cache during PIO