Concept:
In traditional computer architectures, the CPU is responsible for every data transfer. In "Programmed I/O," the CPU must constantly poll the device. In "Interrupt-driven I/O," the CPU is interrupted for every byte/word transferred. For high-speed devices (like hard drives or network cards), this creates a massive bottleneck.
DMA (Direct Memory Access) was designed to offload this burden. It allows an external device (via a DMA Controller) to take control of the system bus and transfer data directly to/from memory.
Step 1: How the DMA process works.
The process involves three main stages:
• Initialization: The CPU tells the DMA Controller the starting address in memory, the device address, the direction of transfer (Read/Write), and the total number of bytes.
• Transfer: The DMA Controller requests control of the bus (Hold request). Once the CPU grants it, the Controller moves data block-by-block without the CPU's help.
• Completion: Once all data is moved, the DMA Controller sends an interrupt to the CPU to signal that the task is finished.
Step 2: CPU Efficiency Gains.
During the "Transfer" phase, the CPU can execute other unrelated instructions or processes. It doesn't need to spend cycles moving data bits. This is often called "Cycle Stealing" because the DMA unit "steals" bus cycles from the CPU only when necessary.
Step 3: Conclusion.
Therefore, the primary goal of DMA is to facilitate high-speed data transfer while keeping the CPU free for actual computation rather than acting as a data-shoveler.