C:\>ConventionalMemory.io

Guide · Updated October 8, 2026 · 6 min read

CONFIG.SYS and AUTOEXEC.BAT: free up conventional memory

You have the game. You have the sound card. DOS says there are 540 KB free and the game wants 590. Here is the CONFIG.SYS and AUTOEXEC.BAT that fixes it, line by line, and a boot menu so your games, your tools and your plain DOS each get the setup they like.

How we pick. A product makes the list only when reviewers and long-time collectors keep recommending it, it does one job well and it will still work in five years. No filler, no mystery brands, and no paid placements. Not every item has been through our own bench, so we go by reputation. Prices change, so check the listing.

Some links on this page are affiliate links. If you buy through one, Conventional Memory earns a small commission at no cost to you. Affiliate links. As an Amazon Associate I earn from qualifying purchases. Disclosure

Careful. Before you change anything, copy the current files to CONFIG.OLD and AUTOEXEC.OLD, and keep a bootable floppy or CF card handy. A mistake in these files can stop a machine from booting.

What each file does

DOS reads CONFIG.SYS first, early in boot, to load device drivers and set limits. It then runs COMMAND.COM, which executes AUTOEXEC.BAT, a plain batch file that sets paths and variables and starts memory-resident programs. Both live in the root of the boot drive.

For memory, the plan has four moves. Load HIMEM.SYS to open extended memory and the HMA. Move DOS into the HMA with DOS=HIGH. Turn on upper memory blocks with EMM386.EXE. Then load everything that can fit into those blocks with DEVICEHIGH in CONFIG.SYS and LOADHIGH (LH) in AUTOEXEC.BAT.

A CONFIG.SYS that works

This version uses the multiple-configuration feature of MS-DOS 6 to offer a menu at boot. Edit the paths to match where your files really are. Lines starting with REM are ignored.

[MENU]
MENUITEM=GAMES, DOS games with sound and mouse
MENUITEM=EMS, Games that need expanded memory
MENUITEM=PLAIN, Plain DOS, nothing extra
MENUDEFAULT=GAMES,5
MENUCOLOR=7,1

[COMMON]
DEVICE=C:\DOS\HIMEM.SYS
FILES=40
BUFFERS=20
LASTDRIVE=Z
STACKS=9,256

[GAMES]
DEVICE=C:\DOS\EMM386.EXE NOEMS I=B000-B7FF
DOS=HIGH,UMB
DEVICEHIGH=C:\CDROM\CDROM.SYS /D:MSCD001

[EMS]
DEVICE=C:\DOS\EMM386.EXE RAM I=B000-B7FF
DOS=HIGH,UMB

[PLAIN]
DOS=HIGH

A few notes on that file. I=B000-B7FF includes the unused monochrome text area as extra upper memory on a colour system, which often gives you one more block to load into. Do not use it on a machine with a monochrome card. FILES=40 and BUFFERS=20 are comfortable values for games, and every extra buffer costs a few hundred bytes. STACKS=9,256 is the DOS default, written out so you can see it.

An AUTOEXEC.BAT to match

The batch file reads the %CONFIG% variable that DOS sets from your menu choice and jumps to the matching section.

@ECHO OFF
PROMPT $P$G
PATH C:\DOS;C:\UTILS
SET TEMP=C:\TEMP
GOTO %CONFIG%

:GAMES
SET BLASTER=A220 I5 D1 H5 P330 T6
LH C:\CDROM\MSCDEX.EXE /D:MSCD001 /L:D
LH C:\MOUSE\MOUSE.COM
GOTO END

:EMS
SET BLASTER=A220 I5 D1 H5 P330 T6
LH C:\MOUSE\MOUSE.COM
GOTO END

:PLAIN
GOTO END

:END

The SET BLASTER line is read by DOS games to find your sound card. A is the I/O address, I the IRQ, D the 8-bit DMA channel, H the 16-bit DMA channel, P the MIDI port and T the card type. Match it to your card's real settings with the IRQ, DMA and I/O cheat sheet.

What the options in EMM386 mean

EMM386.EXE options you will actually use
OptionWhat it does
NOEMSProvides upper memory blocks but no expanded memory. Saves memory and is the best default
RAMProvides both upper memory blocks and expanded memory. Use it when a game demands EMS
NOEMS and RAM omittedOnly EMS, with no upper memory blocks (the default, and rarely what you want)
I=B000-B7FFIncludes that range as upper memory. On colour systems this is usually free
X=C800-CFFFExcludes a range so EMM386 does not use it. Needed when a card has a ROM or buffer there
FRAME=E000Sets where the EMS page frame sits. Some games want a specific frame address
HIGHSCANSearches more aggressively for free upper memory, a little more risk of a clash
NOVCPITurns off a protected-mode sharing service some extenders use. Try it only when a DOS extender game complains

