MS-DOS System Basics
MS/DOS was originally used by the first IBM PC. Over the years, it evolved into the current version 7 packaged with Windows 95/98. For many years MS/DOS was the primary operating system for Intel based microprocessors.

DOS and BIOS controlled the entire PC. It resided in RAM memory, along with the various device drivers. DOS and BIOS operate hand-in-hand in controlling the PC. In this discussion, I will try to keep the discussion at the newest or highest version of DOS (MS-DOS 6.22) with which I am familiar.

When you first turn on the computer (called "booting" the computer), MS-DOS is loaded or started. After this boot up you usually see a blank screen with a small prompt (usually "C:\>"). To people who have not used computers before, this prompt can be intimidating--it offers no clue on what to do next. What's behind that blank screen?

The answer of course is a Disk Operating System (DOS) is in control your computer. This operating system provides a way to communicate with your computer. It also controls the organization of files and programs on your hard and floppy disks.

In this section we will explore disk organization and some of the basic commands used to communicate with the MS/DOS operating system.

Hard Disk Organization
To keep track of the files, operating systems such as MS-DOS, UNIX, and OS-2 require that files be organized into directories. While each of these systems required directories, the information recorded in each file entry is not the same. In this chapter we will discuss only the way MS-DOS creates file entries.

When you copy or create a file or install a program on the hard disk in a MS-DOS system, a File Allocation Table (FAT) is created on the hard disk. This FAT contains a listing of what is stored on your disk. In the directory entry for each file, DOS records:

  • The file name.
  • The disk location (sector number).
  • The file size in bytes The date the file was last changed.
  • The time the file was last changed.


Directory Organization
Think about how you store letters in your office. In your office, you may have a filing cabinet.

In that filing cabinet, you probably have folders that pertain to different projects, employees, organizations, or some other grouping--maybe logical, maybe not.

Within each folder you have articles, letters, diagrams, reports--anything that you want to save. This storage method carries over to Microsoft's MS-DOS and Windows 95/98 Disk Operating Systems (DOS).

With Microsoft's DOS, a disk is like a filing cabinet. Within that disk, you have directories or areas set aside for certain files such as memos, articles, or diagrams. The same type items that you store in a folder are stored in electronic form in a file. That file is then stored in a directory.


Root Directory and the Path

The main directory is called the root directory. All other directories are branches of this directory, much like the roots of a tree. Directories can contain files, programs, or other directories. The root directory is designated by a backslash (\).

To get to a particular file, you must trace the path from the root directory to the directory that the file is located in. The path is the list of directories, starting with the root.

Each directory name is separated by a backslash (\). For example, the path [C:>\wp\reports] gives you access to the directories as follows:

  • Start at drive C:\
  • Go from the root directory (\) to the [ WP] directory
  • Go from the [WP] directory to the [REPORTS] directory.
When we go to a directory it is the same as opening a folder in a file drawer.


