Eroxl's Notes
Direct Memory Access

Direct Memory Access (DMA) is a capability that allows an I/O controller to directly transfer data to and from main memory without CPU involvement. DMA enables the CPU and I/O controllers to work in parallel, with controllers autonomously moving data while the CPU performs other tasks.

Operation

The CPU configures DMA transfers using PIO to send the controller:

  • The memory address for the transfer
  • The number of bytes to transfer
  • The direction (read from or write to memory)

Once configured, the controller performs the transfer independently. When complete, the controller typically signals the CPU using an interrupt.

Advantages

  • Parallelism: The CPU can continue executing instructions while the controller transfers data
  • Efficiency: Large data transfers don't consume CPU cycles
  • Performance: The system can overlap computation with I/O operations

DMA is essential for high-performance I/O operations such as disk reads/writes and network packet transfers.