Step by step: from 540 KB to 600 KB

  1. Take a baseline. Run MEM /C /P before you change anything and write down "Largest executable program size" and the free upper memory.
  2. Back up the files. Copy CONFIG.SYS and AUTOEXEC.BAT to .OLD names. Keep a boot disk in case a typo breaks the boot.
  3. Load HIMEM first. HIMEM.SYS must be the first memory line. If it prints an A20 error, add /MACHINE: with a value from the HIMEM documentation.
  4. Add EMM386 and DOS=HIGH,UMB. Use NOEMS unless a game needs EMS. The DOS=HIGH,UMB line must come after the EMM386 line.
  5. Move drivers up. Change DEVICE= to DEVICEHIGH= for each driver, and put LH in front of TSR commands in AUTOEXEC.BAT. Reboot and run MEM /C again.
  6. Tune what did not fit. If a program will not fit in upper memory, it will show conventional memory use in MEM /C. Try loading it first, or use LH /L: to pin it to a block, or let MemMaker try.
  7. Test your games. Run a game from each menu choice. If one crashes, add an exclusion with X= to EMM386 for the range that card uses.

MemMaker, the automatic option

MS-DOS 6 ships with MemMaker. It reads your files, tries to load drivers into the best upper memory blocks, reboots a few times and rewrites CONFIG.SYS and AUTOEXEC.BAT with the right switches, such as DEVICEHIGH SIZE= values. Run MEMMAKER /UNDO if it leaves the machine in a worse state.

It is a good first pass, and it is the right tool if you are short of time. Hand-tuning wins by a few kilobytes, because you know which programs matter and in which order they should load.

Common errors and what they mean

Boot-time messages and the usual cause
MessageUsually means
Unable to control A20 lineHIMEM.SYS cannot switch the gate. Try the /MACHINE: switch or check the BIOS for a fast-gate-A20 option
EMM386 not installed - unable to set page frame baseThe page frame range clashes with a card ROM. Use FRAME= or exclude with X=
Error in CONFIG.SYS line 12A typo, a missing file or a path that does not exist. Count lines in your editor
Bad or missing Command InterpreterCOMMAND.COM is missing from the boot drive or the SHELL line is wrong
Bad command or file nameThe PATH is wrong, or the file is not where the line says it is
Packed file is corruptA compressed program found its memory damaged or too small. Run it without LH, or from the PLAIN menu
Parameter value not in allowed rangeA wrong number in a DOS=, FILES= or BUFFERS= line

Tools for tuning a real DOS PC

Tuning CONFIG.SYS is safest with a boot floppy in the drive, and a spare disk for every experiment.

3.5 inch floppy disks, 1.44 MB

Blank media

Boot disks, drivers and test disks all need real floppies. Look for new-old-stock Maxell, Sony, Fuji or TDK, and test each disk after you format it.

Gotek with FlashFloppy

Floppy drive that reads a USB stick

Swaps a tired floppy drive for a USB stick of disk images. Ask the seller which chip is inside and look for the AT32F435 version.

Upgrading and Repairing PCs (Scott Mueller)

Book

The reference for the PC-compatible era, with the memory map, chipsets and buses explained clearly. Older editions suit vintage machines best and are cheap used.

Skip these

  • Copying a CONFIG.SYS from a forum without reading it. Paths, drivers and card settings are specific to each machine.
  • Loading every driver high without checking MEM /C. Some programs run worse or crash when loaded into upper memory.
  • Putting DOS=HIGH,UMB before the EMM386 line.

Questions people ask

What does DEVICEHIGH do?

It loads a device driver into upper memory instead of conventional memory. It needs HIMEM.SYS, EMM386.EXE and DOS=UMB to have run first.

What does LOADHIGH or LH do?

It is the AUTOEXEC.BAT version of DEVICEHIGH. Put LH in front of a program name and DOS tries to load it into an upper memory block.

Should I use RAM or NOEMS?

Use NOEMS by default, since it leaves more memory for your programs. Use RAM only when a game explicitly needs expanded memory.

Can I use these files in DOSBox?

DOSBox emulates XMS, EMS and UMBs itself, so you do not need HIMEM or EMM386. You can toggle them in the DOSBox configuration file.

Why is my free memory lower after I add a sound card driver?

Sound card drivers and mixers are memory-resident programs. Load them high with LH, or skip the mixer if your games set their own volume.

Sources

From the timeline

Read next

More to explore

Visit the museum