The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.
Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/
I have a rather simple PCie device (It is experimental and learning purposes for FPGA development).
The device does not use interrupts for any DMA completions nor does it support Scatter/gather.
The maximum transfer length is 4k (in both directions).
Instead driver uses polling (reading some register on a PCIe memory mapped control register).
for now, DMA is sequential (one after another).
my KMDF driver has allocated a common DMA buffer using WdfCommonBufferCreate() and got the Logical Address and system virtual address.
Normally, I would do create DMA transactions for both directions and go that way as I have done in the past.
But I am just wondering if I have to do all of that and why the following would not work.
if it is relevant, I have a x64 system with Windows 10 and IOMMU(VT-d) enabled.
My question is :-
a) if I just take the logical address and program it into my device DMA control registers and start the DMA (from device to system memory) by writing to my device's control registers, why would the DMA not work?.
Can I not assume that since I have received the logical address, that once the DMA starts, the IOMMU would let the access (in this case bus master write) go through?.
The data does not show up in my common buffer and the internal counter in my device showing number of bytes transferred has not moved.
Since these are memory writes (posted writes), if IOMMU fails the transactions, I do not think there is a PCIe AER that the device would know (I can see why memory reads might not work).
In this particular case, how would the device know if the IOMMU is failing the request (if the IOMMU is not programmed by HAL to set up the page tables)?.
Before I get lambasted, I am working on doing this the "KMDF" way of creating DMA transactions and the kosher method but I am just curious.
|Upcoming OSR Seminars|
|OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!|
|Internals & Software Drivers||15 November 2021||Live, Online|
|Writing WDF Drivers||24 January 2022||Live, Online|
|Developing Minifilters||7 February 2022||Live, Online|
|Kernel Debugging||21 March 2022||Live, Online|