Allocate more than one MDLs

Hi,
Would anybody give some sample or hints that how could I allocate more than one MDLs for a specific paged buffer.

Thanks in advance.

Ashraf wrote:

Would anybody give some sample or hints that how could I allocate more
than one MDLs for a specific paged buffer.

You, surely, can answer this question on your own. Have you read the
documentation for IoAllocateMdl?

However, this is NOT the question that you really wanted to ask. You
are the fellow trying to build a huge RAM disk, right? In that case,
the memory is not going to be a paged buffer. The KMDF ramdisk sample
allocates from non-paged pool, and you’re going to find that there isn’t
enough non-paged pool available for you to allocate a huge buffer for a
ramdisk.

To get more than 100MB or so, you will have to use tricks. For example,
on 32-bit XP or Vista, if you have more than 4GB of RAM, the operating
system will simply ignore everything over 4GB. Thus, you could just
claim a chunk of that space for your own use, as if it were a PCI
device. Since you won’t be able to map the whole thing into memory at
once (because of the non-paged pool limits), you will have to map in a
section at a time to do the disk I/O.


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

> For example, on 32-bit XP or Vista, if you have more than 4GB of RAM, the operating system

will simply ignore everything over 4GB.

???

IIRC, 32-bit Windows does support PAE, does not it???

Anton Bassov

> IIRC, 32-bit Windows does support PAE, does not it???

Sure, but that’s a different issue than what your license will allow:

http://msdn.microsoft.com/en-us/library/aa366778.aspx

(And Tim was careful to say “32-bit XP or Vista”)

-scott


Scott Noone
Software Engineer
OSR Open Systems Resources, Inc.
http://www.osronline.com

wrote in message news:xxxxx@ntdev…
>> For example, on 32-bit XP or Vista, if you have more than 4GB of RAM, the
>> operating system
>> will simply ignore everything over 4GB.
>
>
> ???
>
>
> IIRC, 32-bit Windows does support PAE, does not it???
>
> Anton Bassov
>

xxxxx@hotmail.com wrote:

> For example, on 32-bit XP or Vista, if you have more than 4GB of RAM, the operating system
> will simply ignore everything over 4GB.
>

IIRC, 32-bit Windows does support PAE, does not it???

Yes, but XP and Vista, by POLICY, will not use any physical memory above
4GB.


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

Yes, I have read the document of IoAllocateMdl. But nothing found related with using more than one IoAllocatedMdl for a specific buffer.
?
And Thanks for your suggestion. But I am not want to proceed this way. Because I am?assuming?my 32 bits XP system has 4GB?of RAM.?
?
Thanks.

— On Fri, 1/23/09, Tim Roberts wrote:

From: Tim Roberts
Subject: Re: [ntdev] Allocate more than one MDLs
To: “Windows System Software Devs Interest List”
Date: Friday, January 23, 2009, 10:08 AM

Ashraf wrote:
> Would anybody give some sample or hints that how could I allocate more
> than one MDLs for a specific paged buffer.
>
>

You, surely, can answer this question on your own. Have you read the
documentation for IoAllocateMdl?

However, this is NOT the question that you really wanted to ask. You
are the fellow trying to build a huge RAM disk, right? In that case,
the memory is not going to be a paged buffer. The KMDF ramdisk sample
allocates from non-paged pool, and you’re going to find that there
isn’t
enough non-paged pool available for you to allocate a huge buffer for a
ramdisk.

To get more than 100MB or so, you will have to use tricks. For example,
on 32-bit XP or Vista, if you have more than 4GB of RAM, the operating
system will simply ignore everything over 4GB. Thus, you could just
claim a chunk of that space for your own use, as if it were a PCI
device. Since you won’t be able to map the whole thing into memory at
once (because of the non-paged pool limits), you will have to map in a
section at a time to do the disk I/O.


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


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

> IIRC, 32-bit Windows does support PAE, does not it???

Yes, but all client flavours of 32bit Windows (Win7 7000 included), as also Server 2003 32bit Web Edition, have the political/marketing feature of cutting off all addressing beyound 4GB.

PAE is still there, and provides the NX bit.

To use > ~3.2GB of RAM, you need either 32bit Windows Server other then Web Edition, or the x64 OS.


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

>Yes, I have read the document of IoAllocateMdl. But nothing found related with using more than one

IoAllocatedMdl for a specific buffer.

Cut the buffer to pieces and call IoAllocateMdl for each piece.


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

On Sat, Jan 24, 2009 at 05:00:54AM -0800, Ashraf wrote:

Yes, I have read the document of IoAllocateMdl. But nothing found related
with using more than one IoAllocatedMdl for a specific buffer.

There’s really no such thing as a “specific buffer”. It’s all just
memory. If you want to create an MDL for the second 64MB of some
buffer, just create an MDL for the address 64MB beyond the start of the
buffer.

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