Windows 9x Hints
Home Windows 3.1 Hints Windows 9x Hints

 

Windows 3.1 Hints
Windows 9x Hints

Last updated 05 July 1999

Optimizing DOS Session Memory

See Also Windows 3.1.

Revised slightly after rescuing from www.nethog.demon.co.uk

When I wrote this, My DOS Box reported 603K free. I will show you how I got this, and made sure that the PC does not reboot when you exit the single DOS session. I will also try and cover some problems you may have with single dos sessions.

If your computer reboots when you exit out of a single session, this is why. When you enter the single session, Windows 95 runs a couple of programs. Namely MSCDEX and MOUSE.COM. If these program cannot be put in high memory (the area above 640K), then when you exit the single session, Windows 95 get's upset and reboots. If you either run these as part of AUTOEXEC.BAT, or ensure that they will go into high memory, then only Windows 95 will be restarted.

As for memory considerations, I'll show you my config.sys and autoexec.bat, and explain what they do. I've numbered the lines for convenience. They should not be numbered in the config.sys or autoexec.bat. You should find both of these files in C:\ however, you may also find a copy of them in C:\WINDOWS. First of all, you will see that I've removed all the code page stuff. Code pages are character sets, mainly relevant for Scandinavian countries and for PS/2 and OS/2 character set compatibility (CP850). The default AT character set is called CP437. This is ok for all English speaking and some non English speaking countries. It saves a lot of memory if you do. Change the line (10) by removing the '850' or '437' between the first and second commas. The 044 is UK, and should be your country code (01 for USA).

Remove the DEVICE=DISPLAY.SYS (only needed if you've changed the codepage) and DEVICE=ANSI.SYS (very few programs rely on this driver, it's a waste of space). Note also line 15 is CDROM specific. Windows 95 removes this from your old (CONFIG.DOS). Stupid stupid windows. Put it back or you wont be able to access the CDROM drive in a single dos session. Line 16 is sound card specific and initializes my sound card. Note that nearly everything has HIGH appended. This causes Windows 95 to try and put stuff above 640K.

WARNING

I suggest you put "NOAUTO" in the DOS= line of the CONFIG.SYS. Only do this after checking that everything marked Required!! below is put into the CONFIG.SYS if it is not already there. In particular if Line (11) is missing, Windows 95 will report "No VFAT". If you have any problems, press F8 when Windows 95 starts loading (before the colorful screen) and select one of the "Safe boot" options in the menu.

(1) is Required!!. If you specify /TESTMEM:OFF (optional), the high memory ram won't be checked and so will start quicker.

(2) Required!!, should be the same as in the original AUTOEXEC.DOS. As here, enables the 64K EMS frame.

(3) Required!!. NOAUTO should only be specified if everything marked "Required!!" exists. I suggest you try the AUTOEXEC.BAT without this option first. /NOAUTO stops Windows adding stuff that isn't required.

(4) Specifies number of files that can be open at any one time 40 is currently the suggested number.

(5) Specifies the number of buffers. Keep this around 30 if you can. It's an ideal parameter to fine-tune memory usage, just to get that extra 1K (-2 from the value).

(6) Specifies the DOS 1.0 compatible FCB's. You have to specify a minimum of 1. Only increase this if an old program fails.

(7) only specify this if everything works, makes the boot run faster by not pausing for a key press.

(8) Specifies your last drive. Ok, here is something I learned. 2K is wasted for every unused drive letter. Keep all letters as close together as possible. I have two hard disk drives, both compressed. Drive A is floppy disk A. Drive B is a non-existent floppy disk. Drive C is the compressed image of my first hard disk. Drive D is the host of my second hard disk. Drive E is the host of the first hard disk. Drive F is the compressed image of the second hard disk. Drive G is my CDROM drive.

(9) A misconception is that stacks are needed. They aren't and this disables them.

(10) is mentioned above, I've removed the '850' from 044,850,...

(11) Required!! This is the VFAT driver used by windows 95. Windows 95 will not start without it.

(12) This moves the doublespace/drivespace driver into memory above 640K. Not needed if you don't have doublespace/drivespace installed (which I suggest if you have enough disk space).

(13) is required to allow old Dos tools to work.

(14) is my mouse driver. This could equally be mouse.com in autoexec.bat.

(15) and (16) already been mentioned. Don't be afraid to juggle (11) to (16) around, or mark some of them as "DEVICE" as opposed to "DEVICEHIGH" to move them into lower memory to make extra room for bigger stuff to go into upper memory.

CONFIG.SYS

1 DEVICE=C:\WINDOWS\HIMEM.SYS /TESTMEM:OFF
2 DEVICEHIGH=C:\WINDOWS\EMM386.EXE RAM HIGHSCAN I=B000-B7FF
3 DOS=HIGH,UMB,NOAUTO
4 FILESHIGH=40
5 BUFFERSHIGH=25,0
6 FCBSHIGH=1
7 SWITCHES=/F
8 lastdrivehigh=G
9 stackshigh=0,0
10 Country=044,,C:\WINDOWS\COMMAND\country.sys
11 devicehigh=c:\windows\ifshlp.sys
12 DEVICEHIGH=C:\WINDOWS\COMMAND\DRVSPACE.SYS /MOVE
13 DEVICEHIGH=C:\WINDOWS\SETVER.EXE
14 DEVICEHIGH=C:\MOUSE\MOUSE.SYS
15 DEVICEHIGH=c:\prosonic\slcd.sys /d:MVCD001 /m:p /b:340
16 devicehigh=c:\prosonic\pros.sys P220 I7 D1 E1 T330 Q2

The Autoexec is a lot simpler, and is executed after DOS is started. It may be wise to add "mouse.com" and copy the line from "autoexec.dos" that specifies the "MSCDEX". Don't worry if you don't. The lines are:

(1) disables echoing of all lines including this one.

(2) sets up the path.

(3) and (4) should be set to point to a temporary directory, which ideally should not be the compressed disk.

(5) sets the standard c:\> prompt.

(6) sets enhanced keyboard editing with insert mode.

(7) can be removed for USA keyboards, but is required for UK and other foreign keyboards.

AUTOEXEC.BAT

1 @echo off
2 PATH C:\WINDOWS;C:\WINDOWS\COMMAND;C:\DOS
3 SET TEMP=d:\TMP
4 SET TMP=d:\TMP
5 PROMPT $p$g
6 LH C:\WINDOWS\COMMAND\DOSKEY /insert
7 keyb uk,,C:\WINDOWS\COMMAND\keyboard.sys

Make use of the mem command (mem /c/p). See what memory different programs/drivers take up. juggle things around. Eg if there is 30K free in UMB's, there is a 30K driver in UMB and a 50K driver in lower RAM, mark the 30K driver as "DEVICE" instead of "DEVICEHIGH" (or in AUTOEXEC.BAT, remove "LH"). This will free up about 20K in lower RAM.

Good Luck

Comments/Suggestions: WebMaster