Principle
A DMA controller can generate addresses and initiate memory read or write cycles. It contains several registers that can be written and read by the CPU. These include a memory address register, a byte count register, and one or more control registers. The control registers specify the I/O port to use, the direction of the transfer (reading from the I/O device or writing to the I/O device), the transfer unit (byte at a time or word at a time), and the number of bytes to transfer in one burst.
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 sends commands to a peripheral device to initiate transfer of data. The DMA controller then provides addresses and read/write control lines to the system memory. Each time a word 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.
DMA transfers can either occur one word at a time or all at once in burst mode. If they occur a word at a time, this can allow the CPU to access memory on alternate bus cycles - this is called cycle stealing since the DMA controller and CPU contend for memory access. In burst mode DMA, the CPU can be put on hold while the DMA transfer occurs and a full block of possibly hundreds or thousands of words can be moved. When memory cycles are much faster than processor cycles, an interleaved DMA cycle is possible, where the DMA controller uses memory while the CPU cannot.
In a bus mastering system, both the CPU and peripherals can be granted control of the memory bus. Where a peripheral can become bus master, it can directly write to system memory without involvement of the CPU, providing memory address and control signals as required. Some measure must be provided to put the processor into a hold condition so that bus contention does not occur.
Read more about this topic: Direct Memory Access
Famous quotes containing the word principle:
“For me chemistry represented an indefinite cloud of future potentialities which enveloped my life to come in black volutes torn by fiery flashes, like those which had hidden Mount Sinai. Like Moses, from that cloud I expected my law, the principle of order in me, around me, and in the world.... I would watch the buds swell in spring, the mica glint in the granite, my own hands, and I would say to myself: I will understand this, too, I will understand everything.”
—Primo Levi (19191987)
“In case I conk out, this is provisionally what I have to do: I must clarify obscurities; I must make clearer definite ideas or dissociations. I must find a verbal formula to combat the rise of brutalitythe principle of order versus the split atom.”
—Ezra Pound (18851972)
“The more the specific feelings of being under obligation range themselves under a supreme principle of human dependence the clearer and more fertile will be the realization of the concept, indispensable to all true culture, of service; from the service of God down to the simple social relationship as between employer and employee.”
—Johan Huizinga (18721945)