Lesson 2: MS-DOS

[Previous] [Next]

Lesson 1 presented the basics of operating systems—what they are and what they do. It also provided a summary of two important operating systems: MS-DOS and Windows 3.1. This lesson takes us one step further. By knowing how to configure an operating system, a computer technician can gain optimal performance from a machine. This lesson covers configuration of the MS-DOS operating system. It is not intended to be a complete course in MS-DOS; however, some important techniques useful to the computer professional are pointed out. Gaining an understanding of MS-DOS and being able to use an MS-DOS manual as a reference are requirements for the computer professional. Learning MS-DOS requires perseverance and hands-on experience.

NOTE
Many book and computer/software stores offer books that describe the various software operating systems. A reference book for each operating system is a necessary component of the computer professional's technical library.

After this lesson, you will be able to:

  • Use basic MS-DOS commands to increase the performance of a computer.
  • Optimize the MS-DOS CONFIG.SYS and AUTOEXEC.BAT files.
  • Optimize conventional memory in a MS-DOS machine.
Estimated lesson time: 45 minutes

The Boot Process

In computer terms, boot up means to start or get going. In Chapter 6, we discussed POST (power-on self test). Once POST is complete (the basic hardware is determined to be OK), the computer loads software that tells it how to run. This software is the operating system (OS). The boot sequence for operating systems will vary. Several steps are involved in the MS-DOS system startup process:

  1. The ROM BIOS looks for an operating system. It checks for the presence of IO.SYS and MSDOS.SYS, first searching the A (floppy disk) drive and then the C drive.
  2. The operating system processes the CONFIG.SYS file (if present). The CONFIG.SYS contains information to configure the system environment including special memory management overlays and hardware drivers.
  3. COMMAND.COM is loaded.
  4. The operating system processes the AUTOEXEC.BAT file (if present). The AUTOEXEC.BAT loads programs and user-defined settings.
  5. If no programs (such as Windows) have been invoked, COMMAND.COM presents the active-drive prompt and waits for a command.

The process of starting from a no-power condition is called a cold boot. Occasionally, a system might require a reset—for instance, when the computer locks up or runs out of memory. Resetting can be accomplished without turning off the computer by holding down the CTRL, ALT, and DEL keys at the same time. This is called a warm boot.

MS-DOS Terms and Commands

MS-DOS, like UNIX, uses a command-line or text-based user interface. This means that the user must memorize and type commands in order to interface with the operating system. Not exactly a user-friendly operating system, which is why Windows has come to dominate the market. Even today, the computer professional should know how to use and navigate in the MS-DOS environment. When Windows fails, using MS-DOS is often the best way to access any recoverable data and begin the repair process.

Key MS-DOS Terms

As with any operating system, it is important to understand the language or terms used. As mentioned, this is not a complete course in MS-DOS and there is no substitute for an MS-DOS manual. The following table presents some of the important terms and concepts you might encounter when working with MS-DOS.

