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.

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.

Posted on: 18/12/2009








0 Comments
If you want to leave a comment please Login or Register
How to backup your data using rsync......
Understanding autoconf......
The Basics of fdisk......
Accessing Memory Using DMA......
The fd Directory......