MAXIMIZING YOUR FREE DOS MEMORY WITH DOS 5, 6, AND 7 (Win95)
By Mark Stotzer
Assistant Editor, FSNews online at http://www.erols.com/fsnews/
Updated April 1997.


In every newsgroup I frequent, the following issues arise:
- "I can't run this DOS program or game-I get an error message that says not enough or too little free/conventional/base memory."
- "I have xx Megabytes (MB) of RAM how can I possibly get "Low memory" or "Not enough memory" error messages?
-"Why do I have to use a special boot disk for this DOS game?"
Well, here are some simple tips to help all of you who want to fix your problem without boring you with the details. I hope to help you understand what your memory and DOS are doing "under the hood."
For Windows 95 specific tips and how to boot Win95 to a DOS prompt Click Here!
SYSTEM HARDWARE AND SOFTWARE:
Your DOS system, upon startup, loads the the system BIOS and boot loader software from onboard ROM chips, then it loads your DOS and then either your DOS applications programs or Windows and then your applications. See my DOS/Windows System Diagram. As you can see, we end up having multiple layers of software running just to provide your application programs all that they need to run.
TYPES OF MEMORY: See my DOS System RAM Diagram. This displays, in more detail, how a typical DOS system loads software into RAM on startup without Windows or any applications loaded.
1. Your hard drive which is your permanent storage area and consists of a physical drive inside your computer.
2. Your RAM, is actually temporary storage. Accessing it is lots faster lots faster than the hard drive and that's why we copy programs from the hard drive into the RAM to run them.. RAM is contained on memory chips, which only get loaded when you turn on your computer and attempt to execute or run any software-including the bootup stuff. The software in RAM disappears when you turn off your computer.
We need to discuss what happens, in detail, with the RAM. The RAM of all IBM type computers treats the first 1MB (The first 1 milllion bytes or addresses) in a special way due to what DOS programs need to run. All DOS programs run in the first 1MB of RAM-actually in the first 640KB (640,000 bytes) of RAM. The amount of FREE RAM in this first 640KB (Lets call it memory address 0 thru address 640,000) called "low" or "conventional" memory is what we need to "free up" or optimize to make available as much FREE SPACE as possible for your DOS programs-especially games to load into and then run.
**********************************************************************************************
So, you see, it is what happens in the first 1 million bytes of RAM (The "First Meg") that matters here. You could have 100MB of RAM and you'll still get these "low memory" messages if you do not follow the below tips!!
**********************************************************************************************
These tips apply to maximizing the free memory for DOS applications to run via any version of Windows too. If you have 620KB free conventional memory when you boot up to a DOS prompt you will have slightly less than that if you enter Windows and go right to a DOS prompt. We're solving both problems here!!
You've probably noticed that your computer loads lots of software when it starts for things like your CDROM, sound card, network, etc. If you loaded nothing but DOS upon bootup, you would probably have about 580-600KB free conventional memory of of 640KB possible-DOS itself would load entirely into lower (Below 640KB) memory. Remember this means no CDROM or any other cool stuff if you load only DOS itself.
To discover how much free memory you have do this (even at a Windows DOS prompt):
Type mem/c <Enter> in DOS 5.0
or
mem/c/p <Enter> for higher DOS versions.
It will tell you how much free space you have and if you need to tweak things up.
Versions of DOS since DOS 5.0 allow we users to do what is called "load programs and drivers high." "Loading High" means we can now load some of the drivers and programs for our cool stuff into two other areas area of RAM-that area between 640K and 1MB called "UPPER" memory and an additional area, 64KB in size from address 1MB to 1MB+64000 called the High Memory Area (HMA). The terms Extended and Expanded memory (XMS and EMS) refer to different memory standards that apply to the RAM above all this (Above the 1MB+64000 line). Many DOS games require Expanded memory. Windows likes lots of Extended memory. Good memory managers have the ability to treat the RAM above as XMS or EMS as needed from a "pool" of memory.
So our goal is:
To maximize our free conventional memory for DOS programs.
Our solution is:


