Older Operating Systems

Class Notes # 14 Computer Configuration November 20, 2003

The default configuration of DOS, which may be adequate for many users, is intended to work with the greatest number of systems. DOS also allows users to take full advantage of their computers features. We could configure our computer to operate more efficiently. There are two general ways of making our computers efficient: • Add or replace hardware • Use software to attain an optimal configuration for existing hardware resources

DOS falls in the second category. With DOS we can manage our memory more efficiently and we can also use special device drivers and utility programs to enhance the performance of our hardware and software.

Device Drivers Device drivers are software programs, which is used by DOS to control hardware devices. Most device drivers are loaded at boot time by including the in your CONFIG.SYS. The DEVICE command tells DOS to load a device driver and uses the following syntax: DEVICE = driver /switches The driver is the actual software for the device, and the /switches are any switches that the device driver software needs.

For example, the mouse device driver (MOUSE.SYS) is loaded in the CONFIG.SYS file with this command:

DEVICE = C:\DRIVERS\MOUSE.SYS

The DEVICE = command tells DOS that the program file name MOUSE.SYS stored in the \DRIVERS directory on drive C is a TSR needed to drive the mouse device.

You may also load certain device drivers in AUTOEXEC.BAT. For example, the mouse device driver can also be loaded from the AUTOEXEC.BAT file. To load the mouse device driver add the following command in your AUTOEXEC.BAT:

C:\DRIVERS\MOUSE.COM

Table one lists the device driver files included with DOS 6.2.

Table one: DOS 6.2 device drivers Device Driver Description ANSI.SYS Enables control of display by using ANSI control sequences. CHKSTATE.SYS Used by memmaker when optimizing your system. DBLSPACE.BIN Enables disk compression, increases the size of your hard disk. DISPLAY.SYS Provides support for switching to the screen.

1 DMDRVR.BIN Provides support for Ontrack disk manager. DRIVER.SYS Sets parameters for physical and logical disk drives. EGA.SYS Saves and restores an EGA screen when using DOSSHELL and the task swapper. EMM386.SYS Uses XMS memory to emulate EMS memory and provide upper memory blocks. HIMEM.SYS Manages . INTERLNK.EXE Interlnk network client control program and device driver. MONOUMB.386 Device driver used by Windows which allows EMM386 access to the monochrome video region, treating it as UMB area. MOUSE.COM Support for a mouse. POWER.EXE Support for computer utilizing APM (Advanced Power Management) hardware. PRINTER.SYS Support for international characters and code page switching on certain printers. RAMDRIVE.SYS Uses a portion of RAM to simulate a hard disk (RAM disk). SETVER.EXE Establishes a version table that lists the version number DOS reports to named programs. SMARTDRV.EXE Uses extended or to buffer disk reads. SSTOR.SYS Support for SpeedStor hard disk compression. VFINTD.386 Used by Windows to give MWBACKUP access to tape drives.

Memory Management In the early 1980s, when IBM and Microsoft were designing the original PC, they decide to make 640 kbytes of memory addresses available to the user, thinking this was plenty. The 640 kbytes of address was intended to hold the OS, the application software, and the data being processed. The video BIOS and its data was placed in the very first part of upper memory (640k to 768k). All video ROM written for DOS based computers assumes that these programs and data are stored in this area. Also, many DOS and Windows applications interact directly with video ROM and RAM in this address range. The major reason that applications have 640k memory limit is that video ROM begins at 640k. If DOS and allowed applications into these upper memory addresses, all DOS compatible video ROM would need to be rewritten, many existing video boards would be obsolete and many DOS applications that access these video addresses would not work.

The memory map is shown in figure one. The first 64k of extended memory is called the , and exists because a bug in the programming for the older 286 CPU produced this small pocket of unused memory addresses. The OS capitalized on this bug by storing portions of itself in the high memory area, thus freeing some where DOS had been stored. This process of storing DOS in high memory area is called loading DOS high. To load DOS high add DOS = HIGH in CONFIG.SYS.

2 Extended Memory 1024k + 64 kbytes System BIOS F0000 - FFFFF

