Three files make up the core of DOS: IO.SYS, MSDOS.SYS (which are hidden system files), and COMMAND.COM (which is a visible file). All three of these files are located on the primary active boot partition and are stored at the root of drive C:. All three files are required to successfully boot a system into DOS. They are also the minimum files required for booting Windows 9x to a DOS prompt. If one of these files is corrupt or missing, the message “Missing or unknown operating system” will be displayed.
Although these three system files meet the minimum requirements to boot to DOS on a Windows 9x OS, the complete DOS boot order is as follows.
IO.SYS—Interacts with the BIOS to determine the hardware environment.
MSDOS.SYS—Houses the DOS kernel and interacts with programs and devices.
CONFIG.SYS—Used primarily to load device drivers.
COMMAND.COM—Translator or interpreter of commands entered.
AUTOEXEC.BAT—Used to configure specific user settings.
Note | The exam may ask for the overall system starting order, regardless of what operating system you are running. The overall system start order is POST, BIOS, Boot Sector, and GUI. See The Windows 9x Start-Up Process in Chapter 24 for further details. |
The major functions of the DOS system and configurations files, as well as their relationships with newer operating systems, are explained next.
IO.SYS is a binary (uneditable) executable hidden file that is loaded first when a computer system is booted. IO.SYS works with the systems BIOS to determine what hardware is to be used by the operating system. IO.SYS is like a scout that discovers the physical layout of a system by looking at the CONFIG.SYS file, which is used to load hardware drivers and control DOS memory. Keep in mind that Windows 9x comes with a newer version of IO.SYS that replaces the old IO.SYS and MSDOS.SYS utilized in ‘pure DOS.’ The new version of IO.SYS eliminates the need for use of the AUTOEXEC.BAT and CONFIG.SYS files in newer opera-ting systems. Newer operating systems still allow the use of AUTOEXEC.BAT and CONFIG.SYS to maintain backward compatibility with legacy programs and hardware.
Note | Binary files consist of 0s and 1s, and are basically unreadable without being interpreted. Text files contain readable characters that can be understood by the average human being. |
MSDOS.SYS is a hidden system text file that contains the DOS kernel. The kernel is the core software code of an OS that is retained in memory to control all processes.
Note | The kernel that resides in the MSDOS.SYS file and the kernel used in newer operating systems are two totally separate things. |
MSDOS.SYS is loaded after IO.SYS and is responsible for the interaction of software applications and hardware settings. MSDOS.SYS controls whether the computer will be booted into a DOS, Windows 3x, Windows 9x, or Windows Me GUI environment. If you want to set up Windows 9x or Windows Me for dual booting purposes, you can modify the BootGUI=0 to BootGUI=1 entry under [Options] in the MSDOS.SYS file.
Note | The BOOT.INI file is modified in Windows NT 4.0, Windows 2000, and Windows XP for dual booting purposes. |
The CONFIG.SYS file is the first editable DOS configuration text file that you can modify at system start-up. Its primary function is to load 16-bit real mode device and memory management drivers for a DOS environment. At system start-up, MSDOS.SYS loads the device drivers and instructions specified in the CONFIG.SYS file before continuing on to AUTOEXEC.BAT.
In DOS, typing “EDIT CONFIG.SYS” or “EDIT AUTOEXEC.BAT” and pressing Enter at the DOS command prompt opens the DOS utility editor known as EDIT.COM. You can use EDIT.COM to view and make changes to the CONFIG.SYS and AUTOEXEC.BAT files. This can be very useful for troubleshooting if you encounter errors on start-up with settings in either of these files.
The CONFIG.SYS is available in Windows 9x and Windows Me for backward compatibility with legacy devices. It can be edited by running the SYSEDIT program at the Start > Run line in Windows 9x. Simply click Start > Run, then type in “SYSEDIT”, and press Enter. Windows NT 4.0, Windows 2000, and Windows XP have basically replaced the CONFIG.SYS file with the file CONFIG.NT. You can also edit either of these files by using any available text editor in Windows, such as Notepad.
Next, we look at a typical CONFIG.SYS file that is used to configure hardware- and memory-related settings for a DOS Windows environment. Each of the lines in the following CONFIG.SYS file are described.
DEVICE=C:\WINDOWS\HIMEM.SYS DEVICE=C:\WINDOWS\EMM386.EXE NOEMS DEVICE=C:\DOS\SETVER.EXE FILES=40 STACKS=9,256 BUFFERS=10 FCBS=16,0 DOS=HIGH,UMB SHELL=C:\DOS\COMMAND.COM C:\DOS /P /E:1024 DEVICE=C:\WINDOWS\IFSHLP.SYS DEVICEHIGH=C:\WINDOWS\COMMAND\ANSI.SYS DEVICEHIGH=C:\MTMCDAI.SYS /D:MSCD0001 LASTDRIVE=Z
DEVICE=C:\WINDOWS\HIMEM.SYS: HIMEM.SYS is a memory device driver that allows device drivers to be loaded into the upper memory area. It is necessary for a Windows 3x operating system load.
DEVICE=C:\WINDOWS\EMM386.EXE NOEMS: This loads the EMM386 memory manager that manages the extended memory area.
DEVICE=C:\DOS\SETVER.EXE: This line loads the SETVER program that is used to instruct whichever DOS program is being run to recognize the MS-DOS version table that is currently loaded into system memory.
FILES=40: This sets the number of files that can be opened by DOS at one time. In this case, DOS can open or access 40 files.
STACKS=9,256: STACKS is a rarely used line-handled access to hardware interrupts. It was sometimes necessary to increase or decrease the STACKS value when receiving “Stack overflow” or “Internal stack failure” error messages.
BUFFERS=10: This line allows disk buffers to be loaded into memory for Windows to utilize.
FCBS=16,0: The number of File Control Blocks (FCB) that windows can have open and share at any one time is specified. FCBS can be set from 1 to 255. Today’s programs rarely require the use of FCBS.
DOS=HIGH,UMB: This line should always be placed after the HIMEM.SYS line. It is used to load DOS into the upper memory block in the high memory area.
SHELL=C:\DOS\COMMAND.COM C:\DOS /P /E:1024: The SHELL command specifies the location and particular command interpreter that you wish DOS to use. In this case, the SHELL command is telling the system to use the COMMAND.COM interpreter that is located in the C:\DOS directory.
DEVICE=C:\WINDOWS\IFSHLP.SYS: Otherwise known as the Installable File System (IFS) manager, this is a driver that assists with the integration of 32-bit APIs.
DEVICEHIGH=C:\WINDOWS\COMMAND\ANSI.SYS: ANSI.SYS is a driver that configures color, cursor, and keystroke settings in a DOS environment.
DEVICEHIGH=C:\MTMCDAI.SYS /D:MSCD0001: This line is used to load the real mode CD-ROM driver that will be used for the operating system. The CD-ROM driver in this statement must match the CD-ROM driver specified in AUTOEXEC.BAT.
LASTDRIVE=Z: The LASTDRIVE statement is used to specify the last drive letter that can be addressed by the system. If you are using this command, the letter assignment must be equal to at least the number of drives in your system. For example, if you have A, B, C, and D drives, the minimum setting for the LASTDRIVE= statement would be LASTDRIVE=D.
As previously mentioned in this chapter, COMMAND.COM is responsible for translating what you input into the computer into information that the OS can understand. COMMAND.COM processes information entered and passes it back to MSDOS.SYS, where the operating system’s kernel resides.
In DOS, COMMAND.COM is responsible for providing a user interface, such as the DOSSHELL or command prompt. With a default installation of DOS, Windows 3x, Windows 9x, or Windows Me, COMMAND.COM is stored in the root directory of the C: drive. Windows 9x and Windows Me also store a backup copy of COMMAND.COM in the C:\Windows directory. The AUTOEXEC.BAT file uses the SET COMSPEC= command to place COMMAND.COM in a location other than the root directory of C:. With Windows NT, Windows 2000, and Windows XP, COMMAND.COM is stored in the C:\WINNT\SYSTEM32 directory.
It is important to note that the DOS COMMAND.COM file should be from the same version of DOS installation as the IO.SYS and MSDOS.SYS files. If it is not, you may receive the error message “Incorrect DOS version” at system start-up.
The AUTOEXEC.BAT (automatically executed batch) file is the second editable DOS batch file that is used at start-up to create an environment for the operating system. The AUTOEXEC.BAT file sets the stage for programs to run. It holds Terminate and Stay Resident (TSR) programs, such as DOSKEY and MOUSE.COM, which are held in RAM, and can be quickly accessed and easily loaded by the system. The AUTOEXEC.BAT sets environment variables with the PATH= statement, which is used to tell the system where to look for files and executable programs. The AUTOEXEC.BAT file is the last program that is run in the DOS boot sequence. It is important to remember that any command that is in the AUTOEXEC.BAT file can be run from the command prompt.
Now we will look at a typical AUTOEXEC.BAT file that is used to configure user-related and environment settings for a DOS Windows environment.
Each of the lines in the following AUTOEXEC.BAT file is described following the file listing.
@ECHO OFF SET COMSPEC=C:\DOS\COMMAND.COM SET TEMP=C:\TEMP PROMPT $P$G PATH=C:\;C:\WINDOWS;C:\DOS REM LH C:\WINDOWS\COMMAND\MSCDEX.EXE /D:MSCD0001 DOSKEY CLS LH C:\MOUSE\MOUSE.EXE WIN
@ECHO OFF: This line instructs DOS to turn ECHO off, which disables the display of DOS batch file messages on the screen when a batch file is executed.
SET COMSPEC=C:\DOS\COMMAND.COM: The SET command is used to specify or set environmental variables each time the AUTOEXEC.BAT is run. This SET statement sets a variable for the command interpreter.
SET TEMP=C:\TEMP: This statement sets a variable for the location of temporary files.
PROMPT $P$G: This line configures how the DOS prompt will display on screen. For example, $P$G displays C:\. You can change the prompt line to display the date, time, and DOS version, to name a just few possibilities.
PATH=C:\;C:\WINDOWS;C:\DOS: Please remember for the exam that the PATH= statement, or ‘line,’ is located in the AUTOEXEC.BAT file. This statement sets an environment variable that simply finds the location of a program. For example, if you are in the C:\Windows directory and want to run a program that is located in another directory, such as C:\DOS, that program can be executed from the C:\Windows directory as long as the C:\DOS directory is specified in the AUTOEXEC.BAT. You can tell the system where to look for a program on the fly by simply typing “PATH=(name of directory where file is located)” at a DOS prompt and pressing Enter.
REM LH C:\WINDOWS\COMMAND\MSCDEX.EXE /D:MSCD0001: Notice the REM statement at the beginning of this line; REM means remark. Any statements contained in the AUTOEXEC.BAT or CONFIG.SYS files that begin with the REM statement will not be processed when the file is loaded at system start-up. The statement that is being remarked out here contains the file MSCDEX.EXE. This file contains the driver necessary for DOS and Windows 3x to recognize and run a CD-ROM device. Remember for the test that Windows 9x has replaced the 16-bit MSCDEX.EXE with the 32-bit CD-ROM File System (CDFS).
DOSKEY: DOSKEY is a TSR program used to remember commands that you have entered at the DOS command line. It keeps a history of what you have entered. If DOSKEY is loaded into memory, you can use the up arrow or down arrow keys on your keyboard to scroll through recently entered commands.
CLS: This is a DOS command used to clear the screen. Only the DOS command prompt is left on the screen after the CLS command has been entered.
LH C:\MOUSE\MOUSE.EXE: This line loads the mouse executable program into upper memory, which will make more conventional memory available for other programs to run. Remember Chapter 17 and memory utilization? For the test, remember that LH statements are used in the AUTOEXEC.BAT file. DEVICEHIGH statements are used in the CONFIG.SYS file.
WIN: This command calls on the file WIN.COM. WIN.COM is used to configure the system automatically to boot directly into the Windows 3x GUI. If the WIN statement is not in AUTOEXEC.BAT, the system will boot to a DOS prompt. Four switches can be added to the WIN command; each switch starts Windows 3x in a different mode. The four switches used with the WIN command are /R, which starts Windows 3x in Real Mode; /S, which starts the OS in Standard Mode; /3, which starts Windows 3x in Enhanced Mode; and /B, which is used to keep a log file of Windows 3x start-up problems.
Note | WIN.COM is built into Windows 9x. |