Enabling the High Memory Area in MS‑DOS 6.22: An Architecture Note
Guide to enabling the High Memory Area in MS‑DOS 6.22, covering requirements, minimal config, trust boundaries, checks, failure modes, and when the design must change.
27 Jul 2026, 20:56 UTC

Requirements
To use the High Memory Area (HMA) on MS‑DOS 6.22 the system must have a BIOS that exposes the HMA via INT 15h AH=88h and a compatible memory manager (HIMEM.SYS). The boot process must not rely exclusively on conventional memory for critical data structures, otherwise enabling HMA could corrupt those structures.
Smallest Suitable Design
The minimal configuration that grants access to the HMA consists of:
- Load HIMEM.SYS early in CONFIG.SYS.
- Set DOS=HIGH to move DOS data structures into the HMA.
- Optionally add DOS=UMB to allow Upper Memory Blocks (UMBs) for drivers and TSRs.
No additional memory managers are required for the basic HMA feature.
Trust and Data Boundaries
The HMA lies above 1 MB and is accessed through the CPU’s address line A20 gate. Trust boundaries are:
- BIOS/ firmware: must correctly gate A20 and report HMA size via INT 15h.
- HIMEM.SYS: programs that load into conventional memory must not assume they can write above 640 KB without going through HIMEM.SYS.
- DOS kernel: when DOS=HIGH is set, the kernel relocates its data structures to the HMA; any code that directly accesses low‑memory DOS variables must be updated or avoided.
Operational Checks
Verify HMA activation with the built‑in MEM command:
MEM
Before loading HIMEM.SYS, MEM shows approximately 640 KB conventional memory and 0 KB upper memory. After a successful CONFIG.SYS load:
DEVICE=C:\DOS\HIMEM.SYS DOS=HIGH,UMB
running MEM again should report:
- Conventional memory ≈ 620‑640 KB (a few KB used by DOS).
- Upper memory (HMA+UMBs) increased by at least 64 KB (the HMA) plus any UMBs claimed.
Failure Modes
If the BIOS does not properly gate A20 or reports an incorrect HMA size:
- The system may hang during boot after HIMEM.SYS loads.
- DOS may relocate its data structures to non‑existent memory, causing immediate crashes or filesystem corruption.
- Applications that rely on low‑memory DOS variables (e.g., some copy‑protected programs) may fail.
Improper use of MEMMAX /A to claim UMBs can overwrite DOS kernel tables if the requested range overlaps the HMA or kernel space, leading to instability.
Conditions That Would Change the Design
The design would need revision if:
- The target hardware lacks an A20 gate or BIOS INT 15h support – then HMA cannot be used, and designers must rely solely on conventional memory or adopt an expanded memory manager (LIM/EMS).
- The boot sector or critical DOS utilities are known to write directly to addresses above 640 KB without using HIMEM.SYS – in that case DOS=HIGH must be avoided or those utilities replaced.
- System requirements demand more than the 64 KB HMA can provide for DOS data structures – then enabling UMBs (DOS=UMB) and carefully allocating them with MEMMAX /A becomes necessary, increasing complexity.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.