Subject: Re: >4GB RAM on i386??
To: Jaromir Dolecek <jdolecek@netbsd.org>
From: Witold J. Wnuk <witek@wnuk.eu.org>
List: port-i386
Date: 12/16/2001 21:32:02
On Sunday 16 December 2001 19:28, Jaromir Dolecek wrote:
> Jason R Thorpe wrote:
> >  > probably very lame as it's mostly designed for windows which does not
> >  > use any advanced features anyway.
> >
> > Oh, really?  Windows doesn't use any advanced features?
>
> AFAIK it's necessary to use different API to allocate physical
> memory from the upper 32GB under Windows NT, i.e. normal malloc(3)
> would only use physical memory <=4GB under Windows NT. IIRC Oracle
> on Windows uses these special calls explicitly, at least I recall
> reading that in some Oracle docs.
> It _is_ really lame. Perhaps they fixed it in XP ...
>
> On the coutrary, e.g. Solaris handles > 4GB memory fine - it "just
> works", without need for special calls in applications.  (I've not
> tried this, but Sun writes this in their docs).

I've just started google to find out how it really works in Windows.

First, API you have mentioned is called AWE - Address Windowing Extension. As 
name suggests, it is used to manage more than 2GB/3GB memory by a single 
application. Allocated memory is not pageable and process is required to have 
"Lock Pages in Memory" privilege. Note that often when application decides to 
use such a large amount of memory, it is because it has its own caching 
strategy and would most likely mlock the memory anyway, so the fact that it 
is not pageable is not a major obstacle. 
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/memory/memman_3mr7.asp
I guess we should probably also develop similiar API if we want to be able to 
run large processes on 32bit archs. 

Second, all physical memory is treated in the same way except bounce 
buffering when bus or device does not support DAC (Dual Address Cycle) and is 
not 64bit. That means that multiple <4GB processes can use all available 
physical memory. Following paper describes some issues with legacy drivers, 
that NetBSD can probably easilly avoid thanks to bus_dma.
http://www.microsoft.com/hwdev/platform/server/PAE/PAEdrv.asp

More than 4GB of memory is supported starting with W2000 Advanced Server.

Another potentially interesting reading is "PAE Operating System Support" 
white paper at http://www.microsoft.com/hwdev/platform/server/PAE/pae_os.asp


Greetings,


	Witold J. Wnuk