Accessing Memory Using DMA

Direct Memory Access (DMA) allows internal peripherals to access memory without the processor needing to execute instructions for each transfer. There are two types of DMA; one uses the DMA controller on the motherboard and the other uses a busmaster controller on the peripheral card.

I suggest you avoid using the motherboard DMA controller if possible. There are a limited number of DMA channels, which can make it hard to find a free channel. This form of DMA is very slow. And this form still requires short interrupt latencies (the time between when the peripheral asserts the interrupt line and the processor responds); when the DMA controller reaches the end of the buffer, you need to quickly reprogram it to use another buffer. This controller requires multiple bus cycles per transfer; it reads a byte of data from the peripheral and then writes it to memory, or vice versa, in two separate operations and inserts wait states as well. This controller only supports 8- and 16-bit transfers.

25

EE

IC

D

m

00

Busmaster DMA requires more complicated circuitry on the peripheral card, but can transfer data much faster and only needs one bus cycle per byte or word transferred. Busmaster controllers can also execute 32-bit transfers.

The kernel functions set_dma_mode(), set_dma_addr(), set_dma_count() and enable_dma(), disable_dma(), request_dma(), free_dma(), and clear_dma_ff() are used to set up DMA transfers; a driver that uses DMA must run in kernel mode. The example kernel driver in this chapter does not use DMA.

Read how to maintain and repair any desktop and laptop computer. This Ebook has articles with photos and videos that show detailed step by step pc repair and maintenance procedures. There are many links to online videos that explain how you can build, maintain, speed up, clean, and repair your computer yourself. Put the money that you were going to pay the PC Tech in your own pocket.