← 🔌 I/O Interface, Interrupts & DMA
Subtopic 5 of 8

9.5DMA

The idea

DMA lets a special controller move whole blocks between device and memory without involving the CPU in every word.

Think of it like this: Hiring a courier to move boxes instead of carrying each one yourself.

Why it exists

Interrupt-driven I/O still wastes CPU time on each word; DMA frees the CPU.

How it works

  1. CPU programs the DMA controller with address, count and direction.
  2. The device requests transfers; the DMA gets the bus (HOLD/HLDA).
  3. The DMA moves words directly to memory.
  4. One interrupt tells the CPU when it is finished.

Worked example: 4-word transfer

CPU does 1 setup and 1 interrupt instead of 4 interrupts.

Now play with it

  • →Step through and watch the CPU "other work" while DMA moves data.
CPUrunning
DMA controller-
Device-
Memory-
  • CPU programs the DMA controller: memory address, word count, direction
  • CPU goes back to other work
  • Device signals DMA request: data is ready
  • DMA asks for the bus (HOLD), CPU grants it (HLDA)
  • DMA moves word 1 device → memory[1000], count = 3, no CPU involvement
  • Repeat until count = 0
  • DMA raises one interrupt: transfer complete. CPU runs a short ISR

Check yourself

In DMA, who moves the data between device and memory?

Remember: DMA = one setup, one completion interrupt.
Exam notes (the dense version)

A DMA controller moves blocks device ↔ memory without the CPU. CPU only sets up (address, count, direction) and is interrupted at the end.

Previous year questions: I/O Interface, Interrupts & DMA (8)

PYQs are grouped by topic, so this is the full set for I/O Interface, Interrupts & DMA; try the ones that match this subtopic. Open all 8 on the topic page.