I have a WDM driver for a custom PCI device. I'm debugging this driver
on WinXPSP1. The driver needs to do DMA operations on the device. The
device is a busmaster that does scatter gather. Right now we're just at
the "prove this is possible" stage.
The goal is to create an architecture whereby our application and our
driver can share a very large (512k) buffer. The WDM driver, when
notified via IOCTL, would continuously DMA data from its data-capture
logic into the shared buffer. The application would continuously monitor
/ analyze / display the data coming into this buffer. When in
"continous" mode, there'd be no communication between the app and the
driver to indicate DMA done or anything like that - the app just knows
that the driver is constantly DMA'ing more data into the buffer.
If we allocate common DMA buffers in the driver and use them to do the
DMA (we're just DMA'ing dummy data embedded in the driver right now),
the DMA works. However, we cannot (and likely would not want to)
allocate common DMA buffers of the size we need.
If we allocate general buffers from the non-paged pool, then use
GetScatterGatherList, as documented, the SCATTER_GATHER_LIST we get back
does not seem to be correct. In fact, programming the hardware with the
values in the list results in the hardware claiming that the DMA has
happened, but definitely not into our buffers (and likely trashing
As an example, one of the buffers we get from the non-paged pool has a
virtual address of 0x84B0F4F8. Using the Softice PAGE command I can see
that this maps to a physical address of 0x04C924F8. However, the
PHYSICAL_ADDRESS returned in the SGLIST has HighPart=0x80D and
My questions are:
Is this a valid process?
Does GetScatterGatherList require that the MDL provided be one that came
through an IRP?
Is there a "right" way to accomplish what I've described? (I've got Oney
2nd Ed if you want to refer me to something in there .... been through
much of it already, but might have missed something.)
Any other thoughts you can provide that might help?