Upper Memory 640k to 1024k Video ROM C0000 - CFFFF

Video RAM A0000 - BFFFF

Conventional Memory 00000 - 9FFFF 0 to 640k

Figure 1: DOS Memory map

Extended Memory Extended memory is actually managed by the OS as a device that is controlled by a device driver called a memory manager. DOS provides the memory device driver called HIMEM.SYS to access the extended memory region. HIMEM.SYS manages memory according to the rules set out in the Extended Memory Specification (XMS). Three areas of memory above the conventional 640k barrier can be made available for programs to use: • UMA (). This consists of 384kbytes of memory above 640kbyte up to 1Mbyte and is divided into many different sized blocks, called UMBs (Upper Memory Blocks). • HMA (High Memory Area). This is a single block of memory essentially consisting of the first 64kbytes of extended memory. HMA slightly overlaps the upper memory area – the last 16 bytes of the upper memory area are the first 16 bytes of the high memory area. • XMS (eXtended Memory Blocks). This portion of memory includes all memory above 1024kbytes. When extended memory is managed by an extended memory manager, you refer to the memory as XMS memory.

The syntax for using HIMEM.SYS is:

DEVICE = HIMEM.SYS /A20Control:ON|OFF /numhandles = n /EISA /HMAMIN = m /int15 = xxx /machine:xx /shadowram: ON|OFF /cpuclock: ON|OFF /quiet

3 Most of the switches are irrelevant for today’s PCs. The switches are described in table two. Table two: HIMEM.SYS switches Switch Description A20CONTROL HIMEM can detect how the address line A20 is used by the computer NUMHANDLES=n Extended memory manager assigns one or more extended memory block handles to a program. Indicates the maximum number of handles available. The value of n can be assigned 1 to 128. EISA Use this switch to tell HIMEM to automatically allocate all available extended memory if your machine is using EISA (Extended Industry Standard Architecture) with more than 16Mbytes of memory. HMAMIN=n Sets the minimum amount of memory that must be requested by an application before the application is permitted to use HMA (High Memory Area). INT15=xxx Some programs address extended memory by the 15 interface. You add the INT15=xxx where the xxx indicates the amount of extended memory you want HIMEM to assign to the INT15 interface. MACHINE: xx You can specify the type of A20 handler your PC uses by inserting for xx the code that matches your computer. CPUCLOCK Turn on to ensure HIMEM does not slow your computer’s clock speed. QUIET HIMEM loads without the usual status message when QUIET is on. SHADOWRAM Turn on to uses some of your upper memory blocks.

All PCs store some of their basic operating instructions in read only memory (ROM). Computers cannot access instructions from ROM as fast as they can access instructions from RAM. If you have plenty of memory, you can increase the performance of your computer by asking the computer to copy the instructions from ROM into an upper memory block (i.e.RAM). This technique is known as shadow RAM.

Expanded Memory Expanded memory was introduced before extended memory, therefore many PC applications were written to take advantage of expanded memory, not extended memory. Extended memory is far more common. The DOS device driver EMM386.EXE enables applications to use expanded memory. The EMM386.EXE emulates expanded memory by using extended memory. Therefore, you must load HIMEM.SYS before EMM386.EXE. The syntax for EMM386.EXE is:

DEVICE=EMM386.EXE ON|OFF RAM NOEMS MIN=n

There are more switch options available. The OFF switch starts the computer with EMM386.EXE loaded in memory but inactive. The OFF switch is not compatible with

4 NOEMS or RAM switches. The expanded memory emulator allocates 256kbytes of extended memory to be used as expanded memory. The RAM switch enables upper memory. Use the NOEMS switch to free the maximum amount of upper memory and to provide no EMS memory (i.e. do not allocate extended memory for use as expanded memory).

Terminate and Stay Resident (TSR) To load device drivers or memory resident programs (TSR), into upper memory, the following conditions must be met: • HIMEM.SYS is loaded as a device driver. • EMM386.EXE is loaded as a device driver with the RAM or NOEMS switch. • The command DOS=UMB appears in the CONFIG.SYS

