On DOS, what is the size of the EMS page frame, and how does expanded memory (EMS) differ from extended memory (XMS)?
On DOS, what is the size of the EMS page frame, and how does expanded memory (EMS) differ from extended memory (XMS)?
On DOS, what is the size of the EMS page frame, and how does expanded memory (EMS) differ from extended memory (XMS)?
Page frame size: 64 KB. The EMS page frame is a fixed 64 KB window located in the upper memory area (between the 640 KB conventional-memory limit and 1 MB). It is divided into four 16 KB physical pages. Its base address was configurable but commonly sat at a free UMA segment such as D000 or E000.
EMS vs XMS in one line: EMS is a windowing trick that maps far-larger off-board memory through that small 64 KB window via bank switching; XMS is direct linear RAM physically located above the 1 MB boundary.
How EMS works. Expanded memory follows the LIM (Lotus/Intel/Microsoft) Expanded Memory Specification. The actual memory lived on an add-in board (or was emulated). Because a real-mode 8088/8086 can only address 1 MB, EMS made more memory usable by bank switching: an EMS driver (EMM) maps a selected 16 KB bank of the large pool into one of the four 16 KB slots of the 64 KB page frame. A program reads/writes the page frame, then asks the driver to swap in a different bank to reach other data. Only the four pages currently mapped are visible at any instant. Capacity limits grew by version: EMS 3.0 (1985) up to 4 MB, EMS 3.2 up to 8 MB, and EMS 4.0 (1987) up to 32 MB (4.0 also added more mappable pages and primitive multitasking support). A key advantage of EMS is that it works on any PC, including the original 8088, regardless of CPU.
How XMS works. Extended memory is the ordinary physical RAM beyond the first megabyte, available only on an 80286 or later CPU (286 reaches 16 MB; 386 and later, up to 4 GB). Real-mode DOS cannot touch it directly, so programs use the XMS API provided by a driver such as HIMEM.SYS, which briefly switches the CPU into protected mode (and manages the A20 line) to copy data between conventional memory and extended memory. The first 64 KB of extended memory is the High Memory Area (HMA), accessible from real mode by enabling A20 — this is where DOS=HIGH loads much of DOS. Programs can also use extended memory directly through protected-mode interfaces like VCPI or DPMI.
The core distinctions:
A common bridge in practice: drivers like EMM386.EXE could simulate EMS out of extended memory on a 386+, letting one pool of RAM serve programs that demanded either standard.
Sources: