Best Practices: Do s and Don ts for DMA Drivers


Best Practices: Do's and Don'ts for DMA Drivers

Here are some reminders and tips regarding writing DMA drivers for Windows:

  • Strive to understand the Windows DMA abstraction.

    Understanding the abstraction helps you to write and debug your DMA driver.

  • Do not bypass the KMDF DMA support or the Windows DMA abstraction in an attempt to create your own solution.

    For example, it is never acceptable to build the contents of a scatter/gather list manually by interpreting the contents of an MDL and to use the resulting data to program your DMA device, because this does not account for the possible use of map registers.

  • If your driver gets DMA requests from a sequential queue, and thus can ensure that only one such transaction is active at any time, design the driver to create a single DMA transaction object during driver DMA initialization and reuse this object for each DMA transaction.

  • Test your driver with Driver Verifier enabled in general and with DMA verification enabled specifically.

    In addition to designing your driver to properly use the DMA support built into KMDF, thorough testing with Driver Verifier is probably the single most important thing you can do to ensure that your driver functions properly in Windows.




Developing Drivers with the Microsoft Windows Driver Foundation
Developing Drivers with the Windows Driver Foundation (Pro Developer)
ISBN: 0735623740
EAN: 2147483647
Year: 2007
Pages: 224

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net