If you sit and read this in the year 2136 on your "mind computer", surfing the archives, think on this as a technical tour-de-force on how it all started with computers for the people back in 1985. If we should learn from the newly ended Y2K, it could be that the last DOS based system have'nt shut down yet... Tom Kjeldsen, April 2000

PC Hardware Overview

This document was last updated: 1/2/1999

The PC is made up of several components. The processor, which is responsible for interpreting code and manipulating data, is connected to the memory (where the active code and data are stored) and the 'bus' (which allows the processor to 'talk' to other periphals). The bus has several 'expansion slots' (the exact number depends on the make and model) to which most other periphals are connected, as printed circuit board cards installed inside the computers case. The processor also has a connection with the PIC (programmable interrupt controller), whose purpose shall be dealt with later.

There are several types of bus; for processors up to and including the 80186, the bus is 8 bit. The 80286 is connected to a 16 bit bus, known as the ISA bus, as is the 80386. Later processors have a variety of buses to choose from. These include ISA, EISA (Extended ISA), VLB (VESA local bus) and PCI (used with Pentium and later processors). IBM also produced a line of computers with MCA buses ("Micro Channel Architecture"). It generally matters not at all to the programmer what type of bus the system is equipped with, although it may affect the capabilities/speed of access to periphals. In modern PCs, 8 or 16 bit buses tend to form a bottleneck and slow the whole system.

Memory (as defined here) is divided into RAM (random access memory), which is volatile meaning that it is writeable as well as readable and that it loses its contents when the PC is switched off or power supply is lost. 'CMOS RAM' is memory accessible via the bus which does not lose its contents on shutdown - it is used to store system configuration information and the current time and date. Not all system have CMOS - though all modern (286+) systems do. ROM is unchangeable (read only) memory which does not lose its contents. Note that sometimes, the word 'memory' may also be used to refer to storage media.

The parts will change.

The general order of PC models produced by IBM was: 'PC' (1981), 'XT' (1982), 'PCjr' (1983 - a PC designed specifically for home use, it was in many ways incompatible with the other systems), 'AT' and 'XT/286' (1984/86 respectively; the first models equipped with an 80286 processor and enhanced BIOS), 'Convertible' (1985 - supposed to be a portable PC, not fully compatible with other models) and then the 'PS/2' line (of which later models used MCA which made them hardware incompatible with earlier systems, though nearly fully software compatible. That is, periphals which could be connected to an AT for example could not be connected to an MCA machine, though programming the equivalent periphal was performed in exactly the same way. There is a documented BIOS call to identify MCA systems). The PC, XT, PCjr, Convertible and PS/2 models 25 and 30 (8086 processor) are considered obselete and are not covered here.

Modern systems have an 'AT BIOS' which is an extension over the original PC/XT BIOS. PS/2 BIOSes are AT BIOS compatible and have some enhancements, which 3rd party manufacturers have also added to what are ultimately AT systems. There are documented BIOS calls to check for the presence of such features.

All systems have 2 DMA controllers, with 4 channels each. These are numbered 0 to 3 (first controller) and 4 to 7 (second controller). Except in MCA systems, controller one is 'cascaded' through the first channel of the second controller (channel 4). This has no bearing on the programmer, but makes channel 4 unavailable for use by periphals. Channel 2 is generally assigned to the floppy diskette drives and channel 3 to the hard drive (although both can be fully functional without using DMA at all).

All systems also have two PICs (programmable interrupt controllers). The second is cascaded through IRQ 2 of the first, meaning that any interrupt in the second controller actually generates a signal on the IRQ 2 line of the first controller. The first controller is programmed on startup to allow the second controller to actually generate the interrupt. The actual interrupt for IRQ 2 is normally disabled, so that the software interrupt assosciated with IRQ 2 is not called for every interrupt request on IC 2. The handler code for IRQ 9 (as set up by BIOS on initialization) redirects the software interrupt to that assosciated with IC 1's IRQ 2, for compatibility with older devices designed for use with only one IC chip (presumably such devices always trigger IC 2 IRQ lines).

Standard systems also have one PIT (programmable interrupt timer), CMOS, a keyboard controller, hard disk controller (usually two in recent systems) and floppy controller. The keyboard controller is connected to the reset line which may be used to reset the system (the other method of resetting the system is to triple-fault the CPU, or even to jump directly to the startup code). There is generally also controllers for the serial and parallel ports. Some systems (all modern systems) are equipped with a math coprocessor. On 286 and 386 systems, the math coprocessor operates fairly independently of the main coprocessor which can create difficulties - it is necessary to make sure the previous math operation has finished before starting a new one (using the FWAIT machine instruction) and also before attempting to access memory on which the coprocessor has been told to operate. There also seems to be an NMI line which can apparently have different purposes, but information is sparse.

DOS STARTUP (ver 3.3+)

Follow this shortcut to see program startup


DOS PROGRAM STARTUP

DOS Information

This document contains information about the internal workings of the DOS operating system for PCs. Its purpose is to give an overview to those wishing to create programs to run under DOS and to those wishing to write their own version of DOS, or a DOS emulation.

Contents

Assumed knowledge: Understanding of computing terms; basic understanding of IBM-compatible computer architecture, including Intel 80x86 processor architecture; basic understanding of DOS operating system; understanding of the hexadecimal counting system and notation.

Intel is a registered trademark of Intel Corporation.
IBM and PC-DOS are registered trademarks of International Business Machines.
CP/M is a registered trademark of Digital Research


History

DOS is an abbreviation for 'Disk Operating System'. When IBM was searcing for an operating system for its newly developed PC (in 1980), the original intention was to use CP/M, a popular system already tried on other machines. The main problem was that a new 16-bit version would have to be created.

There are some rumours that there was a communication breakdown between IBM and IDR (Intergalactic Digital Research, the company who owned the rights for CP/M, now known by the less austentatious name of Digital Research), but whatever the reason, the system finally licensed was the then-small Microsoft's 'MS-DOS', which was itself adapted from 86-DOS, also known as 'QDOS' - for 'Quick and Dirty Operating System'.

Because of bugs found in the early MSDOS, IBM wrote their own version of DOS, designed to be compatible with Microsoft's specification, which they called PCDOS (presumably standing for Personal Computer Disk Operating System). To this day the two DOS's are marketed seperately by their respective companies, though the Microsoft product is by far the most popular.

Since those early times DOS has developed rather significantly. Other companies including Digital Research began to market different versions of DOS; DOS version numbers increased and DOS became more complex and powerful. The most significant advancement was version 2.0 which was designed to allow the used of hard drives, and then DOS 3.0 (3.3 by the time the bugs were removed) which had built-in support for networking. Further enhancements were also made but more and more rarely were they an internal part of DOS.

Further reference: 'DOSREF 3.3' by Dave Williams (disk based text)


Understanding DOS: How it works, how it is organized

The way in which DOS and programs interact with the computer can best be looked upon as a set of layers. The lowest layer is the hardware itself. The next layer is the BIOS, which has functions to communicate with the hardware. There are several things missing from this setup, and DOS is responsible for filling in the gaps, that is, for the sharing of memory and devices between programs, and for providing standards for allowing programs to be run. Thus DOS is the next layer.

However, in a sense, a fourth layer exists between the BIOS and DOS level (or in some cases directly between DOS and the hardware). This layer is comprised of device drivers. Device drivers are special programs which interface DOS to a hardware device (either directly or through the device).

Device drivers can be classified in various ways. The biggest distinction is between 'block devices' and 'character devices'. Block devices are devices which operate on blocks of data and are represented in DOS as disk drives, accessible through a drive letter. Character devices on the other hand will accept as little as a single byte at a time to operate on; character devices include the video screen and printers.

Some hardware devices can not be classified as either, however; an example is the mouse. Although the mouse driver could be implemented as a character device driver, this would prove inefficient and cumbersome, and mouse drivers generally do not adhere to the DOS device driver standard but rather provide functions to programs through a seperate interface.

Also, be aware that some devices which appear as block devices (in the sense that they are accessed through a drive letter) are actually using a special network interface that DOS provides (the 'redirector interface'). The allocation of physical space on such devices is allocated not by DOS but by the device driver itself, or by the hardware or network which the driver interfaces with. Such devices include network drives and CD-ROM drives. As a matter of fact, CD-ROMS are seperated even by a further layer - the MSCDEX program (Microsoft CD extensions). The redirector interface is not well documented; many references neglect to even mention it.

Note as well that a single block device driver can control more than one block device, and a single device driver file can contain more than one driver. This effectively allows one device driver to be responsible for a number of devices.

In summary, there are three types of drive devices: 'local' block devices, 'remote' network drives, and local drives using the network interface. There are also two other types of drivers: character devices and 'alternate' devices such as the mouse.

Device allocation

A higher level division of device drivers is that between internal DOS drivers and explicitly loaded device drivers. DOS contains code to interface several standard devices, and in doing so provide a number of internal device drivers (which are accessed in the same way as explicit drivers).

The internal block devices are A: and B: - the floppy drives; if no B: exists, then B: becomes a second way of referencing the first floppy. Normally, when B: is accessed after A:, the DOS internal driver displays a message 'to insert a diskette for drive B:', and when when A: is accessed after that, the same occurs 'for drive A:'. This can be used to emulate the presence of two floppy drives. C: and D: refer to the first and second hard disk drive respectively. If no hard drives exist, C: and D: will not be automatically created; if a second HD does not exist, C: but not D: will be created. No emulation of a second HD is performed.

Standard character drivers (except for NUL) can easily be replaced by installing a new driver with the same name. The character devices are:

NUL: This device simply ignores all output and gives no input. It is mainly used with re-direction on the DOS command line to suppress a program's output. NUL is the only character device driver which cannot be replaced.

COM1 - 4 (eg COM1, COM2...): The computer's serial ports. Interestingly enough, if there are less than four devices, four driver interfaces are still supported. The extras act just like the NUL driver.

LPT1 - 3 (eg LPT1, LPT2...): The computer's parallel ports. The behaviour here is the same as for the COMx devices.

PRN: An alias for LPT1

