about a memory issue

I want to split a buffer into virtual pages, which can match one to one physical pages.

comment:
The buffer has already been locked in memory.

Can anybody offer me some idea?
thanks a lot!

mmgetsystemaddressformdl?

Or is a contiguous block of virtual system addresses not sufficient?

On Thursday, January 28, 2010, wrote:
> I want to split a buffer into virtual pages, which can match one to one physical pages.
>
> comment:
> The buffer has already been locked in memory.
>
> Can anybody offer me some idea?
> thanks a lot!
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>


Mark Roddy

xxxxx@hotmail.com wrote:

I want to split a buffer into virtual pages, which can match one to one physical pages.

comment:
The buffer has already been locked in memory.

You haven’t really given us enough detail here. What are you trying to
do? Why do you need physical addresses?

There are certainly good reasons for needing them (like DMA), but the
method you use depends on the task you are performing.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Look at MDL-related functions, some of them can provide you with something similar.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntdev…
>I want to split a buffer into virtual pages, which can match one to one physical pages.
>
> comment:
> The buffer has already been locked in memory.
>
> Can anybody offer me some idea?
> thanks a lot!
>
>

I just want to do DMA data transfer and plan to map a single virtual page of a large buffer each time. So, I have to split the large buffer into virtual pages, which can math one to one physical pages.

It seems that I can use MDL-related functions to resolve my problem.

thanks.

xxxxx@hotmail.com wrote:

I just want to do DMA data transfer and plan to map a single virtual page of a large buffer each time. So, I have to split the large buffer into virtual pages, which can math one to one physical pages.

It seems that I can use MDL-related functions to resolve my problem.

No. There are additional subtleties in DMA transactions beyond just the
virtual-to-physical translation. If you are doing DMA, then you need to
use the operating system’s DMA abstraction – IoGetDmaAdapter. That can
create a scatter/gather list, which gives you the list of physical pages
for your buffer. It also handles special cases, like if you have a
32-bit PCI card running in a machine with more than 4GB of RAM.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Eh? You seem to have this backwards. For DMA you want to provide a
(logical) physical address for each contiguous run of virtual address
space, not a virtual address for a physical address. Or perhaps you
mean something different by DMA?

Mark Roddy

On Fri, Jan 29, 2010 at 1:44 AM, wrote:
> I just want to do DMA data transfer and plan to map a single virtual page of a large buffer each time. So, I have to split the large buffer into virtual pages, which can math one to one physical pages.
>
> It seems that I can use MDL-related functions to resolve my problem.
>
> thanks.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>

> It seems that I can use MDL-related functions to resolve my problem.

Just use IoGetDmaAdapter and adapter object methods.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com