I/O Handling Methods: DMA I/O
- A computer using Direct Memory Access I/O introduces an additional processor (CPU-like device) called a direct-memory access controller or DMA controller whose sole purpose is to manage I/O data.
This is done in order to free the CPU from reading all the data from the input device or writing all the data to an output device, which is what the CPU does during program-controlled and interrupt-based I/O. Here is the process:
- The main CPU issues a command to the DMA controller with the following info:
- The ID or number of the device to which data should be transferred,
- The location (address) to the beginning of the data within memory, and
- The total number of bytes to be transferred.
Note that (2) and (3) tell precisely what chunk of data should be transferred.
- The DMA controller proceeds to handle the I/O, while the main CPU continues running other programs.
- When the DMA finishes its work, it raises an interrupt to inform the CPU that the data transfer is complete.