AUX: An alias for COM1

CON: Any output sent to CON will (usually) go to the screen; any input will come from the keyboard (the keys the user has pressed). This device works by calling the BIOS keyboard and video functions. DOS checks the character in the devices (keyboard's) input buffer on many function calls (depending on the value of BREAK, see the discussion of control variables in Programs Under DOS) and takes action on certain combinations (see below). Also, this device intercepts INT 1Bh calls (made by BIOS when the CTRL-BREAK key combination is pressed) and returns CTRL-C as the next character if a CTRL-BREAK has been detected.

CTRL-SPauses until another character recieved available in CON.
CTRL-P or CTRL-PrintScreenToggles transmittal of everything going to a STDOUT device, and every input that is echoed back to a STDIN device (from within a DOS function), to also go to the PRN device.
CTRL-CClears CONs input buffer, displays ^C to CON and then calls INT 23h, which by default terminates the program.

$CLOCK: The clock device is used to control the time-keeping clock on systems equipped with such a device. The $CLOCK device uses a special format for input and output, as shown below:

WORDNumber of days since 1-Jan-1980
BYTENumber of minutes since the beginning of the hour
BYTENumber of hours since the beginning of the day
BYTEHundredths of seconds (...)
BYTENumber of seconds (...)

Disk Organization

Block devices are so named because they operate on blocks of data at a time. The size of the blocks is dependent on the device; usually it is the sector size of the device to which the driver refers (usually 512 bytes). The size must always be a power of 2.

In essence, all a block device needs to be able to do is to follow instructions from DOS to read from and write to certain sectors (or clusters as they are called, as a device may use a block size of several physical sectors).

Each block device may have a certain number of 'reserved sectors' which DOS does not use. For a floppy drive, this contains the boot sector (which contains code executed if the computer is 'booted from the floppy' - usually this is done by simply resetting the computer with the floppy in the drive). Hard drives also have a 'master partition table' although this is usually made completely invisible to DOS (it is not one of the reserved sectors).

There are also a number of FATs (usually 2). a FAT is a 'file allocation table' and contains information about which clusters are being used by which files. All FATs are modified one after the other so all should be identical. If one FAT is inadvertantly destroyed, another can be used to replace it, with minimal loss of information.

Following the FATs is the root directory space. Because this space is a fixed size, there is a practical limit to the number of root directory entries. The volume label of a drive is also stored as a root directory entry. Each entry contains a file name (or volume name), date and time which the file was last altered, file attributes (volume label, directory, hidden, read-only, system and archive), size, and first cluster occupied by the file- subsequent clusters can be found by examining the FAT.

The volume label attribute describes the entry as being a volume label rather than a file. The directory attribute specifies the entry is for a directory rather than a file (though a directory is stored in the same way as a file; the format is similar to that of the root directory itself). The hidden attribute is used to signal to programs that the file should not be listed in a normal directory listing, and not interpreted as being part of a file specification that uses wild cards. The read-only attribute causes DOS to give error messages to programs attempting to write to, destroy or alter the file (although the attributes may still be altered, in order to be able to remove the read-only attribute if alteration is necessary). The system attribute has in essence the same meaning as the 'hidden' attribute; system files are considered crucial in the operation of the system, and should generally not be moved from their location on disk. The archive attribute is set by DOS whenever a file is changed, as is the file date and time (accurate to two seconds).

Raw and cooked modes, STDIN and STDOUT

Character devices may operate in two modes - 'raw' (or binary) mode and 'cooked' (or 'processed' or 'text') mode. Character devices begin operation in cooked mode.

Cooked mode means that on any 'input with echo' performed on the device, if a control character is input, it is echoed as double character, the first being a caret (^) and the second being the appropriate alphabetical character. Also, any output is scanned for CTRL-Z and if a CTRL-Z is found, the output block is terminated (that is, output only continues up until the CTRL-Z is reached, the rest of the output block is discarded; further output continues when the next output block is sent). Input from the device is also scanned: If the first character of a buffered read is CTRL-Z, no input is returned until the next read is made. However a CTRL-Z embedded within a block of input is not treated specially (tests made in DOS version 6.22)

All character devices may be flagged as being STDIN and/or STDOUT devices. Standard input devices are treated specially by DOS, in that when a buffered input occurs, the user has a chance to edit the line of input using the backspace key to delete the previous character. All characters input in this way are echoed as output to the device (so that the user can see what they are typing or inputting), the backspace key is converted to 'backspace-space-backspace' (so that it overwrites the character which would otherwise be left visible for this purpose). STDOUT only has special purpose when printer echo is turned on (see DOS interface to programs).

The DOS interface

When a program is executed under DOS, it is expected to communicate with DOS (if necessary) using a standard interface. Most DOS functions can be accessed using Interrupt 21h. Through the Int 21h interface, file and device I/O can occur, memory* can be allocated and de-allocated (freed), and various system functions can be performed. On some DOS function calls (exactly which depends on the status of the BREAK variable; see below and consult function call reference for more information), the CON device's input buffer is checked for various key combinations; see the CON device description under Device Allocation for more info.

Most input/output is performed using a 'handle' which is a numerical value indicating to DOS upon what the operation in question is to be performed. The five standard devices are 'open' and assigned a handle automatically; these are STDIN: 0, STDOUT: 1, STDERR: 2, STDAUX: 3, STPRN: 4. Interestingly enough any device can be assigned as a STDIN or STDOUT device, though the STDIN and STDOUT of a program by default refers to the CON device. STDIN (standard input) is usually assigned to the CON device and thus the computer's keyboard, STDOUT is usually also assigned to the CON device and so the video screen (both STDOUT and STDIN can be redirected on the DOS command line using the COMMAND.COM interpreter), STDAUX is usually AUX, STDPRN is usually PRN, and STDERR is also a reference to CON (for the purpose of displaying messages that must be seen even if output has been redirected). Note that a program refers to a standard device by number and not by name.

Any other I/O requires that the file or device be 'opened' first. The open request is made by the application using the Int 21h interface, and DOS returns (assuming no error occurs) a handle that the application can use in subsequent requests (known as 'calls'). When the application is finished with the file or device, the handle is 'closed' using another DOS call.

* DOS will only directly access the first 640 kilobytes of memory. Enhancements which allow the use of UMBs (upper memory blocks) allow access to a full megabyte of memory. Further memory is considered 'expanded' or 'extended' according to the way in which it is accessed, and can be allocated or deallocated using the appropriate interface for the type. This is beyond the scope of this document.


Internal Operation and Structures

In keeping track of all the things that it manages, DOS maintains many lists and control structures for various different purposes. DOS also maintains a 'list-of-lists' containing pointers to the locations of these structures in memory, mainly to make them accessible to applications. The format of the list-of-lists has been altered in the past, but is unlikely to change much further due to the incompatibility this would create. Much of the data can be found in the 'DOS data segment', which is also now somewhat confined in format.

The 'System File Tables' (SFTs) contain information about all the presently open files. The SFTs are stored in a chain so that in knowing the address of the first, the address of subsequent tables can be found.

The 'Current Directory Structures' maintain information about the current directory of each logical drive. These structures can be manipulated to create redirection (whereby one drive unit actually references a different drive, or even a subdirectory of another drive), including network redirection. This is how the DOS SUBST command works.

'File Control Blocks' (FCBs) are an obselete method of file access, now replaced with the file handle functions. DOS still supports the FCB functions to maintain compatibility with previous versions, but now all FCB files also have an entry in the SFTs. The FCB functions are really just 'layered over' the handle functions.

'Memory Control Blocks' (MCBs) are headers at the start of each allocated and free memory block, giving information about the size of the block as well as information such as what program 'owns' the block (that is, what application requested the allocation of the block). For Upper Memory Blocks (those beyond the 640KB barrier), the corresponding control blocks are known as 'UMCBs'.

'Program Segment Prefixes' or PSPs are structures containing information local to specific programs. Every running program should have a PSP. When a program exits, the PSP is destroyed and the memory it occupies is freed. The main use of PSPs is to hold a 'local file table' which actually contains indexes into the SFTs.

In most applications, there will be no need to manipulate these structures directly; DOS does everything necessary when requested to do so (for instance, when a file is opened by an application, the application's PSP file table is updated and a new entry (if necessary) is created in the SFTs.


Programs under DOS

There are two main types of programs which can run under DOS: The first, device drivers, have already been mentioned. Device drivers are loaded when DOS starts up. Usually, a command in the CONFIG.SYS file is used to start the drivers. Device drivers have a very specific purpose and need little further discussion.

Then there are application programs (which can also take the form of utilities, games etc). These programs are stored in 'executable files' on a DOS drive. Programs can be loaded in one of two ways: By DOS at boot time (if the program is the 'shell'; the default shell is of course 'COMMAND.COM', the command-line interpreter), or by starting them from within another program (for instance, starting a program by typing its name on the command line).

All DOS programs have their own data information block called a 'Program Segment Prefix' (PSP). The PSP contains information about the currently running program, including the return address to the parent program (or 'parent process': The process which caused the 'child' process to execute), and information about what files the program has opened (in the form of indexes into the system file table). The program references files through an index into its own internal table; these local indexes are also known as 'file handles'.

DOS programs also have an 'environment' (or 'environment table', or 'environment string table') which is a number of named strings of text of any value. Any program inherits an exacr copy of its parent's environment (except of course the shell, which has no parent). The environment variables as they are called are used to keep track of information and provide information that is easily accessible to all programs. Environment variables and their values have no direct meaning to the DOS kernel, but many DOS utilities and programs make use of them - for example, the command interpreter:

Two variables commonly used by many programs are 'TEMP' and 'TMP', which are used to specify a 'temporary directory' into which 'temporary files' (non-permanent files created by programs, usually as a form of virtual memory). Personally I prefer programs using 'TEMP'.

Programs also have access to certain global DOS variables. These are the 'Verify' switch (which when 'on' causes DOS to verify any write operation is performed correctly, by reading the information back from the device and comparing it with what was supposed to be written) and the 'Break' switch (which controls how often checking for Control-C from standard input is performed). DOS also keeps a 'machine name' which is generally used only in networking systems to identify a node of the network.

DOS allows its programs a great deal of freedom. As DOS is a real mode operating system, direct hardware manipulation (using IO ports or BIOS) is possible, though wherever possible, the use of DOS functions is recommended. The use of direct hardware programming and BIOS gives much flexibility to DOS programs.

DOS Executable formats

There are two main types of DOS executables: programs and device drivers. Programs exist as files with a .COM or .EXE extension. Device drivers may have any extension, but are usually given the .SYS extension. They are loaded at startup as specified in the CONFIG.SYS file. MS-DOS 6.0 and later also allows auto-loading of device drivers, but Microsoft appear to have patented this technique.

Some .COM and .EXE files are simply 'memory images'. That is, the file is simply a sequence of bytes to be loaded at any segment address at offset 100h (to allow for the PSP), with execution beginning at (segment):0100h. These programs may never exceed 64KB in size, and are always allocated at least 64KB of memory (they are, in fact, allocated all of the memory block into which they are loaded).

Device driver (.SYS) files are also (generally) memory images, but follow a special format reserved for device drivers. Device driver files may also take the .EXE format, in which case they can be loaded as a normal DOS program as well as a driver (in which case the EXE header is ignored; the driver header should immediately follow it). The device-driver format is beyond the scope of this text.

Program files may take another format which allows programs to have several logical segments (and thus exceed 64KB in size). All such executable files (and I stress that both .COM and .EXE files may take this format) begin with a double byte 'signature' within a variable-size header to indicate that they are in fact segmented. This is the ascii equivalent of 'MZ', the initals of Mark Zbikowski, one of the principal designers of DOS. The header (which must be a multiple of 16 byes in length, and is nearly always set at 512 bytes length - for no real reason) contains a 'relocation table' which is a table of segment pointers within the program which must be 'fixed' at load time to point to the correct physical segment, by adding the actual physical segment at which the program was loaded (the segment immediately after the PSP).

Files in this format may also specify a 'minimum' and 'maximum' amounts of memory to allocate. If 'maximum' is greater than the memory available in the block into which the program is being loaded, all the memory in the block will be allocated. If the minimum required memory cannot be allocated, the program will not be executed. If the maximum is less than the amount available, the program will be loaded so that is at the high end of the memory block.

OffsetContents
0000hSegmented EXE header
0002hFile length remainder
0004hFile length (512 byte pages)
0006hCount of relocation table items
0008hHeader size in paragraphs
000AhMinimum extra memory (paragraphs) to allocate
000ChMaximum extra memory (paragraphs) to allocate
000EhInitial SS (before fixup)
0010hInitial SP
0012hChecksum
0014hInitial IP
0016hInitial CS (before fixup)
0018hRelocation table offset

0004: The file length in 512 byte 'pages' (rounded up). This is not necessarily the actual file length, but specifies the amount to be loaded. The previous word, at offset 0002h, gives the remainder of the file length (again, only the portion that should be loaded).

0008: The header length in 16 byte 'paragraphs'.

0012: File checksum. The negative sum of all words in the file ignoring overflow. (To calculate the checksum, add all the words in the EXE file together - assuming this word at offset 12h to be 0 - then take the low word of the result and make it negative). A value of 0 indicates that the checksum has not been computed. The checksum is not checked by DOS on loading.

0018: Relocation table offset. The offset within the file of the relocation table. The table is usually stored within the header, and contains a series of far pointers (segment:offset, offset stored 'below' segment) which are references to locations within the program which must be fixed up to point to the correct segment adress. This is done by adding the segment address in which the program was actually loaded.

DOS Disk Information

For more information on disk drives and PC bootup, see the BIOS/hardware reference.

DOS hard drives may be 'partitioned' to form several 'logical drives' (which are normally each assigned their own drive letter by DOS). Only one partition at a time can be marked 'bootable'. The partition table information is contained in the master boot record (the true boot record, "MBR") of the drive, which resides on the first logical sector (of the first track or cylinder on the first head). That first sector also contains the MBR code, which determines the bootable partition and loads the boot sector (first logical sector) of that partition, executing it as if it was itself a boot record (loaded at the same location, registers contain the same values). It is possible to install several different operating systems on one computer in this way, especially if the standard MBR code is replaced in order to allow the bootable partition to be seleced at boot time.

There is a limit of four entries in the master partition table. DOS allows these entries to contain pointers to 'extended partition tables', whose format is exactly the same as for the main partition table except there is no boot code (the space normally reserved for the boot code is empty). All the extended partitions should exist within the space reserved by the extended partition entry - only two of the extended partitions are meant to be used, the first as a normal partition, the second as another extended partition (optional).

The DOS boot sector contains as a first instruction a 'jmp' (code 0EBh for DOS 3.x+) to the real code. The boot sector contains various information about the disk, including a BIOS parameter block, as well as some DOS startup code, which loads (part of) IO.SYS or the equivalent and passes control to it. The exact workings may be DOS specific and version specific.

Any sectors before the boot sector of a logical DOS drive are considered to be 'hidden' sectors. The DOS kernel does not interpret hidden sectors (it is up to the disk device drivers, which are usually internal to DOS anyway, to skip 'hidden' sectors). Normal floppy drives have 0 hidden sectors. Hard drive partitions will have a number reflecting their location on the drive. Note that the whole first head of the first cylinder is (usually) reserved for the partition table, even though it is only the first sector which is actually used.

Following the hidden sectors are 'reserved' sectors usually used only for the boot sector. Following this are the File Allocation Tables (FATs). The FATs should all be identical (there are normally two). They contain a map of cluster usage (the data area sectors are grouped into 'clusters'. The number of sectors per cluster does not vary for any particular disk, and depends on the number of sectors - DOS can only map a certain number of clusters; if there are more sectors than the maximum number of clusters, then more than one sector is assigned to each cluster). The FATs also mark bad clusters, and give the order of clusters for a file.

Following the last FAT is the root directory. The root directory is variable size but must be contiguos (and under DOS cannot normally change size once initiated). The root directory contains information about the files and directories branching from the root directory. All further directories are themselves stored as files, in the same format as the root directory.

Interestingly enough, the volume label for a floppy is usually stored within the boot sector, but the volume label for a hard drive is stored as a root directory entry and the space reserved in the boot sector is left blank with spaces. The DOS 'DIR' command returns the one in the directory if present, or the one in the boot sector if not.


Master boot record format

OffsetDescription
0000hCode to load and execute currently bootable partition.
01BEhPartition table entry #1
01CEhPartition table entry #2
01DEhPartition table entry #3
01EEhPartition table entry #4
01FEhBootable sector signature 55h, AAh (55h low)

Partition table entry format

Note that the head, sector and cylinder numbers are those which should be passed to BIOS. Thus, if BIOS is using translation (LARGE mode), the values may not represent the physical CHS values. Also, for large hard drives (> 8GB), the CHS values may be invalid; these values should generally be ignored and the absolute sector values used instead.

OffsetDescription
0000hBoot indicator. 0 - inactive, 80h - bootable
0001hBeginning head
0002hBeginning sector, and 2 msbits of cylinder
0003hBeginning cylinder (8 lsbits)
0004hSystem indicator
0005hEnd head
0006hEnd sector
0007hEnd track
0008hDWORD absolute starting sector
000ChDWORD absolute ending sector

Beginning/ending head/sector/cyinder: In determining the sector/head/track from an absolute sector number, the sector is incremented first (is the least significant portion), then the head, then the track/cylinder (most significant portion). Sector numbers start at 1, head/cylinder numbers start at 0.

Also, the 2 most significant bits of the (10 bit) cylinder number are stored in the 2 most significant bits of the byte at offset 02h/06h. The other bits in this byte form a 6 bit sector number. Thanks to Rick Ondrejicka for pointing out that I had originally missed this :-)

System indicator: 0 = not defined/unknown, 1 = DOS 12-bit FAT, 2-3 = XENIX, 4 = DOS 16 bit FAT with 512 or less bytes/cluster (<32 MB), 5 = Extended DOS partition, 6 = large (bigger than 32MB) DOS partition with 16 bit FAT, >512 bytes/cluster.


DOS Boot Sector

Note that it is possible to determine if the extended information (DOS 4.0+) is available by examining the signature byte at offset 26h.

OffsetDescription
0000hJMP instruction, code 0EBh for DOS 3.x+
0003h(8 bytes) OEM name. Identifier of creator of boot record
000BhWORD bytes per sector
BIOS PARAMETER BLOCK
000DhBYTE Sectors per cluster
000EhWORD Reserved sectors
0010hBYTE Number of FATs
0011hWORD Maximum number of root directory entries
0013hWORD Total number of sectors
0015hBYTE media descriptor
0016hWORD sectors per FAT
(BPB ends)
0018hWORD sectors per track
001AhWORD number of heads
001ChWORD number of hidden sectors (see also next)
EXTENDED BOOT RECORD INFO (DOS 4.0+)
001EhWORD number of hidden sectors (high WORD)
0020hDWORD Total number of sectors
0024hWORD Physical drive number (as passed to BIOS)
0026hBYTE Extended information signature (29h)
0027hDWORD disk serial number
002Bh11 BYTEs volume label (floppys only, see main text)
0036h8 BYTEs file system. FAT12 or FAT16 (padded with spaces)

Bytes per sector: Must be an integer power of 2 (eg, 64, 128, 256). Floppy disks are normally 512 bytes/sector; most fixed disks are also 512 bytes/sector.

Total number of sectors: Excludes hidden sectors. If zero in the BPB, the field in the extended boot record information is used and vice versa.

Media descriptor: Used to give an indication of the media (disk) type. Normal values are 0 for an extended DOS partition, 0F0h for a (18 sector/80 track) 1.44MB 3 1/2 inch floppy, 0F8h for a hard drive, 0FDh for a (9 sector/40 track) 360KB 5 1/4 inch floppy (unverified) or a (9 sector/80 track) 720KB 3 1/2 inch (verified) , 0F9h for a (80 track 15 sector) 1.2MB 5 1/4 inch floppy. '0' seems to be the best way to go for anything else. The media descriptor byte doesn't appear to actually mean very much.


FAT

(Entries are either 12 or 16 bits)

First two entries: Reserved. The first byte of the first entry is also the media descriptor byte.

Further entries: (MAX is 0xffff for 16 bit fats, 0xfff for 12 bit fats)
0if the cluster is unused (free, available)
(MAX-7) to MAXLast cluster in file
(MAX-8)bad cluster
(MAX-15) to (MAX-8)reserved cluster
Anything else:Next cluster in file chain (this is the number of the appropriate entry in the FAT table, so #2 is the first non-reserved cluster)


Directory entry format:

Note that a directory is stored as a contiguos series of directory entries.

Note also that all subdirectories (but not the root directory) contain entries for the '.' (this subdirectory) and '..' (parent directory) directories, as displayed in a normal directory listing.

OffsetDescription
0(11 bytes) file name or (on hard disks) volume label. For file names, the first 8 bytes are the name before the extension (left justified, padded with spaces) and the final 3 bytes are the extension. If the first byte is 0, this entry is invalid and is the last entry. If it is E5h**, the file has been deleted. If it is 5, the first character is actually an 0E5h (but the file has not been deleted).
0BhFile attributes:
bit 0 - read only flag
bit 1 - hidden file flag
bit 2 - system file flag
bit 3 - volume label flag (indicates entry is a volume label)
bit 4 - file is a subdirectory (in same format as directory)
bit 5 - archive bit (file modified since last backup), set by DOS
bit 6 & 7 - reserved
0Ch(10 bytes) reserved
Time and date stamp give time of last file modification
16h(2 bytes) timestamp (bits 0-4 : seconds in two second increments, bits 5-10 : minutes, bits 11-15 : hours [from 0-23])
18h(2 bytes) datestamp (bits 0-4 : day of month, 5-8 : month, 9-15 : years since 1980)
1Ah(2 bytes) First cluster of file (2 = first cluster after root dir). A value of 0 is used in 'parent directory' ('..') entries to indicate that the parent is the root directory.
1Ch(4 bytes) File size in bytes.


Disclaimer:
This is a personal page published by the author (I don't know or remember who he or she is or was...). The ideas and information expressed on it have not been approved or authorised by Monash University either explicitly or impliedly. In no event shall Monash University be liable for any damages whatsoever resulting from any action arising in connection with the use of this information or its publication, including any action for infringement of copyright or defamation.

Guide to

CONFIG.SYS & AUTOEXEC.BAT

version 3.04

Credits: Written and created by Peter H. S. Madsen - well done, Peter - a nice and detailed description of DOS based system basics.

 
During time I have assisted quite a lot of PC owners with the setup of their two system files CONFIG.SYS and AUTOEXEC.BAT.  Often when I stand in line in a computer store (I have seldom seen that there isn't a waiting line), I have experienced that a great many of the problems, the customers complains about, are due to improper setup of these two files.  Therefore I hereby pass on some advice about that subject.

Contents:


[Contents]

Before you begin !

Some of the following is very basic, while some of it is addressed to the experienced PC user.

Before you begin to change the CONFIG.SYS and AUTOEXEC.BAT files, you should do the following:

Format a floppy diskette with the command:  FORMAT A: /U /S
 
Save copies of the original CONFIG.SYS and AUTOEXEC.BAT files
in a separate directory AND on the floppy diskette mentioned above.

This will always give you the possibility of starting the computer by inserting the floppy diskette in drive A:, then rebooting the computer.

If there are problems starting the computer, then as from DOS version 6.00 you can press the F5 key, when the screen displays:  Starting "Windows 9x..."  ("Starting MS-DOS...").  This skips the executing of the CONFIG.SYS and AUTOEXEC.BAT files.  Thereafter you can edit the line in one of these two files where the problem occurred.  If instead the F8 key (plus 4 in Windows 9x) is pressed, then the lines in CONFIG.SYS and AUTOEXEC.BAT will be executed one line at a time.  This helps determining where the problems occurs.


[Contents]

MS-DOS 7.00 / 7.10 (Windows 95 & 98)

Under Windows 9x the following setup of CONFIG.SYS and AUTOEXEC.BAT will be suitable.  This setup also ensures access to CD-ROM drive and soundcard in MS-DOS mode.

Before you begin to make alterations of CONFIG.SYS and AUTOEXEC.BAT, it will be suitable to change the setup, so that Windows 9x will not start automatically, but there instead is started directly in DOS mode.

This is done by making the following changes under [Options] in the file C:\MSDOS.SYS:

to:  BootGUI=1
Logo=1
 
BootGUI=0
Logo=0

Tip (by Tom...): Add (or change) this to file C:\MSDOS.SYS in order to skip the logo and speed up you boot. Instead you'll see the dos commands executed during startup:

to:  [Options]
Logo=0
Bootdelay=0

MSDOS.SYS is a hidden read-only system file, why it is necessary to execute the command:  ATTRIB -H -R -S C:\MSDOS.SYS  before the file can be edited (some editors allows editing without doing this in advance).

NOTE!
It is important to use a texteditor (NOTEPAD.EXE or EDIT.COM) and NOT a wordprocessor (Word or WordPerfect) to edit the file, because a wordprocessor spoils the file with unwanted code!

After this change the computer will start in MS-DOS 7.x, and the Windows 9x Logo (the one with the running colours beneath the picture) will not be shown during startup, making it possible to see how CONFIG.SYS and AUTOEXEC.BAT are executed.

Windows 9x can subsequently be started manually with the command:  WIN

If for instance a DOS game will not run under a standard installation of Windows 9x, this can often be solved by disabling the automatic start of Windows 9x in this way, and then starting the program before loading Windows 9x.

Once CONFIG.SYS and AUTOEXEC.BAT are optimized, the changes in MSDOS.SYS can be reversed, to reestablish the automatic start of Windows 9x and the Logo, if so wanted.  Alternatively the command:  WIN  could just be inserted as the last line in AUTOEXEC.BAT.

The following example applies to a PC with:

MS-DOS 7.00 / 7.10
Windows 4.00.x (95 / 98)
Soundblaster soundcard
CD-ROM drive
Mouse

(installed in C:\WINDOWS & C:\WINDOWS\COMMAND)
(installed in C:\WINDOWS)
(installed in C:\CTSND)
(installed in C:\CDROM)
(installed in C:\MOUSE)

The example are generally applicable, but line 13 and line 24 must be edited, as the drivers for CD-ROM drive and Mouse depends on the manufacturer.

The Lines with * can be omitted.

CONFIG.SYS
  * 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

NUMLOCK=OFF
BREAK=ON
DOS=HIGH,UMB,NOAUTO
FILESHIGH=40
FCBSHIGH=1,0
BUFFERSHIGH=30,0
LASTDRIVEHIGH=J
STACKSHIGH=9,256
COUNTRY=045,865,C:\WINDOWS\COMMAND\COUNTRY.SYS
DEVICE=C:\WINDOWS\HIMEM.SYS /V
DEVICE=C:\WINDOWS\EMM386.EXE RAM /MIN=0 I=B000-B7FF /V
DEVICEHIGH /L:2 =C:\WINDOWS\COMMAND\DISPLAY.SYS CON=(EGA,,1)
DEVICEHIGH /L:2 =C:\CDROM\CDROM.SYS /D:MSCD000
DEVICEHIGH /L:2 =C:\WINDOWS\SETVER.EXE
DEVICEHIGH /L:1 =C:\WINDOWS\IFSHLP.SYS
SHELL=C:\WINDOWS\COMMAND.COM C:\WINDOWS\ /E:1024 /P

 
AUTOEXEC.BAT
* 17
18
19
20
21
22
23
24
* 25
26
27
* 28
29
30
31
32
33
34
* 35

@ECHO OFF
LH /L:2 C:\WINDOWS\COMMAND\MSCDEX /D:MSCD000 /M:15 /E /S /L:D /V
LH /L:0;2 /S C:\WINDOWS\COMMAND\SMARTDRV 2048 16 /V
C:\WINDOWS\COMMAND\MODE CON RATE=32 DELAY=2
C:\WINDOWS\COMMAND\MODE CON CP PREP=((865) C:\WINDOWS\COMMAND\EGA.CPI)
C:\WINDOWS\COMMAND\MODE CON CP SEL=865
LH /L:2 C:\WINDOWS\COMMAND\KEYB DK,865,C:\WINDOWS\COMMAND\KEYBOARD.SYS
LH /L:2 C:\MOUSE\MOUSE
LH /L:2 C:\WINDOWS\COMMAND\DOSKEY /INSERT
PROMPT $p$g
PATH C:\WINDOWS;C:\WINDOWS\COMMAND;C:\CTSND
SET DIRCMD=/P /A
SET TEMP=C:\WINDOWS\TEMP
SET TMP=C:\WINDOWS\TEMP
SET SOUND=C:\CTSND
SET BLASTER=A220 I5 D1 H5 P330 T6
SET MIDI=SYNTH:1 MAP:G
C:\CTSND\DIAGNOSE /S
C:\CTSND\SB16SET /P

  1. Switches off Num Lock on the keyboard.
  2. Extends Control-C / Control Break also to work under I/O operations as for instance reading and writing of the disks.
  3. HIGH loads DOS buffers in HMA (requires a XMS manager, line 10).
    UMB allows the use of Upper Memory Blocks for resident drivers and programs (requires an EMS manager, line 11).  This frees up more conventional memory for your applications.
    NOAUTO makes it possible to load drivers and TSR programs in conventional memory, if wanted - otherwise DOS 7.x always tries to load in Upper Memory, even though DEVICEHIGH, FILESHIGH etc. has not been used.  Some drivers can only work if loaded low with a DEVICE command.
  4. Sets the number of files that can be opened at one time to 40 (suitable for most instances, but some programs insists on a larger number).
  5. Sets the minimal number of file control blocks.  Is only used by very old programs.
  6. Sets buffers to 30.  If the number is smaller there is a risk that it is NOT possible to "Restart the computer in MS-DOS mode" from Windows 95 (OSR2).
  7. Sets the last logical drive-letter to J:
  8. Sets stacks as Microsoft recommends it for Windows 9x.
  9. Sets country to 45 (Denmark), with codepage 865 as the system character set i. e. the character set that is used for sorting and conversion to and from capital letters.  If no number is stated for the codepage, then the system codepage is set to 850 by default (for country 45), even though for instance codepage 865 is chosen in line 22.  Therefore the same codepage should always be stated in line 9 and in line 22 to avoid problems with access to files with names, in which characters from the extended ASCII character set are used (character no. 128 to 255) i.e.  ø and Ø.
  10. Loads the DOS XMS manager.  Necessary for the next line and for Windows 9x and Smartdrive (line 19).
  11. Loads the DOS EMS manager.  RAM indicates that both Expanded Memory (EMS) and Upper Memory (UMB) should be made available.  /MIN=0 states that no minimal amount of EMS memory shall be secured.  I=B000-B7FF indicates that the memory reserved for monochrome screens can be used as Upper Memory.  If EMS memory is not wanted, the parameter RAM can be changed to NOEMS, but from DOS 6.00 an above EMM386.EXE provides both EMS and XMS memory for the programs, so there is no reason not to use the RAM parameter, unless there is a need for more UMB memory and you don't have any programs that demands EMS memory.  Many games requires EMS.
  12. Loads the DOS EGA/VGA driver for use of 1 codepage (character set) on the screen.  In DOS 7.x more memory is used for 2 codepages than for 1 codepage.
  13. Loads the driver for the CD-ROM drive.  Specific for the installed drive.  Your driver might have another name.  What is written after /D: must also be written after /D: in line 18.  Some other parameters might also be necessary i.e. a statement of the controller's address (/SBP:220 or the like), if the drive is connected via the soundcard or a separate controllercard.  If you haven't got a DOS CD-ROM driver, then you might use the SAMPLE.SYS driver located at the Windows 95 installation diskette.  On the Windows 98 installation diskette is placed a larger number of CD-ROM drivers, covering most CD-ROM drives.
  14. Reports an earlier version of DOS (e.g. version 6.22) to older DOS-programs, if they demand to be executed under a definite DOS version.
  15. Loads the driver for Windows 9x's 32-bit file access.
  16. States the name and location of the command interpreter.  /E: states the size of the DOS environment.  1024 is suitable, as DOS 7.x automatically adds 1040 to the size which cannot be less than 256.  /P indicates that the command interpreter shall stay resident and that AUTOEXEC.BAT shall be executed.  /P may NOT be omitted.
     
     
  17. Hides the text in batch programs when the batch file is executed.
  18. Loads the DOS CD-ROM extension for access to the CD-ROM drive.  Requires that a CD-ROM driver (line 13) with the same text after /D: is loaded.  /M:15 states a suitable amount of buffers, and /E states that these buffer shall be loaded into Expanded Memory (requires that an EMS manager is loaded, line 11).  /S indicates that the CD-ROM drive can be shared over a network, but is also necessary for some programs in order to make it possible to read the volume label on the CD-ROM disks.  /L:D indicates that drive-letter D shall be assigned to the CD-ROM drive.  If /L: is omitted, the first free drive-letter is assigned to the CD-ROM drive.
  19. Loads the DOS Smartdrive disk cache for faster reading and writing on the (hard)disks.  When Smartdrive is loaded AFTER MSCDEX (line 18), the cache will also work for the CD-ROM drive.  Requires that a XMS manager is loaded (line 10).  2048 states the amount of memory in Kb that should be used under DOS, and 16 states the amount when running Windows.  The latter is set to the minimum value, because Windows 9x has its own 32-bit disk cache.
  20. Increases the typematic rate and delay for the keyboard.
  21. Prepares Danish/Norwegian (865) codepage (character set) for the screen.  Requires that DISPLAY.SYS is loaded (line 12).  C:\DOS\EGA.CPI can be replaced with the name of another codepage information file, for instance C:\DOS\865.CPI under IBM's PC DOS.
  22. Selects Danish/Norwegian codepage (character set) for the screen.  Requires that line 21 is executed.
  23. Loads the keyboard driver, configurated for a Danish keyboard with support for codepage 865.
  24. Loads the Mouse driver.  Your driver might have another name.  The drivers from Microsoft and IBM uses a lot of memory - try to get another driver if you have one provided by Microsoft or IBM.
  25. Loads DOSKey, which enables fast recalling and editing of the command line at the DOS prompt.  Can be omitted.
  26. Set the DOS prompt to show the current directory followed by the character >.
  27. PATH indicates in which directories and in which order programs shall be searched for, when no path is stated before the program name.  Many programs inserts their own path in this line during program setup, but in the most instances this is not necessary. Try removing the program path and check if the program can work without it.  A long PATH can slow down the start of the programs on the computer.  The PATH line can not contain more then 127 characters.  Furthermore the length of the PATH is limited by the size of the DOS environment (line 16).
  28. Sets the DOS DIR command for pausing, when the screen becomes full, and to display all files including hidden and system files.
  29. States in which directory temporary files can be placed by the applications.  This makes it much easier to find files that are not removed due to program errors.  Quite a lot of megabytes can be saved by deleting the files in this directory from time to time.  Do NOT delete these files, while Windows is running - some of them might be in use.
  30. States in which directory temporary files can be placed by the applications (older programs).
  31. States where the files for the Sound Blaster soundcard are installed.
  32. States that the soundcard is installed at Address 220 with IRQ 5, Low DMA on DMA-channel 1, High DMA on DMA-channel 5, MIDI address 330 and that the soundcard is Type 6 (Sound Blaster 16 compatible).
  33. Indicates how MIDI-files has to be played.  MAP:G makes sure that both basic MIDI and extended MIDI can be played in DOS.
  34. Sets the soundcard to the values in line 32.
  35. Sets the volumelevel for the different channels of the soundcard according to the values saved in the file C:\CTSND\CTMIX.CFG by means of the program C:\CTSND\SB16SET.EXE.  Can be omitted.

/L: indicates in which UMB block the driver/program shall be loaded.

/V indicates that the driver/program shall display extended information on the screen when loading.

If the Upper Memory in the address interval C800 to EFFF is unbroken, it should now, depending on the memory requirements for the CD-ROM and Mouse drivers, be possible to load all drivers and resident programs in Upper Memory, giving approximately 625 Kb free memory (can be checked with the command:  MEM /C).

An unbroken Upper Memory area is among other depending on the computers BIOS, the installed videocard and other plug-in cards installed in the computer.

NOTE!
The order of the lines should not be altered.  The order above provides the best utilization of the Upper Memory.
 
When DOS is finished loading the drivers stated in CONFIG.SYS, it loads the FILES, FCBS, BUFFERS, LASTDRIVE and STACKS.  DOS continues to load these into the same UMB as the last device was loaded into.  This gives a way of controlling where the FILES etc. are loaded.  In the example above, the last device: IFSHLP.SYS is loaded into UMB 1, and therefore FILES etc. are also loaded into UMB 1.  If the values for FILES etc. are set as in the example above, then the available memory in UMB 1 will just barely be used (at least with the Danish versions of Windows 9x).  Thereafter COMMAND.COM will be loaded where there is free memory - in this instance into UMB 2.

If there is not 625 Kb of free memory, the MEMMAKER program can be tried, but this program cannot always improve the memory utilization, and some times it becomes worse.

Also look at the chapter:  More Upper Memory with EMM386.

More commands for use in CONFIG.SYS and AUTOEXEC.BAT can be seen in the chapter:  MS-DOS 6.22 (Windows 3.11).


[Contents]

Windows 95 OSR2 and HIMEM.SYS

If you are using one of the FIRST German or Danish (and probably some other non-US versions) of the OEM Service Release 2 (OSR2) version of Windows 95, there is an ERROR in the IO.SYS system file, which prevents HIMEM.SYS from loading in the HMA area, leading HIMEM.SYS to use 45 Kb of conventional memory instead of 1 Kb.

You can download the IO2PATCH.EXE program here.  This program fixes the problem.  Just put the IO2PATCH.EXE file in the root of your bootup drive (usually C:\), where the IO.SYS system file is placed, execute the IO2PATCH program, and then the problem should be fixed.


[Contents]

DOSSTART.BAT (Windows 95 & 98)

Whenever it is chosen to "Restart the computer in MS-DOS mode" when closing Windows 9x, the file C:\WINDOWS\DOSSTART.BAT is searched for, and the lines herein are executed, if this file exists.

During installation of Windows 9x some lines are often moved from AUTOEXEC.BAT to DOSSTART.BAT, so it is essential to check that none of the drivers and TSR programs loaded from AUTOEXEC.BAT are loaded by DOSSTART.BAT as well.

The CD-ROM extension MSCDEX is one of the programs that Windows 9x often moves to DOSSTART.BAT.  This is done in order for Windows 9x to use its 32-bit driver for the CD-ROM drive, but if access to the CD-ROM drive is wanted before starting Windows 9x (e.g. if automatic start of Windows 9x is disabled, as earlier described), then MSCDEX HAS to be loaded from AUTOEXEC.BAT and therefore should be deleted from the DOSSTART.BAT file.  Windows 9x's 32-bit CD-ROM driver should be a little faster than a 16-bit DOS driver, but some programs cannot run with the 32-bit driver.

However, if it is chosen to load MSCDEX from DOSSTART.BAT, then SMARTDRV should be moved hereto as well, in order to obtain caching of the CD-ROM drive.  Otherwise SMARTDRV would be loaded before MSCDEX, causing the CD-ROM drive not to be cached.  The DOSSTART.BAT file should then look like this:

DOSSTART.BAT
     1
2
3

@ECHO OFF
LH /L:2 C:\WINDOWS\COMMAND\MSCDEX /D:MSCD000 /M:15 /E /S /L:D /V
LH /L:0;2 /S C:\WINDOWS\COMMAND\SMARTDRV 2048 16 /V

and line 18 and line 19 should be deleted from AUTOEXEC.BAT.


[Contents]

WINSTART.BAT (Windows 95 & 98 and Windows 3.11)

Windows looks for the file C:\WINDOWS\WINSTART.BAT before starting.  So, if you for any reason want to run any programs or commands before starting Windows, you can put them into this file.  Unlike DOSSTART.BAT, WINSTART.BAT is also executed by Windows 3.11.


[Contents]

MS-DOS 6.22 (Windows 3.11)

The following example applies to a PC with:

MS-DOS 6.22
Windows 3.11
Soundblaster soundcard
CD-ROM drive
Mouse

(installed in C:\DOS)
(installed in C:\WINDOWS)
(installed in C:\SB16)
(installed in C:\CDROM)
(installed in C:\MOUSE)

but will also work with MS-DOS 6.00 / 6.20 or PC DOS 6.30 / 7.00.

The example are generally applicable, but line 15 and line 26 must be edited, as the drivers for CD-ROM drive and Mouse depends on the manufacturer.

The Lines with * can be omitted.

CONFIG.SYS
* 1
2
3
4
5
6
7
8
9
10
11
* 12
13
14
15
16

NUMLOCK=OFF
BREAK=ON
DOS=HIGH,UMB
FILES=40
FCBS=1,0
BUFFERS=10,0
LASTDRIVE=J
STACKS=9,256
COUNTRY=045,865,C:\DOS\COUNTRY.SYS
DEVICE=C:\DOS\HIMEM.SYS /V
DEVICE=C:\DOS\EMM386.EXE RAM /MIN=0 I=B000-B7FF /V
DEVICEHIGH /L:1 =C:\DOS\ANSI.SYS
DEVICEHIGH /L:1 =C:\DOS\DISPLAY.SYS CON=(EGA,,2)
DEVICEHIGH /L:1 =C:\WINDOWS\IFSHLP.SYS
DEVICEHIGH /L:2 =C:\CDROM\CDROM.SYS /D:MSCD000
SHELL=C:\DOS\COMMAND.COM C:\DOS\ /E:1024 /P

 
AUTOEXEC.BAT
* 17
18
* 19
20
21
22
23
24
* 25
26
* 27
* 28
* 29
30
31
* 32
33
34
35
36
37
38
39
* 40

@ECHO OFF
LH /L:2 C:\DOS\MSCDEX /D:MSCD000 /M:15 /E /S /L:D /V
ECHO.
LH /L:0;2 /S C:\DOS\SMARTDRV 2048 128 /V
C:\DOS\MODE CON RATE=32 DELAY=2
C:\DOS\MODE CON CP PREP=((865 850) C:\DOS\EGA.CPI)
C:\DOS\MODE CON CP SEL=865
LH /L:2 C:\DOS\KEYB DK,865,C:\DOS\KEYBOARD.SYS
ECHO.
LH /L:2 C:\MOUSE\MOUSE
LH /L:1 C:\DOS\DOSKEY /INSERT
ECHO.
LH /L:2 C:\DOS\NLSFUNC C:\DOS\COUNTRY.SYS
PROMPT $_ $e[1;37;41m-|--$e[33;40m  $p$g
PATH C:\DOS;C:\WINDOWS;C:\SB16
SET DIRCMD=/P /A
SET TEMP=C:\TEMP
SET TMP=C:\TEMP
SET TZ=CET-1CDT,3,-1,0,7200,10,-1,0,10800,3600
SET SOUND=C:\SB16
SET BLASTER=A220 I5 D1 H5 P330 T6
SET MIDI=SYNTH:1 MAP:G
C:\SB16\DIAGNOSE /S
C:\SB16\SB16SET /P

  1. Switches off Num Lock on the keyboard.
  2. Extends Control-C / Control Break also to work under I/O operations as for instance reading and writing of the disks.
  3. HIGH loads DOS buffers in HMA (requires a XMS manager, line 10).  UMB allows the use of Upper Memory Blocks for resident drivers and programs (requires an EMS manager, line 11).  This frees up more conventional memory for your applications.
  4. Sets the number of files that can be opened at one time to 40 (suitable for most instances, but some programs insists on a larger number).
  5. Sets the minimal number of file control blocks.  Is only used by very old programs.
  6. Sets buffers to 10, which is appropriate, when Smartdrive (line 20) is used.
  7. Sets the last logical drive-letter to J:
  8. Sets stacks as Microsoft recommends it for Windows 3.11.
  9. Sets country to 45 (Denmark), with codepage 865 as the system character set i. e. the character set that is used for sorting and conversion to and from capital letters.  If no number is stated for the codepage, then the system codepage is set to 850 by default (for country 45), even though for instance codepage 865 is chosen in line 23.  Therefore the same codepage should always be stated in line 9 and in line 23 to avoid problems with access to files with names, in which characters from the extended ASCII character set are used (character no. 128 to 255) i.e.  ø and Ø.
  10. Loads the DOS XMS manager.  Necessary for the next line and for Windows 3.11 and Smartdrive (line 20).
  11. Loads the DOS EMS manager.  RAM indicates that both Expanded Memory (EMS) and Upper Memory (UMB) should be made available.  /MIN=0 states that no minimal amount of EMS memory shall be secured.  I=B000-B7FF indicates that the memory reserved for monochrome screens can be used as Upper Memory.  With Windows 3.11 the use of I=B000-B7FF requires the following line in C:\WINDOWS\SYSTEM.INI:
     
             [386Enh]
             device=c:\dos\monoumb.386
     
    NOTE!  If you don't have the file MONOUMB.386, then I=B000-B7FF can NOT be used, if Windows is to be run.  In that case all instances of /L:2 must be changed to /L:1.  You can download MONOUMB.386 here.
    If EMS memory is not wanted, the parameter RAM can be changed to NOEMS, but from DOS 6.00 an above EMM386.EXE provides both EMS and XMS memory for the programs, so there is no reason not to use the RAM parameter, unless there is a need for more UMB memory and you don't have any programs that demands EMS memory.  Many games requires EMS.
  12. Loads the DOS ANSI driver, which among other makes manipulating of the colours in the DOS prompt (line 30) possible.  Can be substituted with an ANSI driver specific to the installed videocard.  DOS's ANSI.SYS uses a lot of memory.  Can be omitted.  Some older programs requires an ANSI driver.
  13. Loads the DOS EGA/VGA driver for use of up to 2 codepages (character sets) on the screen.  In DOS 6.22 no more memory is used for 2 codepages than for 1 codepage.
  14. Loads the driver for Windows 3.11's 32-bit file access.
  15. Loads the driver for the CD-ROM drive.  Specific for the installed drive.  Your driver might have another name.  What is written after /D: must also be written after /D: in line 18.  Some other parameters might also be necessary i.e. a statement of the controller's address (/SBP:220 or the like), if the drive is connected via the soundcard or a separate controllercard.
  16. States the name and location of the command interpreter.  /E: states the size of the DOS environment.  512 or 1024 is suitable.  If the number is smaller then some programs and batch-files might not run.  /P indicates that the command interpreter shall stay resident and that AUTOEXEC.BAT shall be executed.  /P may NOT be omitted.
     
     
  17. Hides the text in batch programs when the batch file is executed.
  18. Loads the DOS CD-ROM extension for access to the CD-ROM drive.  Requires that a CD-ROM driver (line 15) with the same text after /D: is loaded.  /M:15 states a suitable amount of buffers, and /E states that these buffer shall be loaded into Expanded Memory (requires that an EMS manager is loaded, line 11).  /S indicates that the CD-ROM drive can be shared over a network, but is also necessary for some programs in order to make it possible to read the volume label on the CD-ROM disks.  /L:D indicates that drive-letter D shall be assigned to the CD-ROM drive.  If /L: is omitted, the first free drive-letter is assigned to the CD-ROM drive.
  19. Inserts a blank line (remember the period after ECHO).
  20. Loads the DOS Smartdrive disk cache for faster reading and writing on the (hard)disks.  When Smartdrive is loaded AFTER MSCDEX (line 18), the cache will also work for the CD-ROM drive.  Requires that a XMS manager is loaded (line 10).  2048 states the amount of memory in Kb that should be used under DOS, and 128 states the amount when running Windows.  128 Kb is recommended when 32-bit file access is used, otherwise 2048 will be proper (having 8 Mb RAM or more).
  21. Increases the typematic rate and delay for the keyboard.
  22. Prepares Danish/Norwegian (865) and international (850) codepage (character set) for the screen.  Requires that DISPLAY.SYS is loaded (line 13).  C:\DOS\EGA.CPI can be replaced with the name of another codepage information file, for instance C:\DOS\865.CPI under IBM's PC DOS.
  23. Selects Danish/Norwegian codepage (character set) for the screen.  Requires that line 22 is executed.
  24. Loads the keyboard driver, configurated for a Danish keyboard with support for codepage 865.
  25. Inserts a blank line.
  26. Loads the Mouse driver.  Your driver might have another name.  The drivers from Microsoft and IBM uses a lot of memory - try to get another driver if you have one provided by Microsoft or IBM.
  27. Loads DOSKey, which enables fast recalling and editing of the command line at the DOS prompt.  Can be omitted.
  28. Inserts a blank line.
  29. Loads national language support, which makes it possible to change the codepage with the command:  CHCP.  If C:\DOS\COUNTRY.SYS is not stated, the country information file stated at COUNTRY=   in CONFIG.SYS (line 9) is used.  Can be omitted.
  30. Makes a little fun with the DOS prompt.  Requires that an ANSI driver (line 12) is loaded.  The cross is made by holding down the ALT key and typing 196 and 197 on the numeric keypad at the right side of the keyboard (not all text editors supports this).  Alternatively the prompt can just be set to: $p$g
  31. PATH indicates in which directories and in which order programs shall be searched for, when no path is stated before the program name.  Many programs inserts their own path in this line during program setup, but in the most instances this is not necessary. Try removing the program path and check if the program can work without it.  A long PATH can slow down the start of the programs on the computer.  The PATH line can not contain more then 127 characters.  Furthermore the length of the PATH is limited by the size of the DOS environment (line 16).
  32. Sets the DOS DIR command for pausing, when the screen becomes full, and to display all files including hidden and system files.
  33. States in which directory temporary files can be placed by the applications.  This makes it much easier to find files that are not removed due to program errors.  Quite a lot of megabytes can be saved by deleting the files in this directory from time to time.  Do NOT delete these files, while Windows is running - some of them might be in use.
  34. States in which directory temporary files can be placed by the applications (older programs).
  35. Sets the timezone to GMT-1 (Central European Time), with correction for Daylight Saving Time.  Used by E-mail programs and News readers.
  36. States where the files for the Sound Blaster soundcard are installed.
  37. States that the soundcard is installed at Address 220 with IRQ 5, Low DMA on DMA-channel 1, High DMA on DMA-channel 5, MIDI address 330 and that the soundcard is Type 6 (Sound Blaster 16 compatible).
  38. Indicates how MIDI-files has to be played.  MAP:G makes sure that both basic MIDI and extended MIDI can be played in DOS.
  39. Sets the soundcard to the values in line 37.
  40. Sets the volumelevel for the different channels of the soundcard according to the values saved in the file C:\SB16\CTMIX.CFG by means of the program C:\SB16\SB16SET.EXE.  Can be omitted.

/L: indicates in which UMB block the driver/program shall be loaded.

/V indicates that the driver/program shall display extended information on the screen when loading.

If the Upper Memory in the address interval C800 to EFFF is unbroken, it should now, depending on the memory requirements for the CD-ROM and Mouse drivers, be possible to load all drivers and resident programs in Upper Memory, giving approximately 611 Kb free memory (can be checked with the command:  MEM /C).

An unbroken Upper Memory area is among other depending on the computers BIOS, the installed videocard and other plug-in cards installed in the computer.

NOTE!
The order of the lines should not be altered.  The order above provides the best utilization of the Upper Memory.

If there is not 611 Kb of free memory, the MEMMAKER program can be tried, but this program cannot always improve the memory utilization, and some times it becomes worse.  Especially KEYB.COM can cause problems.

Also look at the chapter:  More Upper Memory with EMM386.


[Contents]

PC DOS 7.00 (IBM)

The setup above will work with IBM's DOS as well.  The resident programs in version 7.00 typically uses a little lesser memory than the ones of MS-DOS 6.22, and IBM's DOS versions are translated to Danish.  The translation is awful in places and even more difficult to understand than the original English, but that goes for the Danish Microsoft MS-DOS version 7.x (Windows 9x) too.

Under PC DOS, the program RAMBOOST can be used for memory optimization, but this program isn't flawless either, and it is furthermore a resident program consuming memory itself.

Note that PC DOS's Smartdrive 5.00 not as standard uses write cache as MS-DOS's Smartdrive does.  To obtain write caching, the drives to be cached has to be stated succeeded by a + (SMARTDRV C+ D+ E+ etc.).

PC DOS's Smartdrive 5.00 indicates that CD-ROM drives are cached.  Tests with CD-Bench 1.07 states that this is not the fact when using PC DOS's MSCDEX.EXE 2.25, whereas CD-ROM drives are cached under PC DOS if MS-DOS's MSCDEX.EXE is used.


[Contents]

Windows 3.11

If a DOS version above DOS 5.00 is used, then the versions of HIMEM.SYS, EMM386.EXE and SMARTDRV.EXE installed by Windows in C:\ should NOT be used.  Use the corresponding files in the DOS directory instead.

It can be suitable or necessary to add the following lines to the SYSTEM.INI file in the Windows directory:

SYSTEM.INI
 
     1
2
3

[386Enh]
device=monoumb.386
SystemROMBreakPoint=FALSE
MaxBPs=768

  1. If the EMM386 Memory Manager is used with the parameter I=B000-BFFF, then the MONOUMB.386 device driver HAS to be used.  MONOUMB.386 can be downloaded here.
  2. If Quarterdeck's QEMM386 Memory Manager is used, then SystemROMBreakPoint HAS to be set to FALSE.
  3. Increases the maximum breakpoints that can be used by the Virtual Memory Manager (VMM) from 200 to 768.  This can improve Windows' performance.

[Contents]

More Upper Memory with EMM386

If there is not enough Upper Memory for all drivers and TSR programs, then line 11 can be extended to:

     DEVICE=C:\DOS\EMM386.EXE RAM I=B000-B7FF HIGHSCAN FRAME=C800 /MIN=0 /V

HIGHSCAN tells the Memory Manger to search the system area (F000-FFFF) for unused memory, and FRAME=C800 places the page frame in the start of Upper Upper Memory Block number 2 (UMB 2), and thereby increases the probability for an unbroken UMB 2 from D000 and up.

Depending on the BIOS this might cause the computer to hang during bootup!  First try removing the FRAME=C800 statement.  This might lead to a third UMB block placed after the page frame.  If this is the case, some of the drivers and/or TSR programs must be loaded into UMB 3 using a DEVICEHIGH /L:3 =  or a  LH /L:3  statement.  If removing the FRAME=C800 statement still causes the computer to hang, then the HIGHSCAN statement must be removed as well.  Then it is not likely that any more Upper Memory can be gained using EMM386

It is possible that the computer works alright in DOS, but that Windows 9x cannot start when HIGHSCAN is used.

If HIGHSCAN cannot be used, then perhaps an alternative Memory Manager can be used instead to obtain more Upper Memory.


[Contents]

Alternative Memory Managers (QEMM386)

If there is a demand for more Upper Memory, an investment can be made in an alternative Memory Manager, as for instance Quarterdecks QEMM386.  This manager can typically give 32 Kb or more extra Upper Memory, an DOS will typically run 20% faster than with the Memory Manager provided by MS-DOS or PC DOS!!!

I use QEMM386 v. 8.03 with MS-DOS 6.22 myself, and my CONFIG.SYS, AUTOEXEC.BAT and DOS-UP.DAT files looks like the following.  Here might be something to obtain for other QEMM386 users.  The setup also shows how to make a startup menu with two configurations - one for running with QEMM386, which starts by default after 2 seconds, and one for running with EMM386:

CONFIG.SYS
[menu]
MENUITEM=qemm,Start med Quarterdeck Memory Manager
MENUITEM=emm,Start med Microsoft Memory Manager
MENUDEFAULT=qemm,2
MENUCOLOR=7,0
 
[common]
NUMLOCK=OFF
BREAK=ON
DOS=HIGH,UMB
FILES=90
FCBS=1,0
BUFFERS=10,0
LASTDRIVE=J
STACKS=9,256
COUNTRY=045,865,C:\DOS\COUNTRY.SYS
 
[qemm]
DEVICE=C:\QEMM\DOSDATA.SYS
DEVICE=C:\QEMM\QEMM386.SYS R:1 RAM
DEVICE=C:\QEMM\DOS-UP.SYS @C:\DOS-UP.DAT
DEVICE=C:\QEMM\LOADHI.SYS /R:2 C:\QEMM\QDPMI.SYS SWAPFILE=DPMI.SWP SWAPSIZE=1024
DEVICE=C:\QEMM\LOADHI.SYS /R:1 C:\VIDEO\EANSI.SYS
DEVICE=C:\QEMM\LOADHI.SYS /R:1 C:\DOS\DISPLAY.SYS CON=(EGA,,2)
DEVICE=C:\QEMM\LOADHI.SYS /R:1 C:\WINDOWS\IFSHLP.SYS
DEVICE=C:\QEMM\LOADHI.SYS /R:2 C:\CDROM\TEAC_CDI.SYS /D:MSCD000
DEVICE=C:\QEMM\LOADHI.SYS /R:2 C:\SB16\DRV\CTSB16.SYS /UNIT=0 /BLASTER=A:220 I:5 D:1 H:5
DEVICE=C:\QEMM\LOADHI.SYS /R:2 C:\SB16\DRV\CTMMSYS.SYS
DEVICE=C:\QEMM\LOADHI.SYS /R:2 C:\DOS\INTERLNK.EXE /AUTO /LPT1 /NOPRINTER
rem DEVICE=C:\QEMM\LOADHI.SYS /R:2 C:\DOS\RAMDRIVE.SYS 32767 /E
SHELL=C:\QEMM\LOADHI.COM /R:2 C:\DOS\COMMAND.COM C:\DOS\ /E:2048 /P
 
[emm]
DEVICE=C:\DOS\HIMEM.SYS /TESTMEM:OFF /V
DEVICE=C:\DOS\EMM386.EXE RAM I=B000-B7FF I=C800-EFFF HIGHSCAN FRAME=C800 /MIN=0 /V
DEVICEHIGH /L:1 =C:\VIDEO\EANSI.SYS
DEVICEHIGH /L:1 =C:\DOS\DISPLAY.SYS CON=(EGA,,2)
DEVICEHIGH /L:1 =C:\WINDOWS\IFSHLP.SYS
DEVICEHIGH /L:1 =C:\CDROM\TEAC_CDI.SYS /D:MSCD000
DEVICEHIGH /L:2 =C:\SB16\DRV\CTSB16.SYS /UNIT=0 /BLASTER=A:220 I:5 D:1 H:5
DEVICEHIGH /L:2 =C:\SB16\DRV\CTMMSYS.SYS
DEVICEHIGH /L:2 =C:\DOS\INTERLNK.EXE /AUTO /LPT1 /NOPRINTER
SHELL=C:\DOS\COMMAND.COM C:\DOS\ /E:2048 /P

 
AUTOEXEC.BAT
@ECHO OFF
ECHO.
C:\DOS\MODE CON RATE=32 DELAY=2
C:\DOS\MODE CON CP PREP=((865 850) C:\DOS\DK.CPI)
C:\DOS\MODE CON CP SEL=865
ECHO.
GOTO %CONFIG%
 
:qemm
C:\QEMM\LOADHI /R:2 C:\DOS\MSCDEX /D:MSCD000 /M:18 /E /S /L:G /V
ECHO.
C:\QEMM\LOADHI /R:2 /LO C:\DOS\SMARTDRV 2048 128 /V
C:\QEMM\LOADHI /R:2 C:\DOS\KEYB DK,865,C:\DOS\KEYBOARD.SYS
ECHO.
C:\QEMM\LOADHI /R:2 C:\MOUSE\MSCMOUSE /1 /A3
C:\QEMM\LOADHI /R:2 C:\DOS\DOSKEY /INSERT
C:\QEMM\LOADHI /R:2 C:\DOS\NLSFUNC C:\DOS\COUNTRY.SYS
ECHO.
GOTO common
 
:emm
LH /L:2 C:\DOS\MSCDEX /D:MSCD000 /M:18 /E /S /L:G /V
ECHO.
LH /L:0;2 /S C:\DOS\SMARTDRV 2048 128 /V
ECHO.
LH /L:2 C:\MOUSE\MSCMOUSE /1 /A3
LH /L:2 C:\DOS\KEYB DK,865,C:\DOS\KEYBOARD.SYS
LH /L:2 C:\DOS\DOSKEY /INSERT
LH /L:2 C:\DOS\NLSFUNC C:\DOS\COUNTRY.SYS
ECHO.
 
:common
PROMPT $_ $e[1;37;41m-|--$e[33;40m  $p$g
PATH C:\DOS;C:\QEMM;D:\WINDOWS;C:\BAT;C:\NORTON;C:\TOOLS;C:\PCTOOLS
SET DIRCMD=/P /A
SET TEMP=E:\TEMP
SET TMP=E:\TEMP
SET SVGA=/g
SET AUTOBASE=/LYD18 /COM2
SET SOUND=C:\SB16
SET BLASTER=A220 I5 D1 H5 P330 T6
SET MIDI=SYNTH:1 MAP:G
SET PCTOOLS=C:\PCTOOLS\DATA
SET TZ=CET-1CDT,3,-1,0,7200,10,-1,0,10800,3600
SET IEPPP=C:\IEXPLORE
SET PCTCP=C:\IEXPLORE\PCTCP.SHV
SET PATH=%PATH%;C:\IEXPLORE
C:\VIDEO\VMODE 640-72
C:\VIDEO\VMODE 800-72
C:\VIDEO\VMODE 1024-70
C:\VIDEO\VMODE 1280-60
C:\SB16\SB16SET /P
C:\NORTON\TM START /N
C:\TOOLS\AUTOTIME /EU
C:\TOOLS\PRINTCP /Q
C:\AUTOBASE\AUTOBASE /HUSK+
CALL C:\BAT\BOOTLOG
CALL C:\BAT\START
CALL C:\BAT\MENU

 
DOS-UP.DAT
DOSDATA=1
FILES=1
FCBS=1
LASTDRIV=1
INSTALL=1
STACKS=1
WKBUFFER=1
IFS=1

 
 
In this file it is stated in which UMB, FILES,BUFFERS etc.
shall be loaded.  This gives an opportunity of manually filling
up small unused UMB areas.
 
 
IFS=  only works with MS-DOS 7.00

This results in 632 Kb free memory with QEMM386 and 607 Kb free memory with EMM386.

Furthermore there is now room in Upper Memory for the two drivers C:\SB16\DRV\CTSB16.SYS and C:\SB16\DRV\CTMMSYS.SYS, which makes it possible to playback WAV, MID, CMF and VOC soundfiles under DOS, using the program C:\SB16\PLAY.EXE.  These drivers are provided with the Sound Blaster 16 soundcard.

If there is not enough Upper Memory for all drivers and resident programs, the line:  DEVICE=C:\QEMM\QEMM386.SYS R:1 RAM  can be expanded with the parameter:  ST:F (safest) or ST:M  (this should be tested with the Quarterdeck OPTIMIZE program).

If DoubleSpace, DriveSpace or Stacker disk compression is used, then the parameter:  DBF=2  HAS to be added to the line mentioned above.

If there is not 632 Kb of free memory with QEMM386, the OPTIMIZE program can be tried, but this program cannot always improve the memory utilization, and some times it becomes worse.  Especially KEYB.COM can cause problems.

If the computer hangs under startup after an apparently successful OPTIMIZE, it might be because OPTIMIZE has added squeezing to the LOADHI procedure for some of the programs.  Boot again and press F5.  Then run the following command:  C:\QEMM\OPTIMIZE /NOSQT /NOSQF.  This starts OPTIMIZE with Temporary- and Frame squeezing turned off.

If version 7.x of Quarterdeck is used, it can not be recommended to use DEVICE=C:\QEMM\DOSDATA.SYS, because there will be SO MUCH free memory, that some programs (Windows, among others) refuses to start.  In most instances you can circumvent this by starting the programs with the MS-DOS LOADFIX program.  Version 8.x of Quartedeck seems to take hand of the problem by itself.


[Contents]

Stacker disk compression

If Stacker version 3.x or 4.x is used, the following can be entered into CONFIG.SYS, AUTOEXEC.BAT and STACKER.INI.  Stacker is presumed installed in C:\STACKER, and there is two physical harddisks (C: and D:).

CONFIG.SYS
.
.
DEVICE=C:\QEMM\QEMM386.SYS R:1 RAM DBF=2 ST:F
DEVICE=C:\QEMM\DOS-UP.SYS @C:\QEMM\DOS-UP.DAT
DEVICE=C:\QEMM\LOADHI.SYS /R:2 C:\STACKER\STACHIGH.SYS
.
.

ST:F for more UMB.
 
Loads Stacker in UMB.

 
AUTOEXEC.BAT
.
.
C:\QEMM\LOADHI /R:2 /LO C:\DOS\SMARTDRV 2048 128 /V
C:\STACKER\CHECK /WP
.
.

 
Checks the Stacker drives.

 
STACKER.INI
/DIR=C:\STACKER\
/P=1
/EMS
/-AUTO
/Q-
C:\STACVOL.DSK,SW
D:\STACVOL.DSK,SW

States in which directory Stacker is installed.
Sets the compression to minimum (fastest).
Loads the Stacker buffers in EMS (64 Kb).
Turns off automatic stacking of floppy-drives.
Turns on displaying the loading of the Stacker drives.
States the name of the 1.st Stacker file and swaps drive C: and E:
States the name of the 2.nd Stacker file and swaps drive D: and F:

The Quarterdeck parameter:  DBF=2 HAS to be used with Stacker.

It is best to use Stacker with minimum compression, and then at regular intervals run a full optimization with maximal compression by means of the command:  C:\STACKER\SDEFRAG /R /SU.  This may last up to 1 hour for a Stacker file of 512 Mb.

With Stacker 4.x the DEVICE=C:\STACKER\DPMS.EXE statement can be used in CONFIG.SYS to create DPMS memory, in which Stacker can be loaded, but this might cause problems with other programs as for instance PKZIP or QEMM386 with Stealth (ST:F / ST:M).  DPMS can also NOT be used if 32-bit file access to the compressed drives is wanted under Windows.  So if EMS memory is available, it is better to use this, than to use DPMS memory.


[Contents]

Harddisk partitioning

If you do not want to compress your harddisk, you can often obtain more space by partitioning the disk by means of the program FDISK.EXE.  This reduces the amount of space wasted by each of the files on the disk.

The amount of wasted space is among other things dependent on the size of the disk, as the waste is bigger on large disks, because DOS has to use larger clusters (allocation units) on large disks than on small disks.

One file always takes up a whole number of clusters, and therefore a file of just 1 byte will use 16.384 bytes = 1 cluster on a harddisk of 1023 Mb and 32.768 bytes on a harddisk bigger than 1023 Mb!  The average waste of space on a harddisk bigger than 1023 Mb will be 40% !!, while the waste on a harddisk between 512 and 1023 Mb will be 20%, and on a harddisk of 511 Mb it will only be about 10%.  Smaller files typically results in more waste of space, as do large numbers of directories and subdirectories, because these also occupy 1 cluster each.

If you have 2 harddisks, both partitioned to 2 drives, then the first harddisk (harddisk 0) will contain the logical drives C: and E:, while the other harddisk (harddisk 1) will contain the logical drives D: and F: after the partitioning.  During the partitioning it is important to remember to set the primary partition on disk 0 to be the active partition, otherwise drive C: will not be bootable

NOTE!
By using FDISK all data on the harddisk are lost, so before using FDISK all data has to be BACKED UP, ready for reinstalling afterwards.
 
After running FDISK the drives has to be formatted again.  Drive C: is formatted with the command:  A:\FORMAT C: /U /S  while the other drives are formatted with the command:  A:\FORMAT drive: /U
 
Don't forget to make a bootable diskette before the partitioning by means of the command:  FORMAT A: /U /S  and to copy the files FDISK.EXE and FORMAT.COM to this diskette.  Other files that should be copied to the boot diskette are:  SYS.COM, CHKDSK.EXE, KEYB.COM, KEYBOARD.SYS, ATTRIB.EXE and MEM.EXE.

Commercial- and shareware-programs that can make disk partitioning without loss of data are available, for example PowerQuest's PartitionMagic.


[Contents]

Windows 95 OSR2 and FAT32

The OEM Service Release 2 (OSR2) version of Windows 95 uses FAT32 instead of the previously used FAT16 file system.  FAT32 uses smaller clusters (typically 4.096 bytes) and supports harddisk partitions of a size up to 2 Terrabytes (2048 Gb), whereas FAT16 only could handle harddisk partitions with sizes up to 2 Gb.

Because of the smaller clustersize used by FAT32, there is no longer the same need for harddisk partitioning in order of reducing the amount of wasted disk space.  However, if you have a large harddisk (4 Gb or more), harddisk partitioning can still give you a better overview of your folders and files.

OEM stands for: "Original Equipment Manufacturer", which means that the OSR2 version of Windows 95 can only be purchased in conjunction with buying a new computer (or sometimes when buying a new harddisk).

NOTE!
You can NOT just update an existing Windows 95 with the OSR2 version.  Because of FAT32 the harddisk has to be partitioned and formatted again, and Windows 95 and all your applications has to be reinstalled.

With Windows 98 it is possible to convert a FAT16 partition to FAT32.