Thursday, January 16, 2014

A Tale of Two Configs

In an MS-DOS system with a 386 or better processor, when it comes to configuring the OS, typically the issue is whether to load or not to load EMM386.EXE.  Loading EMM386.EXE puts the machine into Virtual 8086 mode, and using EMM386 to make expanded memory available substantially decreases the amount of upper memory available to load drivers.  Fortunately, you need not make expanded memory available unless a program requires it.  EMM386 is used to make upper memory available for loading device drivers, and without it, those drivers must be loaded in conventional memory.  If those drivers cause the amount of free memory to be lower than the amount a program requires, the program will not load.  Use of EMM386.EXE is utterly incompatible certain programs like Ultima VII Parts I & II.  On the other hand, many other contemporary games require expanded memory to support sound.  Other games don't care either way.

HIMEM.SYS, which provides access to all the memory above 640KB, is essential to load and should always be loaded .  EMM386.EXE requires HIMEM.SYS to be loaded first.  HIMEM.SYS provides access to the high memory area and allows DOS to load most of itself there, significantly cutting down on the conventional memory DOS would otherwise take up.  For programs that require or can use it, it also makes extended memory available.

For MS-DOS 6.22, a typical 486 computer setup with a mouse, CD-ROM drive and a Sound Blaster 16   may have a CONFIG.SYS like this :

DEVICE=C:\DOS\HIMEM.SYS /TESTMEM:OFF
DEVICE=C:\DOS\EMM386.EXE I=B700-BFFF FRAME=E000
DOS=HIGH,UMB
FILES=40
BUFFERS=30
DEVICEHIGH=C:\DRIVERS\VIDE-CDD.SYS /D:MSCD001

and a typical AUTOEXEC.BAT file may look like this :

@ECHO OFF
PROMPT $P$G
PATH=C:\;C:\DOS;C:\SB16
SET BLASTER=A220 I5 D1 H5 P330 T6
SET SOUND=C:\SB16
SET MIDI=SYNTH:1 MAP:E
C:\SB16\DIAGNOSE /S
C:\SB16\MIXERSET /P /Q
LH C:\DOS\MSCDEX.EXE /D:MSCD001
LH CTMOUSE.EXE

My 486 uses roughly these lines in its AUTOEXEC.BAT and CONFIG.SYS.  Lets describe what each line does, starting with the first line of CONFIG.SYS :

1.  DEVICE=C:\DOS\HIMEM.SYS /TESTMEM:OFF

HIMEM.SYS is a Device Driver that must be loaded in CONFIG.SYS on startup.  The config.sys command to load a device driver is DEVICE=.  The full path where a device driver can be found must be included.  HIMEM.SYS is primarily used to allow DOS to access the High Memory Area, but it also functions as an eXtended Memory Manager (XMM), giving your programs access to eXtended Memory Specification (XMS) memory.  The /TESTMEM:OFF parameter bypasses a memory test that adds to the boot time.  It is only useful on 286 or above systems.

2.  DEVICE=C:\DOS\EMM386.EXE I=B700-BFFF FRAME=E000

EMM386.EXE can be used as a command or as a device driver.  It's primary function is to act as an Expanded Memory Manager (EMM), giving your programs access to Expanded Memory Specification (EMS) memory.  It also allows the creation of Upper Memory Blocks (UMB) in the Upper Memory Area (UMA).  It is only useful on 386 or above systems.  This device driver switches DOS from using real mode into Virtual 8086 mode, and some programs and games refuse to run in this mode.  By removing the EMM386.EXE line, those programs that complained about EMM386.EXE and Virtual 8086 mode and refuse to load now will load.

3.  DOS=HIGH,UMB

This line instructs DOS to load itself high, saving about 55K of Conventional Memory.  It also instructs DOS to create UMBs.  By loading drivers within UMBs, you can save Conventional Memory from being used.  You must load HIMEM.SYS to use the HIGH parameter and EMM386.SYS to use the UMB parameter.  

4.  FILES=40

DOS's default maximum number of files being open at one time is 15, but some games require more.  40 is sufficient for just about any program.  

5.  BUFFERS=30

DOS's default maximum number of disk buffers to allocate is 8, but some games require more.  30 is sufficient for just about any program.  

6.  DEVICEHIGH=C:\DRIVERS\VIDE-CDD.SYS /D:MSCD001

DEVICEHIGH tells DOS to load a device driver into an UMB.  It does not work with HIMEM.SYS or EMM386.EXE and will not work until both have been loaded.  

VIDE-CDD.SYS is a generic IDE CD-ROM device driver that works with pretty much everything and only takes up 5KB of RAM.  This device driver acts as an interpreter between DOS calls and the low level hardware.  If the CD-ROM drive used a SCSI or proprietary interface, you would load another kind of driver here.  You cannot actually use a CD-ROM as a drive until you load MSCDEX.EXE in AUTOEXEC.BAT  The /D:MSCD001 is the name given to the CD-ROM and must be used with MSCDEX.EXE.  

Alternatives to EMM386.EXE for UMBs

EMM386.EXE generally causes slightly decreased performance compared with an environment when it is not loaded.  If you want to create UMBs without it, you will have to try to find a program that will work with your chipset.  The program UMBPCI.SYS works with chipsets that provide a properly-functional PCI implementation.  Pentium/586 and later systems are the mostly likely systems to work with UMBPCI.SYS. Programs that can work with 386 and 486 computers include HiRAM, URAM, DOSMAX and RDOSUMB.  These programs only support specific motherboard chipsets, whereas EMM386.EXE is universally supported on PC compatible motherboard chipsets.  I have a 486 SiS 85C471 chipset and URAM supports it, so I use that program.  My CONFIG.SYS looks like this :

DEVICE=C:\DRIVERS\URAM.COM R=..........7777777777.... I Q
DEVICE=C:\DRIVERS\UMB.SYS C800-EFFF
DEVICEHIGH=C:\DOS\HIMEM.SYS /TESTMEM:OFF
DOS=HIGH,UMB
FILES=40
DEVICEHIGH=C:\DRIVERS\VIDE-CDD.SYS /D:MSCD001

My AUTOEXEC.BAT stays the same.

DOS 6.0 and above allows you to select your configuration properties via a boot-up menu system.  The Help in DOS 6.0 and above gives examples on how to set up a menu so that one selection will give load EMM386 and a second selection will load URAM.

3 comments:

  1. Curious, do you know if it's possible to have an SB16 co-exist with a PAS16 in MS-DOS (7.1)? I can init then use either card in config.sys, but not both...

    ReplyDelete
  2. If MS-DOS 7.1 supports a config menu, and it almost certainly does, then it is quite possible. Not all Sound Blaster 16s require a driver in config.sys, only the PnP versions do if you plan to use them in DOS. Pre-PnP Sound Blaster 16s are either configured wholly by jumper or via DIAGNOSE.EXE or SBCONFIG.EXE, which are loaded in autoexec.bat

    ReplyDelete
  3. For DOS 7, if no Windows 9x is going to be loaded, one can use DOS=HIGH,UMB,NOAUTO to skip IFSHLP.SYS which is otherwise loaded quietly in the background. This should free up some additional memory.

    ReplyDelete