- How to use PAE (Physical Address Extension) in kernel
- Posted by Bell Kwong on October 31st, 2007
I'm working on a driver that must embed a huge cache pool more that 2GB. As
I know, the ExAllocatePool(WithTag) has the size limitation for
paged/non-paged management. So, I think maybe the PAE can show me the
sunshine. But after look around the MSDN and google, I got nothing helpful.
Could anybody give me a hand?
Thanks in advance.
Bell K.
- Posted by Tim Roberts on November 2nd, 2007
"Bell Kwong" <dev@79cn.com> wrote:
I doubt that. What kind of a device is this?
More than that, there isn't that much address SPACE available.
On a 32-bit system, there's no easy answer. If you have more than 4GB in
the machine, then the operating system will ignore everything beyond the
4GB mark. You can map it in yourself as if it were device memory. However,
you will have to map it in a chunk at a time, because there isn't that much
address space available.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
- Posted by Bell Kwong on November 2nd, 2007
Hi, Tim! Thank you for the reply. But actually, on 32bit windows 2000/2003
server, the system can support far more than 4GB RAM.
In user-mode, we can call AllocateUserPhysicalPages and MapUserPhysicalPages
to access the extended memory space by AWE (Address Windowing Extensions).
MDSN DVD also provides a sample program to illustrate the Address Windowing
Extensions.
Regards,
Bell
"Tim Roberts" <timr@probo.com>
- Posted by Alexander Grigoriev on November 2nd, 2007
Use MmAllocatePagesForMdl.
"Bell Kwong" <dev@79cn.com> wrote in message
news:epnypCSHIHA.700@TK2MSFTNGP05.phx.gbl...
- Posted by Peter Wieland [MSFT] on November 2nd, 2007
PAE gives you a larger physical address space but does not provide any
additional virtual address space. The kernel is still limited to 2GB (1GB
with /3GB flag set) and so the pools, which are allocations of kernel
virtual memory, are still size limited.
You could try using MmAllocatePagesForMdl to allocate a large amount of
unmapped physical memory and then use IoBuildPartialMdl and MmMapLockedPages
to map views of the cache into the virtual address space. But you probably
won't be able to address all 2GB at one time.
-p
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Bell Kwong" <dev@79cn.com> wrote in message
news:eqI4H$3GIHA.3916@TK2MSFTNGP02.phx.gbl...
- Posted by Tim Roberts on November 3rd, 2007
"Bell Kwong" <dev@79cn.com> wrote:
That's not what I said. I said there wasn't that much address SPACE
available. Yes, you can have more than 4GB RAM, but you have to map it in
a bit at a time. For example, with luck, you might be able to find 1GB of
empty virtual address space in kernel mode. That would be a window into
the larger physical memory space.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
- Posted by Don Burn on November 3rd, 2007
"Bell Kwong" <dev@79cn.com> wrote in message
news:epnypCSHIHA.700@TK2MSFTNGP05.phx.gbl...
Yes, but at Tim pointed out there is a severe limit on ADDRESS SPACE.
Contrary to Tim's last posting, I doubt you will get 1GB, since most systems
using PAE also throw the /3GB switch which limits the kernel address space
to 1GB. Finally, PAE allocations are done for user space processes, so you
are going to need a helper application to even allocate the memory.
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
- Posted by Bell Kwong on November 5th, 2007
MmAllocatePagesForMdl, IoBuildPartialMdl and MmMapLockedPages.
That's exactly what I want!
"Peter Wieland [MSFT]" <peterwie@online.microsoft.com>
??????:8EC341BE-0DBE-4CB5-B47F-3F1DB2892CF2@microsoft.com...