MS-DOS 6.22: Expanded Memory vs Extended Memory

MS-DOS 6.22 relies on distinct memory management schemes to bypass the original 640 KB conventional memory limit inherent to the x86 real-mode architecture. This article explains how MS-DOS 6.22 manages Extended Memory (XMS) as linearly addressable space above 1 MB and Expanded Memory (EMS) as banked memory accessed through a page frame, detailing their architectural differences, configuration via CONFIG.SYS, and software compatibility.

Architectural Differences

The fundamental difference between Extended Memory (XMS) and Expanded Memory (EMS) lies in how the CPU physically addresses the memory.

  • Extended Memory (XMS): XMS refers to physical memory located above the 1 MB address threshold on 80286 and newer processors. Because MS-DOS operates in 16-bit real mode, it cannot natively read or execute code in extended memory, which requires protected mode. Under MS-DOS 6.22, XMS is treated as a continuous, linear block of storage accessed through standard transfer functions rather than direct execution, unless an application uses a 32-bit DOS extender.
  • Expanded Memory (EMS): EMS (governed by the Lotus-Intel-Microsoft/LIM standard) was originally engineered for 8086/8088 systems that had no physical way to address memory beyond 1 MB. EMS uses bank-switching technology. It maps chunks of memory from an external pool into a reserved 64 KB window called a Page Frame located within the Upper Memory Area (UMA)—the region between 640 KB and 1024 KB. Applications access data by switching different 16 KB pages into this frame.

Memory Managers in MS-DOS 6.22

MS-DOS 6.22 controls these memory types using two primary drivers loaded in CONFIG.SYS: HIMEM.SYS and EMM386.EXE.

1. HIMEM.SYS (Extended Memory Manager)

HIMEM.SYS provides access to XMS and manages the High Memory Area (HMA), the first 64 KB of extended memory located directly above 1 MB (from 1024 KB to 1088 KB).

  • HMA Utilization: By setting DOS=HIGH in CONFIG.SYS, MS-DOS 6.22 moves the majority of its core operating system routines into the HMA. This frees up valuable conventional memory (below 640 KB) for user applications.
  • XMS Provision: It assigns memory blocks to programs using the Extended Memory Specification, preventing applications from overwriting each other's data above the 1 MB line.

2. EMM386.EXE (Expanded Memory Emulator)

Because true hardware-based EMS boards became obsolete with the rise of 386 systems, MS-DOS 6.22 uses EMM386.EXE to simulate EMS using physical XMS.

EMM386.EXE leverages the Virtual 8086 mode and the paging hardware of 80386 and later processors:

  • It reserves a 64 KB page frame in the UMA (typically at address segment D000h or E000h).
  • When an application requests expanded memory, EMM386.EXE remaps physical pages of XMS into this real-mode accessible page frame on demand.
  • It can also create Upper Memory Blocks (UMBs) using the DOS=UMB parameter, allowing device drivers and terminate-and-stay-resident (TSR) programs to load into the 640 KB–1024 KB region via the DEVICEHIGH and LOADHIGH commands.

Configuration Methods

MS-DOS 6.22 allows the user to balance between EMS and XMS based on application needs via the CONFIG.SYS file:

  • XMS Only (No EMS):

    DEVICE=C:\DOS\HIMEM.SYS
    DEVICE=C:\DOS\EMM386.EXE NOEMS
    DOS=HIGH,UMB

    The NOEMS parameter disables expanded memory simulation entirely. This frees the 64 KB UMA page frame, turning it into additional Upper Memory Blocks for loading drivers.

  • Both XMS and EMS Available:

    DEVICE=C:\DOS\HIMEM.SYS
    DEVICE=C:\DOS\EMM386.EXE RAM 4096
    DOS=HIGH,UMB

    The RAM parameter reserves a 64 KB page frame for EMS while allocating a designated amount of memory (e.g., 4096 KB) to EMS emulation. Any remaining extended memory stays available as standard XMS.

Software Usage

The preference between EMS and XMS in MS-DOS 6.22 depends on the vintage of the software:

  • EMS Software: Early business software (such as Lotus 1-2-3) and older DOS games (such as Wing Commander) rely specifically on LIM EMS. These programs cannot see or use raw XMS and fail to access extra memory unless EMM386.EXE provides a page frame.
  • XMS Software: Later DOS applications and late-era games (such as DOOM or AutoCAD) use 32-bit DOS extenders (such as DOS/4GW). These extenders switch the processor into protected mode and directly utilize large pools of contiguous XMS, ignoring the slower, banked EMS mechanism.