Rob van der Woude's Scripting Pages

DOS memory managment

Some undocumented or poorly documented tricks
Command (1) AUTOEXEC.BAT
or CONFIG.SYS
Description DOS version
or environment
SHELL=C:\DOS\COMMAND.COM /C LH C:\DOS\COMMAND.COM /E:512 /P CONFIG.SYS Load high COMMAND.COM (2) (3) MS-DOS 5+
INSTALL=C:\DOS\COMMAND.COM /C LH SHARE.EXE CONFIG.SYS Load high SHARE.EXE or other TSR MS-DOS 5
INSTALLHIGH=SHARE.EXE CONFIG.SYS Load high SHARE.EXE or other TSR MS-DOS 6+
SIZE=0 C:\TCPIP\BIN\VDOSTCP.SYS DOS settings tab for program object Load high DOS device driver (4) OS/2 Warp DOS session
INSTALL?=SHARE.EXE <Return>
INSTALLHIGH?=SHARE.EXE <Return>
DEVICE?=ANSI.SYS <Return>
DEVICEHIGH?=ANSI.SYS <Return>
CONFIG.SYS DOS will ask if you want to load each of these TSR's and drivers (5) MS-DOS 6+
CHOICE /C:NY Do you want to load MOUSE.COM <Return>
IF ERRORLEVEL 2 LH MOUSE.COM <Return>
AUTOEXEC.BAT DOS will ask if you want to load this TSR (5) MS-DOS 6+

 

Notes: (1) Due to screen space restrictions, command lines may be wrapped. You still need to type them as one single line in your CONFIG.SYS or AUTOEXEC.BAT. If multiple command lines are displayed in this table, each will be terminated with <Return> to show you where each line ends.
(2) If you load high COMMAND.COM like this, you need to specify the COMSPEC variable in AUTOEXEC.BAT:
SET COMSPEC=C:\DOS\COMMAND.COM
(3) You should thoroughly test this trick in your specific DOS environment. I know for sure that it should not be used in a Novell Netware 3.1* environment!
(4) You need to make sure DOS_UMB=1 (On) for the program object to load high device drivers.
(5) By only loading those drivers/TSR's that you need right now, you will save some memory when you don't need them. This might also be achieved by pressing F8 when MS-DOS is being started, but this trick saves you the trouble of confirming every single line in CONFIG.SYS and AUTOEXEC.BAT. Of course, you could also achieve this by creating a menu in CONFIG.SYS, which would give you the added benefit of default choices and time-outs.

TSRs and environment

When memory is at a premium, consider this: each and every TSR, when loaded, keeps a copy of the environment in memory. So you may save some memory by setting environment variables — including PATH and PROMPT — after loading TSRs.

High Memory fragmentation

If your PC has enough upper memory free, but DOS somehow doesn't seem to be able to load all drivers high, your PC's upper memory may be too fragmented to be of much use. Remember, each driver or TSR loaded in upper memory needs:

  1. a copy of DOS' environment
  2. memory to load itself in permanently
  3. memory needed to load itself, to be freed when loading is done

1, 2 and 3 together have to fit in one contiguous upper memory area.
Especially in old IBM PS/2 (MCA) machines, adapter RAM and ROM usually was spread evenly through upper memory, to avoid conflicts by overlapping ROM/RAM areas.
By moving the ROM and RAM addresses in such a way that no unused memory address remained between the ROM/RAM areas, you can use the remaining upper memory much more efficiently.

Make sure you have stored the original configuration on diskette before experimenting with it!

If you have a copy of Quarterdeck's QEMM or Manifest available, use Manifest's memory timing test to find the exact locations of all adapter ROM and RAM on your system. This is by far the most reliable way to get those locations.

Be careful, though. Do not change your computer's configuration unless you fully understand the consequences of what you are doing!

Disk cache

If you need more room to breathe in Windows 3.11, optimize the amount of cache reserved for 32 bit disk and file access. The default amount of 2MB doesn't offer much performance increase over 512KB, while 1.5MB extra memory for your applications may prove to give you the performance boost you desperately need.

Also consider removing SMARTDRV if you use 32 bit disk and file access and do not need the cache for floppy drives or CD-ROMs. You would gain several kilobytes of base memory.

 

Put that old Hercules card to good use

The next trick will only work on old 8086, 8088 en 80286 PC's with a color video card and IBM PC-DOS 6.1 or up. It will give you an extra 60KB of high memory!

  1. Add a genuine Hercules video card (not the monitor) to your PC, do not remove the color video card
  2. Make sure UMBHERC.SYS is in the DOS directory
  3. Adjust CONFIG.SYS:
    DEVICE=C:\DOS\HIMEM.SYS (80286 with at least 64KB XMS)
    DEVICE=C:\DOS\UMBHERC.SYS  
    DOS=UMB (8086/8088 or less than 64KB XMS)
    DOS=HIGH,UMB (80286 with at least 64KB XMS)
    DOSDATA=UMB (PC-DOS 7)
    SHELL=C:\DOS\COMMAND.COM /P /H (PC-DOS 7 and at least 64KB XMS)
    SHELL=C:\DOS\COMMAND.COM /P (PC-DOS 6.1 to 6.3, or less than 64KB XMS)
    (Do not add the comments between brackets, they are meant to show which lines are to be added for which configuration)

You now have an extra 60KB of high memory available, which you may use to load high drivers or TSR's.

Instead of an Hercules card and UMBHERC.SYS, you could use an MDA card (try your local hardware museum) and UMBMONO.SYS. This will give you only about 16KB of high memory, instead of the Hercules' 60KB.

One final word of advice: have all the relevant hardware manuals ready before you start.


page last modified: 2011-03-04; loaded in 0.0058 seconds