If you also want to use the command DOS=HIGH to load DOS into high memory, you can combine the two commands as: DOS = HIGH, UMB

You can load two types of programs into upper memory: device drivers and TSRs. Normally, device drivers are loaded using the DEVICE command. When you want to load a device driver into upper memory, use the DEVICEHIGH command.

To start a memory resident program into upper memory, precede the program’s start-up command with LOADHIGH (you can also use LH). For example, assume that you want to load DOSKEY into upper memory each time you start your computer. To do this, add the following command to your AUTOEXEC.BAT:

LOADHIGH DOSKEY

If DOS is not successful when it tries to load device drivers or TSRs into the upper memory area, DOS loads the program into conventional memory instead.

MEM Command DOS enables you to display the amount of free and used memory at any point during a DOS session. The syntax for the MEM command is:

MEM /classify /debug /free /module modulename /page

For any option, you can specify just the first letter, such as /C in place of /classify. With no switches, MEM gives a basic report of how the memory on your machine is being used. The /C option lists all DOS programs and device drivers currently loaded.

MemMaker DOS includes MemMaker, a utility that analyzes your PC and makes the appropriate changes to your CONFIG.SYS and AUTOEXEC.BAT so that your computer uses its

5 memory most effectively. You can configure your memory with MemMaker using the express setup or the custom setup.

Express setup is the easiest way to configure your memory with MemMaker. You have little interaction with the express setup, other than pressing enter when MemMaker prompts you to do so. The custom setup is similar to the express setup. You can customize the following using the custom setup: • Specify any TSRs that should not be included in optimization. • Aggressively scan the upper memory area. • Set aside upper memory for Windows use. • Use an area of upper memory set aside for monochrome display adapter if you are only using EGA or VGA display. • Keep any special memory inclusions or exclusions that you specified with EMM386.EXE. • Move the extended BIOS data area in upper memory blocks.

BUFFERS command The BUFFERS command in CONFIG.SYS tells DOS how much memory to reserve for file transfer. DOS sets aside an area or RAM called a buffer for temporary storage of data being transferred between the disk and an application program.

When DOS is asked to retrieve information from a disk, it reads the information in increments of whole sectors (512 bytes). Excess data not required from that sector is left in the buffer. If this data is needed later, DOS does not need to perform another disk access to retrieve the data. Similarly, DOS tries to reduce disk activity when it writes information to the disk. If less than a full sector is to be written to the disk, DOS accumulates the information in a disk buffer. When the buffer is full, DOS writes information to the disk. This action is called flushing the buffer. To make sure that all pertinent information is placed into a file, DOS also flushes the buffers when a program closes a disk file.

The net effect of DOS’s use of buffers is to reduce the number of disk accesses by reading and writing only full sectors. By reusing the least recently used buffers, DOS retains information more likely to be needed next. Your programs and DOS therefore run faster.

You can control the number of buffers available for DOS to use. Each buffer uses up some of your memory but results in faster disk access. The syntax for the BUFFERS command is:

BUFFERS = n, m

The n parameter is the number of disk buffers you want DOS to allocate. A single buffer is about 512 bytes long (plus 16 bytes used by DOS). Use a number from 1 to 99. The m parameter is a number in the range 1 through 8, that specifies the number of sectors DOS reads each time it is instructed to read a file. This feature is sometimes called a

6 secondary cache or a look ahead buffer. Do not use this secondary cache feature if you are using or plan to use a disk caching program such as SMARTDRV.SYS.

FILES command To include the FILES command in CONFIG.SYS, use the following syntax:

FILES = n

The n parameter is a number ( 8 through 255) that determines the number of files that can be opened at one time during a DOS session. Each additional file over 8 increases the size of DOS by 39 bytes. The default value for n is 8.

LASTDRIVE The LASTDRIVE configuration command informs DOS of the maximum number of disk drives on your system. If you want to use LASTDRIVE command in CONFIG.SYS, use the following syntax:

LASTDRIVE = x

The x parameter is the letter for the last drive on your system. The letters A through Z in uppercase or lowercase are acceptable.

7