============================================================================= Layout of linear memory: From To Size Usage --------------------------------------------------------------- 00000000 - 000fffff 1M Dos memory (low 1M). 00100000 - 003fffff 3M VCPI server controlled. 00400000 - 007fefff 4M- DPMI server code and data. 007ff000 - 007fffff 4K Temporary page for `physical_poke'. 00800000 - ffffffff 4G- Dynamically allocated for clients. ============================================================================= Layout of GDT: See "Defines.Inc". A selector of 0x40 is valid for clients for compatibility with broken clients wanting access to bios data area. ============================================================================= Layout of LDT: Completely up to the client. ============================================================================= Mode switching: Routines _go32 and [_goreal] perform the switches. These preserve as many registers as possible and communicates segment register values on the stack. For details see "Dpmi.Asm". ============================================================================= Client memory allocation: Linear address space is allocated in 4M chunks. For each chunk a page table is also allocated. Allocated page tables will be mapped into the address space just before the client's memory. In particular, for each 4M requested an extra 4K will be allocated. Committed memory will always be allocated for the page tables. Note that since the first page table maps itself into linear space some magic must set it up in the first place. An example with between 4M and 8M allocated: Page Dir Page Tables User Pages v------+ +-------+ +-------+ | +-------+ CR3---->| 1M |-... +----->| |--+ +----->| | +-------+ | +-------+ | +-------+ | Server|-... | | |--+ | +-->| | +-------+ | +-------+ | | | +-------+ | 1st 4M|------+ | |--|--+ | | | +-------+ +-------+ | | +-------+ | 2nd 4M|------+ | |--|-----+ | | +-------+ | +-------+ | +-------+ . . | . . | . . . . | . . | . . +-------+ | +-------+ | +-------+ | | | | |--|--... | | +-------+ | +-------+ | +-------+ | | | +---- -+ | v | +-------+ +----->| |-... +-------+ | |-... +-------+ | |-... +-------+ | 0 | +-------+ . . . . +-------+ | 0 | +-------+ Client memory handles are the linear address of the memory block's descriptor. All handles are checked for validity by scanning the current client's list of memory blocks. While this at first might seem inefficient it is also very safe and speed during memory allocation is hardly important. Apart from the limit due to linear address space getting exhausted (i.e., 1022 blocks) there is no limit on the number of memory blocks allowed for one client.