DEVICE_DESCRIPTION DeviceDesc;
RtlZeroMemory(&DeviceDesc, sizeof(DEVICE_DESCRIPTION));
DeviceDesc.Version = DEVICE_DESCRIPTION_VERSION2;
DeviceDesc.Master = TRUE;
DeviceDesc.ScatterGather = TRUE;
DeviceDesc.Dma32BitAddresses = TRUE;
DeviceDesc.InterfaceType = PCIBus;
DeviceDesc.MaximumLength = sizeof(ULONG)-1;
Then I allocate a DMA adapter with IoGetDmaAdapter(). When I use
GetScatterGatherList() the list I receive in my AdapterListControl
function has always 1 element, regardless of the length of the transfer.
What could I do to understand what I'm doing wrong?
Ciao
Alessio
Can you look at the MDL passed to GetScatterGatherList and its tail? what the
the physical page numbers?
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
ma...@storagecraft.com
http://www.storagecraft.com
Looking at the fields of the MDL structure I see meaningful numbers,
such as:
StartVa: 2219864064
ByteOffset: 52
ByteCount: 40000
Is it possible that GetScatterGatherList() coalesces many elements in
one, i.e. if it has 10 contiguous physical pages it fills the structure
with one entry of length 40960?
> what the the physical page numbers?
How can I find the physical page numbers in the MDL?
Bye
Alex
Surely.
> > what the the physical page numbers?
> How can I find the physical page numbers in the MDL?
Several 64bit (for PAE and x64 OS) or 32bit words just after struct _MDL, each
word describing 1 page.
>>> what the the physical page numbers?
>> How can I find the physical page numbers in the MDL?
>
> Several 64bit (for PAE and x64 OS) or 32bit words just after struct _MDL, each
> word describing 1 page.
Ok, did a transfer of 81920 bytes and looking at the first 5 32 bit
DWORDs after the struct _MDL I see these page frame numbers:
8916
8920
8924
8928
8932
(in decimal representation)
They are regularly spaced, but they're not consecutive. What can I infer
about the physical memory layout?
Bye
Alex
And what are the values in scatter-gather list?
You requested a 80k transfer, with 5 blocks that would be 16k each. I seem
to recall that the page size on 32-bit Windows is 4k.
>
> Bye
> Alex
Bye
Alex
Yes, and this is really strange.
MDL tail values are the physical addresses divided to PAGE_SIZE.