Direct Memory Access (DMA) is a method that allows hardware devices to transfer data directly to or from
main memory, bypassing the CPU. This boosts overall system performance by offloading data transfer
tasks from the CPU, allowing it to handle other operations simultaneously.
How DMA Works
•The CPU initiates a DMA transfer by setting up the DMA controller with the source, destination addresses,
and the amount of data to transfer. •The DMA controller takes over the system bus, manages the data
transfer between memory and the I/O device, and frees the CPU from being involved in the actual data
movement. •Once the transfer is complete, the DMA controller interrupts the CPU to signal the end of the
operation.
Steps in a DMA Operation •CPU programs the DMA controller with transfer details (source, destination,
count). •DMA controller requests control of the bus (Bus Request). •CPU grants the bus (Bus Grant) and
becomes idle regarding the transfer. •DMA controller manages the data transfer directly between memory
and the I/O device. •After completion, DMA controller interrupts the CPU to indicate that the transfer is
done.
Types of DMA Transfers •Memory-to-memory •I/O device to memory •Memory to I/O device
•Communication ports to/from memory
Advantages •Reduces CPU overhead for data transfer. •Increases system throughput and efficiency.
•Allows parallel processing: CPU can process other tasks while DMA handles data movement.
Diagram Explanation:
•The DMA controller acts as a bridge between the I/O device and memory.
•The CPU sets up the DMA controller but is not involved in the actual data transfer.
•Once the DMA controller has control, it manages the transfer directly between the I/O device and
memory.
•After the transfer, the DMA controller notifies the CPU via an interrupt.