Here is what to do-with some typical examples.
IMPORTANT!!!
Make a backup copy of both your autoexec.bat and config.sys files onto a floppy disk now!
Your CONFIG.SYS file:
The main tips trying to load the maximum amount of software "high" is:
1. Load the largest drivers/programs first.
2. All things loaded with "device=" change to "devicehigh=". (Except EMM386 and HIMEM.SYS)
Note: Windows 95 moves programs that used to be in the \DOS subdirectory into either the \WINDOWS or the \WINDOWS\COMMAND subdirectories. All the below noted files shown in the \DOS directory will be in \WINDOWS with Win95 except ANSI.SYS and MSCDEX.EXE which are in \WINDOWS\COMMAND
With the memory management programs that come with available with DOS 5, 6 or 7 here is what a typical CONFIG.SYS should look like (Keep this order):
Use the DOS EDIT program to view/modify.
DEVICE=C:\DOS(Or Windows)\HIMEM.SYS <---This gives you Extended Memory
DEVICE=C:\DOS\EMM386.EXE RAM HIGHSCAN I=B700=B7FF D=64 H=255 <---- This converts some of it to Expanded Memory and allows upper memory to be used. If any problems with the above try removing the I=B700-B7FF then the HIGHSCAN options).
DOS=HIGH,UMB <----Puts most of DOS itself upper memory or the HMA and opens upper memory for loading other programs into.
FILES =60
BUFFERS=20
FCBS=4,4
LASTDRIVE= Whatever you need here-at least the drive leeter needed for your CDROM.
DEVICEHIGH=C:\DOS\SMARTDRV.SYS <-----DOS 5 only!!!!
DEVICEHIGH= CDROM Driver ".SYS" file here /D:xxxxx <---/D here is the "device name" of your CDROM. It is NOT the drive letter!
DEVICEHIGH= Sound card driver if needed here
DEVICEHIGH=C:\WINDOWS\IFSHLP.SYS <----- For WFWG or Win95 only. Win95 auto loads it)
DEVICEHIGH=C:\DOS\SETVER.EXE If needed (Win95 always loads this auto)
DEVICEHIGH=C:\DOS\ANSI.SYS If needed
SHELL=C:\DOS\COMMAND.COM C:\DOS /E:512 /P
This is what a typical AUTOEXEC.BAT file should look like:
@ECHO OFF
PROMPT $p$g
PATH=C:\WINDOWS;C:\DOS; ...whatever you need
SET As needed
LOADHIGH(or LH) C:\DOS\MSCDEX.EXE /D:xxxxx /E <---For CDROM. The /D: here has to match the device name of your CD device driver in config.sys above. The /E loads the CD in/out buffers into Expanded memory (EMS) and should ONLY be used in conjunction with the "RAM" parameter of EMM386.EXE in config.sys above.
LH C:\DOS or WINDOWS\SMARTDRV.EXE <-----DOS 6.xx, 7.0 (Win95) only
LH <------Sound card program here if needed
LH C:\DOS\MOUSE.EXE or MOUSE.COM
CLS
After you make the above changes with DOS EDIT, save them and reboot your system.
If your drivers are not too big, you should get about 610-620KB free conventional memory from the above. It works with Windows 95 too if you boot it to a DOS prompt with the above basic startup files. There are some DOS programs (Like Aces over Europe) that expect as close to 620KB of free conventional memory as you can get or they will not run!
IMPORTANT:
If the above tips do not help your free memory situation or mess things up-then restore your two original startup files and reboot your system to restore your old startup configuration.
To get even more than the around the 610KB free conventional memory for DOS programs we tried to get here, you need to get a better memory manager than the one that comes with DOS like:
1. Netroom (Latest version is 3.04) by Helix Software.
2. QEMM (Latest version 8.0) by Quarterdeck Software.
I HATE special floppy boot disks!! I have yet to need/use one! In any case, I hope this helps many of you better enjoy and understand your systems.
Let me know if you found these tips useful by EMail. There are a few more tricks to tweak things up a little more depending on which version of DOS you have but I very much wanted to obey the KISS principle here.
Regards,
MDS
Back to ATP Corner