Term Description
.bat An extension that indicates a batch file.
.com An extension used to identify a file as an executable program file.
.exe An extension used to identify a file as an executable program file.
Backslash (\) A symbol used to separate each directory level, for instance C:\Windows\Utilities. For this reason, it is a reserved character and cannot be used as part of a file name.
Case sensitivity The ability of the operating system to distinguish between uppercase and lowercase letters. MS-DOS commands are not case-sensitive. Traditionally, MS-DOS commands have been represented in documentation as uppercase. While you can type MS-DOS commands in either upper- or lowercase, we are representing them in this book as uppercase.
Cursor Anytime you are entering data, whether in an application or in an MS-DOS command, the cursor (usually a small flashing line) indicates the place where the next character will be inserted. It is a good idea to always know where your cursor is.
Default drive Each drive in a computer has its own letter designation. The default drive is the active drive. Unless otherwise specified, any commands act upon the default drive. The current default drive is indicated by the MS-DOS prompt. For example, if you want to see a directory (the command is DIR) of files on the A drive and the default drive is C, you need to type DIR A: otherwise you will see a directory of the C drive.
Directory Directories—known as folders in the Windows and Macintosh environments—are locations for storing files. Every disk contains a main directory known as the root directory. Below the root directory is a hierarchical structure of other (sub)directories.
MS-DOS prompt The MS-DOS prompt usually displays the active drive letter (for instance, C:) and directory. This indicates that the operating system is ready to accept the next command. (The prompt is user-changeable.)
Drive pointers MS-DOS assigns letters to each drive during the boot process.
Entering Commands You can type a command and press ENTER to execute it. If you make a mistake, correct it by using the BACKSPACE or DEL keys. Use ESC to start a command again. Use the F3 key to repeat a command.
Error messages Brief technical messages that are displayed when an error occurs.
Filenames (also filespecs) A filename is made up of three parts—a name of up to eight characters, a period, and an extension of up to three characters. The name can include any number, character, or the following symbols: _()~'!%$&#. Spaces cannot be used in MS-DOS filenames. Example: MYFILE.DOC
Greater than (>) This symbol is used to indicate that a command can be redirected to an output device. For example, to redirect the directory command to a printer, type: DIR > LPT1.
Path The address to a file. The path consists of the drive name, the location of the file in the directory structure, and the filename. Example: C:\Mystuff\Myfile.doc.
Prompt The command prompt—user interface provided by COMMAND.COM to signal to the user that the computer is ready to receive input (for example: C:\> or A:\>).
Switches Many MS-DOS commands can be used with a switch ("/" followed by a letter) to invoke special functions. Because no comprehensive manuals are available after MS-DOS 5, when you follow a command with a space and "/?", a list of parameters and switches available for that command is displayed.
Syntax Syntax is the arrangement and interrelationship of words in phrases and sentences. In computer jargon, it is the correct format in which to type a command. In MS-DOS, every letter, number, and space has a value. The most common problem when typing MS-DOS commands is adding or leaving out a letter or character. Simple typing mistakes are the most common cause for "Bad command or filename" errors.
Wildcards The question mark (?) matches any character in a specified position, and the asterisk (*) matches any number of characters up to the end of the filename or extension. For example, to search for files beginning with the letter "A," the command would be DIR A*.* or A?????.* (the second command would find a file that starts with the letter A and any other five characters).

MS-DOS Commands

MS-DOS commands are found in two varieties and locations. The internal MS-DOS commands are stored within the COMMAND.COM file and are always available. These provide key commands needed to access files and manage the operating system. The external MS-DOS commands are larger utilities stored as .COM or .EXE files in the MS-DOS directory. External MS-DOS commands must be on the current drive, some other drive whose location is stored in the PATH variable (that is, they can be in any directory as long the directory name and location is included in the path statement in the AUTOEXEC.BAT file), or be named with the complete path to the executable file to be run. The following table lists examples of commonly used internal MS-DOS commands.

Command Function
CHDIR or CD Changes the directory. (For example, cd\word would take you to the "word" subdirectory.)
CHKDSK Examines the FAT (file allocation table) and directory structure on a drive, checking for errors and inconsistencies that can keep you from accessing a file. It also locates lost clusters and can convert them into files for later deletion. It can also reclaim wasted space.
CLS Clears the screen.
COPY Copies files or disks. To copy all files from the "myfiles" subdirectory to the A (floppy) drive, the command would be: copy c:\myfiles\*.* a:
DATE Changes the system date.
DEL Deletes files. (Example: c:\del myfile.txt).
DIR Lists a directory of files.
DIR /P Views directories, one page at a time. (Directories can be quite long.)
DIR /W Displays wide format in columns—only the filename is listed; not size, date, or time.
DIR /W /P Displays large directories in columns, one page at a time.
DISKCOMP Compares two disks. The syntax is: a:\ diskcomp a: b: or diskcomp a: a: (the computer will prompt you to insert the second disk to be compared).
MKDIR or MD Makes a directory.
PROMPT Changes the appearance of the cursor.
REN Renames a file.
RMDIR or RD Deletes a directory. This works only if the directory is empty of all files including hidden ones.
TIME Changes the system time.
TYPE Displays (types) a text file.
VER Displays the version of MS-DOS in use.

