Double-Buffer DMA Transfer

In the double-buffer strategy, the VDD calls VDDRequestDMA to move the data as described by the last DMA request. The VDDRequestDMA function looks at the last DMA command trapped by the VDM and executes a data transfer that matches those DMA parameters, although the transfer does not actually use DMA. When the DMA transfer request specifies that data be moved from an application buffer to the device, the data actually goes from the application buffer to a block of memory the VDD has mapped to the virtual address space occupied by the board. When the data has been transferred to the VDD's buffer, the VDD can then transfer it to the device by passing the data to the kernel-mode device driver. Likewise, when the DMA transfer is requesting data be moved from the device to an application buffer, the VDD first calls the kernel-mode driver to copy the data from the device to the VDD's buffer. The VDD can then transfer the data from its buffer to the application's buffer by calling VDDRequestDMA, as shown in the following illustration.

Two-stage virtual DMA transfer