- Year not given
Programmed I/O disadvantages; DMA
Short answer
Programmed I/O wastes CPU time polling and transferring each byte, reducing throughput and preventing computation overlap. DMA uses a controller to transfer blocks directly between memory and device, interrupting only when done, offloading the CPU.
What are the disadvantages of programmed I/O? Explain about DMA.
Programmed I/O (PIO)
In programmed I/O the CPU itself does all the data transfer. It polls the device status again and again (busy waiting) until the device is ready, then moves one byte/word at a time between memory and the device register.
Disadvantages of programmed I/O
- The CPU is kept busy in a polling loop, so CPU time is wasted, since devices are slow compared with the CPU.
- No other process can use the CPU during the transfer, so system throughput falls.
- The CPU must handle every byte, so large transfers are slow.
- Computation cannot overlap with I/O.
- It is poor for devices that supply data at unpredictable times.
Direct Memory Access (DMA)
DMA lets special hardware, the DMA controller, transfer a whole block of data between memory and a device directly, without the CPU handling each byte. The CPU only starts the transfer and receives one interrupt at the end.
CPU <----> Memory <----> Device ctrl
| ^ | ^
| | +--- bus ----+
+--> DMA controller (address, count, control regs)
Steps of a DMA read
- The CPU programs the DMA controller with the memory address, byte count, direction and device, and then carries on with other work.
- The DMA controller asks the disk controller to transfer the data it has read into its buffer.
- The disk controller transfers the data over the bus to the given memory address.
- The DMA address register is incremented and the count decremented after each transfer.
- When the count reaches zero, the DMA controller interrupts the CPU to say that the transfer is complete.
Modes: cycle stealing (one word at a time; the controller steals a bus cycle from the CPU) and burst mode (the controller holds the bus and transfers a whole block).
| Point | Programmed I/O | DMA |
|---|---|---|
| CPU involvement | During the whole transfer | Only at start and end |
| Speed for big blocks | Slow | Fast |
| Interrupts | None (the CPU polls) | One per block |
| Hardware | Simple | Needs a DMA controller |
DMA is therefore the best choice for fast devices like disks.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Programmed I/O, DMA, device-independent software · Operating System, chapter 6
- Programmed vs interrupt-driven vs DMA · Computer Organization and Architecture, chapter 7 · asked 5×
- DMA vs programmed and interrupt-driven I/O · Computer Organization and Architecture, chapter 7 · asked 3×