The following table lists examples of commonly used external MS-DOS commands.

Command Function
DISKCOPY Makes a copy of a complete disk. Requires that both the source and the destination disk have the same format.
EDIT This command invokes the text editor program. This program is useful for making changes to text files such as editing CONFIG.SYS and AUTOEXEC.BAT.
FORMAT Prepares a disk for receiving files. Places a root directory on the disk.
FORMAT /S Formats a disk as a system disk.
UNDELETE Will (sometimes) recover a deleted file. Works only if the disk has not been modified since the file was deleted.
XCOPY Copies the contents of one disk to another disk. Does not require both disks to have the same format. (Note that it will not copy hidden files unless you use the /h switch.)

Getting Help in MS-DOS

The later versions of MS-DOS (4.0 and newer) provide some online help. There are two ways to access this information. You can type the word "help" followed by a space and the command, or type the command with the /? switch. In either case, you will get information regarding the proper syntax and available options for the command.

Optimizing MS-DOS

Understanding how to configure and optimize an MS-DOS computer might seem like a waste of time in view of the newer operating systems available like Windows 95, Windows 98, Windows NT, and Windows 2000; however, one must remember that MS-DOS is the basic building block of the operating environment for the vast majority of IBM-compatible computers. All IBM-compatible computers today have evolved from this standard. The limitations imposed by MS-DOS and the need to provide backward compatibility have a lot to do with how today's computers operate.

Configuring MS-DOS

As mentioned in Lesson 1, the job of configuring how MS-DOS runs on a specific computer is done by modifying the CONFIG.SYS and AUTOEXEC.BAT files. During the boot process, MS-DOS looks for these files and executes any commands or loads any drivers properly called for within them. The CONFIG.SYS file is run first and sets up and configures the computer's hardware components. The AUTOEXEC.BAT file executes commands and loads TSR programs.

NOTE
TSRs are used for a wide variety of tasks in MS-DOS and almost always realign the memory stack. This can quickly lead to problems with the operating environment if they do not behave well, escalating exponentially with each additional TSR. If you run into strange problems, the first place to look is in the TSR used on the system.

If problems are encountered during startup, the CONFIG.SYS and AUTOEXEC.BAT files can be bypassed by pressing F5 as soon as the message "Starting MS-DOS" appears on the screen. Alternatively, pressing F8 will allow processing the files one command at a time (with the option to bypass specific commands), making troubleshooting possible. If you bypass a command and the computer boots, you have isolated the problem.

CONFIG.SYS Commands

The following table lists several CONFIG.SYS settings and their functions.

Setting Function
BUFFERS Allocates reserved memory for transferring information to and from the hard disk.
COUNTRY Enables MS-DOS to use country conventions for times, dates, and currency. Example: COUNTRY=044,437,C:\DOS\COUNTRY.SYS (You do not need to use this in the United States unless you wish to use an alternate convention.)
DEVICE Loads a device driver into memory. DEVICE=C:\DOS\EMM386.EXE
DEVICEHIGH Loads a device driver into upper memory.
MS-DOS Loads part of MS-DOS into upper memory area. DOS=HIGH, UMB
FCBS Specifies the number of file control blocks (FCBS) that MS-DOS can have open at the same time.
FILES Specifies the number of files that MS-DOS can hold open concurrently. FILES=60
INSTALL Loads a memory-resident program. INSTALL=C:\DOS\SHARE.EXE/F:500 /L:500
LASTDRIVE Specifies the maximum number of drives the computer can access. LASTDRIVE=Z
MOUSE.SYS Loads a mouse driver.
NUMLOCK Specifies whether the NUM LOCK key is on or off when MS-DOS starts.
SHELL Specifies the name and location of the command interpreter. The interpreter converts the typed command to an action. The default for MS-DOS is COMMAND.COM.
SWITCHES Specifies special options in MS-DOS. The /N switch will disable the use of the F5 and F8 keys to bypass startup commands (used for security).

