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 ...

Get Developing Drivers with the Windows® Driver Foundation now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.