Input / Output
I/O Controller
The I/O controller is responsible for monitoring devices when they have information that needs to be
transferred. This controller will schedule the interrupts for different devices and make sure that the
device is ready so that data transfers can go smoothly and without hiccup.
Standard DMA
DMA allows devices to directly access memory without the need to channel their requests through the
processor. By directly accessing memory, they allow the processor to carry on uninterrupted at its
task.
DMA is achieved by having a device send a special request to the DMA controller. The DMA
controller, in turn will send another signal to the CPU, indicating that a device wants to access memory.
This signal is known as a Bus Request signal. The CPU will then close all I/O
requests, and clear the address bus and data bus. It will then notify the DMA
controller that it is free to use the bus. The DMA controller will act like a basic secondary
CPU, and process the device's memory requests.
During this state, no other device is allowed to use either the address bus, or the data
bus, including the CPU. The device and DMA controller have complete access to it - this is called
bus mastering. The device is able to burst information over the bus because it is free from
interrupts, which is one of the reasons why DMA offers improved transfer speed over PIO
transfers.
When the memory access is complete, the DMA controller frees the address bus and data
bus, and then notifies the CPU that it may resume normal control. During bus mastering,
the CPU is continuing on with its processing with the information which is stored in its cache.
Because the CPU will eventually need more information after a few clock cycles, bus mastering
was never designed to last any significant length of time.
There are 8 DMA buses in all systems, and each of these buses can be used by only one device each.
Devices that use DMA are assigned which channel to use during boot time.
| DMA | Common Device |
| 0 | (free) |
| 1 | (free) |
| 2 | Floppy Drive |
| 3 | Parallel Port |
| 4 | DMA Controller |
| 5 | Legacy Sound Card |
| 6 | (free) |
| 7 | (free) |
The Direct Memory Access controller acts like a second CPU which is dedicated to moderating the
memory access. Instead of channeling requests through the CPU, DMA devices send their requests
through their dedicated DMA channel to the DMA controller.
Ultra DMA
Ultra DMA is an improvement over DMA in that it no longer uses DMA channels for memory access
by DMA devices. Each UDMA device can act as its own DMA controller, and perform all the nessisary
operations to control the data bus.
Interrupt (IRQ) | Input / Output (I/O)
|