Here is a sample CONFIG.SYS listing:

 DEVICE=C:\WINDOWS\HIMEM.SYS DEVICE=C:\DOS\EMM386.EXE NOEMS DOS=HIGH, UMB BUFFERS=20 FILES=80 FCBS=4,0 LASTDRIVE=Z DEVICE=C:\CDROM\NEC2.SYS /D:MSCD001 /V 

AUTOEXEC.BAT Commands

The following table lists several commands that you'll find in the AUTOEXEC.BAT file.

ECHO Displays commands as they are executed. @ECHO OFF: Suppresses the display of commands as they are executed.
PAUSE Stops the execution of AUTOEXEC.BAT and displays the message "Strike any key to continue."
PATH Defines the search path for program commands.
SET Displays, sets, or removes MS-DOS environment variables.
SMARTDRV Provides disk caching.
KEYB Configures a keyboard for a specific language.
SHARE Starts the Share program, which will install the file sharing and locking capabilities.
DOSKEY Loads the DOSKEY program. You can use the DOSKEY program to view, edit, and carry out MS-DOS commands that you have used previously.
MOUSE.EXE Loads a mouse driver.
PROMPT Sets the display of the command prompt.

Here is a sample AUTOEXEC.BAT listing:

 @ECHO OFF PATH C:\DOS;C:\WINDOWS;C:\ DOSKEY SMARTDRV UNDELETE /LOAD VSAFE MSAV 

TIP
Here are a couple of useful tricks to try when working with CONFIG.SYS and AUTOEXEC.BAT. If you want the computer to ignore a command line, enter REM before that statement. For example: rem mouse.exe would tell the computer to ignore that line and the MOUSE.EXE file would not be loaded. Before editing existing CONFIG.SYS or AUTOEXEC.BAT files, copy them to a different directory or make a copy of each, but with a .OLD extension to the filename (AUTOEXEC.OLD and CONFIG.OLD). This way, you will have the current configuration data at hand if something goes amiss.

Optimizing Memory

As discussed in Chapter 7, the original processors developed by Intel were unable to use more than 1 MB of RAM. Therefore, MS-DOS applications were written to conform to this limitation. As application requirements grew, a means of optimizing the use of memory was required in order to get the most out of the space available. This 1 MB of memory was divided into two sections; 384 KB of RAM (designated upper memory) was designated for running the computer (BIOS and video RAM and ROM), and 640 KB was reserved for applications, designated conventional memory. (See Figure 15.1.)

Figure 15.1 Memory map

The MS-DOS limitation means it is essential that the 640 KB area be kept as free as possible. MS-DOS memory optimization ensures that MS-DOS applications have as much of this memory as possible. Lesson 2 of Chapter 7 provides a detailed look at the types of memory used by MS-DOS and Windows. Please refer to that section for a fuller discussion.

The MS-DOS command MEM (MEM.EXE) provides information about the amount and type of memory available. (See Figure 15.2.)

click to view at full size.

Figure 15.2 MEM Command

The bottom line in optimization of memory for MS-DOS programs is that they require conventional memory in order to run, and conventional memory is in short supply. You can make more conventional memory available to your programs by minimizing how much memory MS-DOS, installable device drivers, and other memory-resident programs use. There are several ways to free conventional memory for use by programs:

  • Run MS-DOS in extended memory instead of conventional memory.
  • Streamline the CONFIG.SYS and AUTOEXEC.BAT files so they don't start unnecessary memory-resident programs.
  • Run device drivers and other memory-resident programs in the upper memory area instead of in conventional memory.

Lesson Summary

The following points summarize the main elements of this lesson:

  • Two files (CONFIG.SYS and AUTOEXEC.BAT) are used to custom-configure an MS-DOS operating system.
  • MS-DOS programs operate only in conventional memory.
  • Good memory management is the key to successfully operating an MS-DOS system.


Microsoft Corporation - A+ Certification Training Kit
Microsoft Corporation - A+ Certification Training Kit
ISBN: N/A
EAN: N/A
Year: 2000
Pages: 127

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net