DMA stands for Direct Memory Access, a capability in modern computers that allows peripheral devices to send data to the motherboard’s memory without intervention from the CPU.
The DMA controllers are special hardware – now embedded into the chip in modern integrated processors – that manage the data transfers and arbitrate access to the system bus. The controllers are programmed with source and destination pointers (where to read/write the data), counters to track the number of transferred bytes, and settings, which includes I/O and memory types, interrupts and states for the CPU cycles.
Transfers are initiated when the DMA controller is notified of the need to move data to the memory by some event (keyboard press or mouse click, for examples). The controller asserts a DMA request signal to the CPU to use the system bus. The CPU completes its current operation and yields control of the bus to the DMA controller via a DMA acknowledge signal. The controller then reads and writes data and controls signals as if it is the CPU, which at that instant is tri-stated (idled). Upon completion of the transfer, DMA controller de-asserts the DMA request signal and the CPU in turn removes its DMA acknowledge signal and resumes control of the bus.
DMA is implemented in computer bus architectures to speed up computer operations and allow multitasking. Normally, the CPU will be fully occupied in any read/write operation; enabling DMA allows reading/writing data in the internal memory, external memory and peripherals without CPU involvement, thus making the processor available for other tasks. This ensures streamlined operations, as movement of data to/from memory is one of the most common computer operations and freeing the CPU of this overhead can lead to a significant improvement in performance.
DMA is useful in real-time computing applications where critical operations must be done concurrently. Stream processing is another application of DMA, where transfer and data processing are done simultaneously. Many hardware systems use DMA including floppy and disk drive controllers, graphics cards, network cards, sound cards and graphics processing units.
Synchronous DMA moves a byte or word at a time between system memory and a peripheral. After completing each transfer, the DMA asks the I/O port to signal when the latter is ready for another transaction. In this set-up, the DMA and the CPU shares the bus cycles, with the DMA winning any contest for system bus control.
Burst Mode DMA assumes that both the destination and source can take transfers as quickly as the controller can make them. The CPU sets up the controller, and after a signal from the I/O port, the entire data is copied to the destination. The DMA controller has sole access to the system bus during the transfer which is very rapid compared to synchronous DMA.
Flyby DMA, which is not supported by all controllers, puts out the source or destination address, then initiates a simultaneous read and write cycle. Flyby transfers are very fast as the read cycle and write cycle are compressed to a single cycle. Flyby can support both burst and synchronous types of transactions.
How to Enable DMA
For those with newer PC’s with Windows installed, this problem is basically solved from the start, because Windows automatically enables DMA for most compatible hardware.
There are certain circumstances where Windows XP instead enables PIO, which are documented in DMA Mode for ATA/ATAPI Devices in Windows XP.
How to Enable DMA under Windows 2000
- Go to Programs, Administrative Tools, then Computer Management
- Open the IDE ATA/ATAPI controllers tree
- Double-click the primary (or secondary, depending on what drive you are enabling it for) IDE channel then select Advanced Options
- Next to transfer mode, select “DMA if available”
How to Enable DMA under Windows 98
- Open the Control Panel and then the System applet
- Select the Device Manager Tab
- Click on Hard-Disk Controllers and press Properties
- Check the DMA-enabled box
- Restart your computer
How to Enable DMA under Windows NT
- Open RegEdit
- Go to HKEY_LOCAL_MACHINEHARDWAREDEVICEMAPScsiScsi Port 0 and set the DMAEnabled value to 1 (enabled)
- Restart your computer
How to Enable DMA under Windows ME
- Go to My Computer
- Right click on the appropriate drive and select Properties
- Enable DMA