Freeing Conventional Memory in MS‑DOS with HIMEM.SYS and Upper Memory Blocks
Learn how to free MS‑DOS conventional memory by loading device drivers into upper memory blocks with HIMEM.SYS and DOS=UMB, complete with a worked example and verification steps.
26 Jul 2026, 04:41 UTC

Understanding the 640 KB barrier
MS‑DOS runs in a 1 MB real‑mode address space. The first 640 KB is conventional memory, the only region that ordinary DOS programs can use without special extenders. The remaining 384 KB is reserved for BIOS, ROM, video memory, and hardware registers. When you load TSRs, device drivers, or network stacks via CONFIG.SYS, each piece consumes part of that 640 KB pool. If the total exceeds the available space, you see the dreaded "Out of memory" error even though the machine may have megabytes of RAM installed.
Enabling high memory with HIMEM.SYS and UMBs
The solution is to move as much of the driver code as possible into the Upper Memory Area (UMA) – the 384 KB region that is normally off‑limits to applications. This requires two steps:
- Load
HIMEM.SYSto provide access to the High Memory Area (HMA) and to manage Upper Memory Blocks (UMBs). - Tell DOS to treat UMBs as usable memory with the
DOS=UMBdirective in CONFIG.SYS. - Use the
LOADHIGH(orLH) command to load each driver into a UMB instead of conventional memory.
When configured correctly, the drivers still function, but they no longer shrink the 640 KB pool available to your applications.
Worked example: moving a network driver into upper memory
Suppose you have a packet driver NETDRV.SYS for an early Ethernet card. The following CONFIG.SYS fragment shows a typical before‑and‑after scenario.
;--- Before: driver loads into conventional memory ---
DEVICE=C:\NET\NETDRV.SYS
;--- After: driver loaded high into an UMB ---
DEVICE=C:\DOS\HIMEM.SYS
DOS=UMB
DEVICEHIGH=C:\NET\NETDRV.SYS
After rebooting, you can verify the effect with the built‑in mem command:
C:\> mem
The output will list sections such as:
- Conventional memory: X KB
- Upper memory blocks: Y KB
- High memory area (HMA): Z KB
Compare the conventional memory figure before and after the change; you should see an increase roughly equal to the size of NETDRV.SYS (plus any overhead). If the conventional memory number does not grow, check that HIMEM.SYS loaded successfully (look for its version message during boot) and that the DEVICEHIGH line is placed after the DOS=UMB directive.
Limitations and practical checks
Using UMBs is not guaranteed on every machine:
- UMB availability depends on the chipset and BIOS; some systems expose only a few small blocks, limiting how large a driver can be moved.
- Incorrect ordering in CONFIG.SYS can still cause fragmentation or prevent a driver from loading high, leading to the same out‑of‑memory error.
- Certain hardware (e.g., some early sound cards) requires drivers to run in conventional memory due to interrupt handling constraints.
To verify that a driver is indeed loaded high, you can:
- Run
memand note the Upper memory blocks size. - Use
mem /c(or a debugger likeDEBUG) to examine the driver’s segment address; addresses in theC000‑FFFFrange indicate UMB placement. - In DOSBox, enable the
mapsetting and view the memory map; the driver’s segment should appear in the UMA region.
If the driver fails to function after moving it high, return it to conventional memory by replacing DEVICEHIGH with DEVICE, reboot, and test again. This rollback is safe because it only changes the CONFIG.SYS file and does not alter disk contents.
Actionable closing
Start with a minimal CONFIG.SYS that loads only HIMEM.SYS and sets DOS=UMB. Add one driver at a time using DEVICEHIGH (or LOADHIGH for TSRs), reboot, and run mem to confirm that conventional memory has grown. Keep a backup of the original CONFIG.SYS so you can revert quickly if a device misbehaves. By systematically moving drivers into upper memory, you reclaim precious conventional memory for the applications that need it most, extending the usefulness of your MS‑DOS system without hardware upgrades.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.