bembry.org
Home / Technology / Pc_repair

DOS Module Review

The following set of notes corresponds to the DOS module of the PC Repair course, providing students an outline of the information they are expected to understand at the completion of this section. The corresponding reading for this module is chapter thirteen of All In One A+ Certification Exam Guide by Michael Meyers, pages 513 - 566.

Operating System Basics

  • An operating system is the software that manages communication between the computer hardware components and other software applications while providing the user with an environment (user interface) for manipulating files and running programs.
  • The operating is the first program run when a computer boots up, and must continue to run at all times while the computer is in use.

System Files

  • IO.SYS communicates directly with the system BIOS and provides the basic input/output services for DOS. IO stands for "input/output".
  • MSDOS.SYS is the actual operating system kernel, the main "operating system program".
  • CONFIG.SYS contains the system configuration information and is specifically responsible for loading hardware device drivers.
  • COMMAND.COM is the command interpreter for the system. This system file interprets commands given to the operating system and passes them on to MSDOS.SYS in a format that the kernel can understand. Without COMMAND.COM, the user would not be able to type commands at the DOS prompt.
  • AUTOEXEC.BAT is a batch file containing commands for the computer to perform automatically upon system bootup. AUTOEXEC == AUTOmatcially EXECute.
  • At bootup, the DOS system files are loaded in the following order:
    IO.SYS -> MSDOS.SYS -> CONFIG.SYS -> COMMAND.COM -> AUTOEXEC.BAT

File Conventions

  • All file names must follow the 8.3 format rule. The file may use up to 8 letters for the name, followed by a period, and concluding with a three letter file extension.
  • The three letters at the end of a file are known as the extension. File extensions are used to associated files with programs, or otherwise identify the file type.
  • File names may not include a space or any of the following illegal characters
    \ / : * ? " < | > , = + [ ] ;
  • The following file names are reserved by DOS and therefore may not be used to name a user-created file:
    COM1 , COM2 , COM3 , COM4 , CON , AUX , CLOCK$ , LPT1 , LPT2 , LPT3 , LPT4 , NUL , PRN
  • The following specifications are associated with the respective file extensions:
    .BAT .COM .EXE -- Executable files (programs that can be run)
    .SYS -- System files
    .TXT .DOC -- Text files
    .HTM -- Web sites
    .BMP .JPG .GIF -- Graphics files (pictures)

Directory Structure

  • Each drive is assigned a letter in DOS. Drives A and B are floppy drives, C is the master hard disk drive, and all other letters may be used for other drives.
  • Every file is contained in a directory. The main directory of a drive is called the "root" directory. The root directory contains all the other directories contained on the drive, as well as any files not placed within one of the other directories.

DOS Commands

  • ATTRIB ~ Set the attribute properties of a file. Used to declare a files as hidden, read-only, system, or archive. Must be used with the following switches:
    +R or -R ~ Set read-only attribute on (+) or off (-)
    +H or -H ~ Set hidden attribe on (+) or off(-)
    +S or -S ~ Set system attribute on (+) or off(-)
    +A or -A ~ Set archive attribute on (+) or off(-)
    Example: ATTRIB +R -H hidden.exe
  • CD ~ Change working directory. Options include the following:
    .. ~ Change to parent directory that contains the current sub-directory.
    \ ~ Change to root directory.
    c:\name\file ~ Change to the directory c:\name\file
    Example: CD ..
  • COPY ~ Copy a file. Can be used to copy into a new location with or without changing the file name.
    Example: COPY file.txt c:\newspot\newfile.txt
  • DATE and TIME ~ Display the current date and time respectively and allows it to be changed.
  • DIR ~ Lists files and sub-directories. Switches include the following:
    /w ~ display in wide format (displays files in five columns)
    /p ~ pause if list goes past single screen
    Example: DIR /w /p
  • DEL ~ Delete given file. Must be followed by a file name. To undo an accidental delete, use the UNDELETE command followed by the original file name.
    Example: DEL badfile.txt
  • DELTREE ~ Delete a directory and all of the files and sub-directories contained therein. Handy little command to know.
    Example: DELTREE c:\deadwood
  • EDIT ~ Launches the DOS text editor. When followed by a file name, it will automatically open that file in the editor.
    Example: EDIT autoexec.bat
  • FDISK ~ Utility for creating and editing partitions on a disk drive.
  • FORMAT ~ Formats a disk. Use UNFORMAT to undo a format before making any changes to the disk. The FORMAT command takes the following switches:
    /S ~ Copy system files onto a disk. This will make the disk bootable.
    /Q ~ Quick format. This simply erases all the data on a disk.
    Example: FORMAT A: /S
  • MEM ~ Displays statistics on system memory usage, including amount of total memory available (conventional, upper, and extended), amount of each type in use, and amount free in each category.
  • MKDIR ~ Make a new directory. May also use the command MD.
    Example: MKDIR newspot
  • MOVE ~ Move a file from one location to another.
    Example: MOVE file.txt C:\newspot
  • RD ~ Removes a directory. Will work only if the directory is already empty.
    Example: RD C:\olddir
  • VER ~ Displays version of DOS currently running.

Special Codes

  • The asterisk * is used as a wildcard in DOS. For example, entering DEL *.* would delete all the files in a directory. Similarly, entering DIR p*.bat would list all the batch files that start with the letter "p".
  • The question mark ? is used as a single letter wildcard in DOS. For example, entering DIR p??.bat would list all batch files that start with the letter "p" and have three letters in their filename.
  • The switch /? at the end of a command will display help information for that command. For example, entering FORMAT /? will display guidelines on how to use the FORMAT command in DOS.

CONFIG.SYS File

  • CONFIG.SYS can be changed using a text editor, or by typing EDIT CONFIG.SYS
  • The BUFFERS= statement tells the computer how much RAM to set aside for transferring data to and from the hard disk. The default value, 15, should be sufficient, but it can be set anywhere from 0 to 99.
  • The FILES= statement sets how many files may be open at the same time. The default value of 8 is typically not sufficient and should be set between 30 and 99.
  • DEVICE= will load a device driver into conventional memory. DEVICEHIGH= will load a device driver into the extended memory area.
  • DOS=HIGH will load DOS into the extended memory area, freeing up more conventional memory.
  • The LASTDRIVE= statement determines how many drive letters DOS is allowed to allocate. The value may be anything from C through Z. If the value is not set high enough, new drives may not be accessible.
  • Placing a semicolon ; before a line will cause the computer to ignore that line.

AUTOEXEC.BAT File

  • A TSR is a program that will run, then appear to quit yet continue working in the background. These programs are often loaded through AUTOEXEC.BAT. TSR stands for "Terminate and Stay Resident". The mouse program in DOS is one example of a TSR.
  • The PATH= statement tells the computer which directories to search through when a command is entered. If the command is not in the current directory or one of the directories listed in the PATH statement, DOS will return an error message.
  • The PROMPT command is used to design how the prompt is displayed. The default is $P$G.
  • The SET statement is used to declare DOS variable values when can be used by any program. This is commonly used with sound cards.

Batch File Creation

  • A batch file is a set of DOS commands listed in the order the computer should perform them. Batch files can be used to automate commonly performed tasks.
  • To create a batch file, type the commands in a text editor and save the file with a .BAT file extension.
Restricted access