Direct memory access

Direct memory access (DMA) is a feature of many computer systems that allows certain hardware subsystems to access main system memory independently of the central processing unit (CPU).

Uses your system voice; voice and rate in settings.

Snapshot

≈ 7 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

Direct memory access (DMA) is a feature of many computer systems that allows certain hardware subsystems to access main system memory independently of the central processing unit (CPU). Without DMA, programmed input–output must be used to transfer data which typically fully occupies the CPU for the entire duration of the transfer, and is thus unavailable to perform other work.

With DMA, the CPU first initiates the transfer, then it does other operations while the transfer is in progress, and it finally receives an interrupt from the direct memory access controller (DMAC) when the operation is done. This feature is useful at any time that the CPU cannot keep up with the rate of data transfer, or when the CPU needs to perform work while waiting for a relatively slow data transfer.

Many hardware systems use DMA, including disk drive controllers, graphics cards, network cards, sound cards and dedicated DMA controllers (acting on behalf of the aforementioned device types). DMA is also used for intra-chip data transfer in some multi-core processors.

Computers that have DMA capability can transfer data to and from devices with much less CPU overhead than computers without DMA. DMA can also be used for memory-to-memory transfers. DMA can offload expensive memory operations, such as large copies or scatter-gather operations, from the CPU to a DMA controller.…

Direct memory access (DMA) is a feature of many computer systems that allows certain hardware subsystems to access main system memory independently of the central processing unit (CPU). Without DMA, programmed input–output must be used to transfer data which typically fully occupies the CPU for the entire duration of the transfer, and is thus unavailable to perform other work.

With DMA, the CPU first initiates the transfer, then it does other operations while the transfer is in progress, and it finally receives an interrupt from the direct memory access controller (DMAC) when the operation is done. This feature is useful at any time that the CPU cannot keep up with the rate of data transfer, or when the CPU needs to perform work while waiting for a relatively slow data transfer.

Many hardware systems use DMA, including disk drive controllers, graphics cards, network cards, sound cards and dedicated DMA controllers (acting on behalf of the aforementioned device types). DMA is also used for intra-chip data transfer in some multi-core processors.

Computers that have DMA capability can transfer data to and from devices with much less CPU overhead than computers without DMA. DMA can also be used for memory-to-memory transfers. DMA can offload expensive memory operations, such as large copies or scatter-gather operations, from the CPU to a DMA controller.

An implementation example is the I/O Acceleration Technology. DMA is of interest in network-on-chip and in-memory computing architectures. While hardware acceleration is usually vendor-specific, direct memory access can be used by the class driver.

Third-party

of a NeXTcube computer (1990). The two large integrated circuits below the middle of the image are the DMA controller (left) and - unusual - an extra dedicated DMA controller (right) for the magneto-optical disc used instead of a hard disk drive in the first series of this computer model. Standard DMA, also called third-party DMA, uses a DMA controller.

A DMA controller can generate memory addresses and initiate memory read or write cycles. It contains several hardware registers that can be written and read by the CPU. These include a memory address register, a count register, and one or more control registers.

Depending on what features the DMA controller provides, these control registers might specify some combination of the source, the destination, the direction of the transfer (reading from the I/O device or writing to the I/O device). To carry out an input, output or memory-to-memory operation, the host processor initializes the DMA controller with a count of the number of words to transfer, and the memory address to use.

The CPU then commands the peripheral device to initiate a data transfer. The DMA controller then provides addresses and read/write control lines to the system memory. Each time a byte of data is ready to be transferred between the peripheral device and memory, the DMA controller increments its internal address register until the full block of data is transferred.

80386 and 32-bit systems

Particularly, the advent of the 80386 processor in 1985 and its capacity for 32-bit transfers (although great improvements in the efficiency of address calculation and block memory moves in Intel CPUs after the 80186 meant that PIO transfers even by the 16-bit-bus 286 and 386SX could still easily outstrip the 8237), as well as the development of further evolutions to (EISA) or replacements for (MCA, VLB and PCI) the "ISA" bus with their own much higher-performance DMA subsystems (up to a maximum of for EISA, MCA, typically VLB/PCI) made the original DMA controllers seem more of a performance millstone than a booster. They were supported to the extent that they are required to support built-in legacy PC hardware on later machines.

The pieces of legacy hardware that continued to use ISA DMA after 32-bit expansion buses became common were Sound Blaster cards that needed to maintain full hardware compatibility with the Sound Blaster standard; and Super I/O devices on motherboards that often integrated a built-in floppy disk controller, an IrDA infrared controller when FIR (fast infrared) mode is selected, and an IEEE 1284 parallel port controller when ECP mode is selected. In cases where an original 8237s or direct compatibles were still used, transfer to or from these devices may still be limited to the first 16 MB of main RAM regardless of the system's actual address space or amount of installed memory.

Each DMA channel has a 16-bit address register and a 16-bit count register associated with it. To initiate a data transfer, the device driver sets up the DMA channel's address and count registers together with the direction of the data transfer, read or write. It then instructs the DMA hardware to begin the transfer.

When the transfer is complete, the device interrupts the CPU. Scatter-gather or vectored I/O DMA allows the transfer of data to and from multiple memory areas in a single DMA transaction. It is equivalent to the chaining together of multiple simple DMA requests.

The motivation is to offload multiple input/output interrupt and data copy tasks from the CPU. DRQ stands for Data request; DACK for Data acknowledge. These symbols, seen on hardware schematics of computer systems with DMA functionality, represent electronic signaling lines between the CPU and DMA controller.

Each DMA channel has one Request and one Acknowledge line. A device that uses DMA must be configured to use both lines of the assigned DMA channel. 16-bit ISA permitted bus mastering.

Standard ISA DMA assignments:

Text derived from https://en.wikipedia.org/w/index.php?oldid=1375725770 under CC BY-SA 4.0; modifications have been made.

Sources cited in this revision

19 named source(s) extracted from the cited revision. A source with no author is shown by its publication; nothing is invented.