Chapter 4/ System Briefing

>-

Note: A module is the memory image of a binary file containing executable code. A

module can refer to an instance of an EXE, a .DLL, or a .SYS file.

Address Windowing Extension

Though 4GT allows us to allocate up to 3 GB for the user space of a process,

sometimes it's still not enough. For these cases, we can fall back on address

windowing extension (AWE). AWE allows a 32-bit user application to access

up to 64 GB of physical memory. This feature is based on an API, declared

in winbase.h, which allows a program using the API to access an amount of

physical memory that is greater than the limit placed on it by its linear ad¬

dress space (see Table 4.4).

Table 4.4 AWE API Routines

API Function

Description

VirtualAllocO

Reserves a region in the linear address space of the

calling process

VirtualAllocExO

Reserves a region in the linear address space of the

calling process

AllocateUserPhysicalPagesO

Allocate pages of physical memory to be mapped to

linear memory

MapUserPhysicalPagesO

Map allocated pages of physical memory to linear

memory

MapUserPhysicalPagesScatterO

Like MapUserPhysicalPagesO but with more bells

and whistles

FreeUserPhyslcalPagesO

Release physical memory allocated for use by AWE

AWE is called such because it uses a tactic known as windowing, where a set

of fixed-size regions (i.e., windows) in an application's linear address space

is allocated and then mapped to a larger set of fixed-size windows in physical

memory. Memory allocated through AWE is never paged.

Even though AWE is strictly a Microsoft invention, there is some cross-cor-

rclation, so to speak, with lA-32. AWE can be used without PAE. However,

if an application using the AWE API is to access physical memory above the

4-GB limit, PAE will need to be enabled. In addition, the user launching an

application that invokes AWE routines will need to have the "Lock Pages in

Memory" privilege.