Note: The paths for each of these directories would look like the following:
  • C:\ ----------------------------- Root Directory
  • C:\dos\ ----------------------- DOS subdirectory (1 level)
  • C:\Lotus\ --------------------- Lotus Subdirectory (1 Level)
  • C:\wp\ ------------------------- Word Perfect Subdirectory (1 level)
  • C:\wp\Report ---------------- Report Subdirectory (2 levels)


    Drive Identification

    Microsoft's Disk Operating Systems identify each drive (including the hard disk) by a letter. For example the first diskette drive on any system is always drive [A:] and the second is always drive [B:], etc. On some systems drive "A" is a 3-1/2 inch floppy drive. On other systems it can be a 5-1/4 floppy drive.
    • The first logical or physical hard disk is always identified as [C:].

    • To specify the disk drive in a path statement you always give the drive letter followed by a colon.

    • Examples: For each hard disk or Floppy disk, the top level directory is always called the [ROOT] directory.



    • Sub-directories - Since one directory can contain entries for other directories, the subordinate directories can be referred to as subdirectories.

      • These subdirectories are just like any other directory; they're just subordinate to a higher-level directory.

      • As a result, subdirectories can also be referred to as directories.

      • This is the same as a letter in a file is a subordinate to the higher level file folder





    Managing Directories and Files

    In earlier versions of MS/DOS, when the command prompt was displayed in its standard form, (C:\>), it told you what the default drive is, but but not the current directory. Modern versions of MS/DOS shipped with Windows 95/98 will indicate both the drive and directory you are in.

    If you are working with an older version of MS/DOS and want to change the form of the prompt so it does tell you what the current directory is, use the PROMPT command as follows:


    After the command is executed, the prompt is changed to show the current directory for the drive you are logged into. If you are at the root directory of the C: drive your prompt would look like this:

    C:\>

    Now if you changed the current directory to the DOS directory, the prompt would look like this:

    C:\DOS>

    The enhanced form of the prompt stays in effect until you turn your PC off. A prompt that tells the current directory makes it easier to use the other DOS commands.
    • You should always set your prompt to this form.

    • You don't have to do this each time you start your PC. Instead, you can put a PROMPT command in your autoexec.bat file.

      File Names

      Whenever you save a new file on a hard disk or a diskette, whether you use DOS or an application program, you need to be able to create a valid file name.

      A file name is separated into two parts that are separated by a period. The part that comes before the period is required. The part after the period is optional and is called the extension.

      The MS/DOS system uses the 8.3 file naming convention.  Each file must have a unique or different name. An entire file name is made up of the file name (up to eight characters) and the extension (optional three characters).

      The file name and extension are separated by a period. You cannot use these characters in a file name:


      Valid File Names:

      As and example: [Report.doc] is a valid file name. [Report] is the file name, and [doc] is the extension. The file name should tell you what the file contains; the extension often tells you the type of file.

      Some programs such as Lotus Freelance and Lotus 123, assign an extension automatically. As an example:


      Invalid File Names:

      [MY NOTES] is not a valid file name because a file name cannot contain spaces.(except in Windows 95/98)  

      If you want to include a space in a file name, however, you can use the underline character instead [MY_NOTES]. [Basicdosclass.DOC] also is not a valid file name because it contains too many characters.


      Wild Cards

      When you want to work with a group of files, you can use wild cards. There are two types of wild cards: an asterisk and a question mark.

      The Asterisk

      • An asterisk wild card [*] matches any characters. The most common use of this wild card is [*.*]. You might hear other computer users describe this wild card as star-dot-star.

        This file spec matches all files; that is, the file can have any root name and any extension. (A file spec is a combination of the path, file name, and extension.)

      • The file spec *.TAT specifies files with any root name (*.) and the extension TAT. The following files would be included in this group:

      • The following files would not be included (because they have a different extension):


      The Question mark

      • wild card [?] matches any single character. For instance, the file spec [?SALES.DOC] includes all files that start with any character; the remaining letters must be [SALES], and the file must have the extension [DOC]. The following files would be included in this group:

      • The following files would not be included:

      • Using Wild Cards -You can use wild cards in different combinations to control which files are included in a group. Suppose, for example, that you are writing a book that has eight chapters.

        • The file for each chapter is named [CHAP], followed by the chapter number, a period, and the file extension [DOC].

        • When you want to copy all the files [CHAP1.DOC] through [CHAP8.DOC] , you can use a file spec such as:

        This file spec uses the [?] wild card and tells DOS to include every file named [CHAP] that is followed by one character and has a DOC extension.

        Remember that each ? wild card represents one alphabetical character. If, however, your book is 15 chapters long, and the files are named CHAP through CHAP15.DOC, you need to use a different wild card called the asterisk.

        • To copy all the files for this book, you can use a file spec such as: CHAP*.DOC

        This file spec tells DOS to include every file named CHAP, followed by any number of characters, with a DOC extension. Remember that the (*) wild card represents any number of characters.

      Special Files

      Your computer contains some special files that you should understand their purpose

      • Command.Com - To process commands, you must have a program file called COMMAND.COM. This is a special DOS file. When you install DOS this file is copied to the hard drive. Once DOS is booted this program is loaded into memory and translates your commands typed in near-english into a language the computer understands.

      • Autoexec.bat - When you first start DOS, it looks for a file called AUTOEXEC.BAT. This file must be stored in the root directory. When DOS starts and finds the file, it executes the file. This file may include commands that control different settings. For example, you might include a command that tells DOS where your programs are located. This command is called a path command.

        • The following shows a simple AUTOEXEC.BAT file:

        • This file changes your prompt (C:\>) so that it displays the current subdirectory. For example, if you are in the directory DATA, which is a subdirectory of C:\WP, you would see: C:\WP\DATA>;

        • The PATH command tells DOS to look in the DOS and WP directories for program files.

      • Config.sys - Another special file that DOS uses to start is CONFIG.SYS, a configuration file. Some applications require special commands. These commands are contained in the CONFIG.SYS file. The following shows a simple CONFIG.SYS file:

        • These settings control how DOS uses files. Some programs require that these are set to a certain value. When dealing with these files, keep these rules in mind:

        Remember - Don't delete any of the following:
        COMMAND.COM
        AUTOEXEC.BAT
        CONFIG.SYS

        Don't try to change the contents of COMMAND.COM.


        As you add applications to the computer, the program manual might tell you to make changes to the AUTOEXEC.BAT file or the CONFIG.SYS file. You must use a special text editor to modify these files. Be careful when making any changes. You should understand each command in the file before changing anything.
        The MS-DOS Command Prompt

        As DOS takes control of the system, it may display several messages on the monitor. It may also ask you to enter the correct date and time. Eventually, DOS will display the command prompt. You have to be at the DOS prompt before you can try any of the DOS commands.
        • In its standard form, the prompt looks like this:

        • This prompt just displays the default drive

        • However, some PCs are set up so the prompt displays the current directory along with the default drive in this form the prompt will look like:
        No matter what the prompt looks like, it still means the DOS command processor is waiting for your command.
        Entering and Correcting a MS-DOS Command

        To enter a DOS command, you type in the command at the command prompt and press the Enter/Return key.

        That's all there is to it!   With few exceptions, DOS does not care whether you use upper- or lower-case letters in commands.


      • Subdirectory Shortcuts -The dot-dot (..) file in every subdirectory is used by DOS to support linkage to the subdirectory's parent directory.

        That is why the root directory has no dot-dot file; the root has no parent. You can use the dot-dot file as a shortcut to change to the parent of the subdirectory on which you are currently logged.

        • By changing to the dot-dot subdirectory, you automatically change to the parent of the current subdirectory without needing to remember its name.


          More information on Basic MS-Dos and Hardware Functions.

          More information on Basic MS-Dos Commands.