What is DMA?

Source: Internet
Author: User
What is DMA?
When we add a new sound card or other adapter to the computer, the installer may remind us to select a DMA channel. What is DMA?
Direct Memory Access (DMA) is a mechanism for fast data transmission. Data transmission can be performed from the adapter to the memory, from the memory to the adapter or from a memory segment to another memory segment. The importance of the DMA technology is that it does not require CPU involvement for data transmission. Each computer motherboard has a DMA controller, which is usually programmed by the computer and stored by a ROM on an adapter (such as a ROM on a floppy drive controller, these programs control the DMA transfer of data. Once the Controller Initialization is complete and data is transmitted, the DMA can be transferred independently from the CPU. Within a short period of time from the start of DMA transfer, there are basically two processors working for it, one executing program code and one transmitting data.
Another advantage of using DMA to transmit data is that the data is directly transmitted between the source address and the destination address without intermediate media. If the CPU transfers a byte from the adapter to the memory, two steps are required. First, the CPU reads this byte from the adapter to the internal register, and then transfers it from the register to the appropriate address in the memory. The DMA Controller Simplifies these operations as one step by operating the control signals on the bus so that the write bytes are completed once. This greatly improves the speed and efficiency of computer operation.
Today, with the development of computers, DMA is no longer used to transmit data from memory to memory. Because the CPU speed is very fast, it is faster than DMA control, however, to transmit data between the adapter card and the memory, it is still non-DMA. To transfer data from the adapter to the memory, DMA simultaneously triggers the bus that reads data from the adapter (that is, the I/O read operation) and writes data to the memory. Activating the I/O read operation enables the adapter to put a Data Unit (usually a byte or a word) on the PC Data Bus, because the memory write bus is also activated at this time, the data is copied from the PC bus to the memory at the same time. For each write operation, the DMA controller controls the address bus and notifies the memory segment to which data should be written.
The method for transferring DMA control data from memory to the adapter is similar to the above. For each unit of data to be transferred, the DMA controller activates the READ memory and I/O write operation bus. The memory address is placed on the address bus. Like transferring data from the adapter to the memory, the Data Bus is used as the channel, and the data is directly transmitted from the source address to the destination address.
DMA receives DMA requests from the DMA request line (dreq), just as the interrupt controller receives the interrupt request from the IRQ. A typical data transfer from the adapter to the memory is like this. First, programming the DMA controller, the memory address to which data is written and the number of bytes to be transferred. When the adapter starts to transmit data, it will activate the dreq line and connect it to the DMA controller. After obtaining control over the bus with the CPU, the DMA controller outputs the memory address and sends a control signal so that one byte or word can be read from the adapter and written into the corresponding memory, and then updates the memory address, point to the address of the next byte (or word) to be written, repeat the above operation until the data transmission is complete. Different programming of controllers enables single-byte transmission (that is, each transmitted byte requires a dreq signal) or block data transmission (that is, all data transmission requires only one dreq signal ).
If you want to insert an adapter card to your computer and use DMA for the adapter, the installer usually asks you to select a DMA channel, set the dip switch or jumper to set the DMA channel for the corresponding adapter. Although theoretically, different adapter cards can share this line as long as the dreq line is not used at the same time, we 'd better arrange a separate DMA channel for each adapter, this ensures that no DMA conflict occurs. The attached table is the default distribution of DMA.
Channel function channel function
O idle 4 for Cascade DMA Controller
1 idle 5 idle
2 floppy disk 6 idle
3 Idle 7 idle
It can be seen that DMA channels 2 and 4 are occupied. On most computers, Channels 1, 3, 5, 6, and 7 can be allocated by you at will. We 'd better record the distribution of DMA channels on our computers, so that we don't have to share one channel with two adapter cards when we add new hardware to our computers, resulting in conflicts.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.