> Intro to PC hardware, DOS operating system, filing system, applications
The Hermit Hermit's Free Library  MS-DOS

An overview of DOS-based personal computers. Topics include: hardware components, operating systems, application software, user interface, booting, filing system, internal and external DOS commands, and how DOS finds commands.

Intro to PCs and DOS

Overview of Personal Computer Systems

A personal computer system consists of computer hardware and computer software working together.

There are two major categories of software:

Computer Hardware Components

Practical Hardware Tips

Application Software

Computer software programs used to perform day-to-day work in the real world are known as application programs (applications). All applications run on top of an operating system, which provides them with common, essential services.
Examples of Applications:

Operating Systems

To work properly (at all, actually), applications require the support of an operating system. On behalf of applications, an operating system carries out basic operations like controlling hardware resources and also operates the filing system used by all applications.

An operating system is a cooperative effort on the parts of:

Operating system software (OS) is a collection of specialized programs, which, together, manage:

Before Windows, the main OS for IBM compatible personal computers was Disk Operating System, or DOS. While there were many "flavors" of DOS, the main ones were:

User Interface

A User Interface (UI) is a program running under the control of an operating system which allows the user to communicate with the operating system. An OS user interface is also known a shell.

In DOS, the UI is provided by COMMAND.COM. COMMAND.COM is also called the command processor, or command interpreter. The COMMAND.COM UI is a character-based (non-graphical) command line.

Communication between user and command interpreter is accomplished by typing commands into a command line. The DOS prompt (C:\>) signifies that COMMAND.COM is ready to process a command from the user. Once the command is typed and Enter is pressed, COMMAND.COM parses it and either delivers it to other operating system programs, or generates an error message if the command was not understood or could not be found.

In addition, COMMAND.COM:

Booting the DOS Operating System

Loading an OS into memory is referred to as booting the computer. The operating system files must be found on either on the hard disk or a floppy disk in drive A:.

The sequence of events in the DOS boot is as follows:

  1. Instructions in ROM BIOS (Read Only Memory-Basic I/O Services) performs the Power On Self Test (POST). The POST determines whether hardware components, including the keyboard, the monitor, and RAM, are functional.

  2. If all hardware is working properly, the ROM BIOS checks the status of the computer's floppy and hard disk drives. If there is no diskette in drive A:, the BIOS looks at the first sector (side 0, cylinder 0, sector 1) on the first hard disk (C:) and looks for the Master Boot Sector, which contains the partition table and the Master Boot Record.

  3. BIOS reads the partition table which contains information about the logical division of the hard disk (partitions) and what operating systems are installed and which is active at boot time.

  4. BIOS executes the Master Boot Record, telling it which is the active operating system. The MBR uses the information to find the Boot Sector of the active partition and execute the Boot Record which is found there.

  5. The Boot Record, like the Master Boot Record, is a specialized program designed to launch another program. Exactly which program is launched by the boot record depends upon which operating system is booting. When installed, each operating system modifies the boot record in the boot sector of its own partition to launch the system file of its choice.

    The DOS boot record knows how to find and load into memory two Read- Only, Hidden, System files
    • IO.SYS
    MSDOS.SYS is the DOS kernel, its functions are:
    • File and record management
    • Memory management
    • Character device input/output
    • Spawning other programs
    • Access to real-time clock

    IO.SYS shares with BIOS responsibility for:
    • Console display and keyboard (CON)
    • Line printer (PRN)
    • Auxiliary device (AUX)
    • Date and time (CLOCK)
    Once MSDOS.SYS and IO.SYS are in memory, ROM BIOS is no longer in control. It does, however, continue providing basic, low level input/output functions to the operating system for use by application programs.

  6. IO.SYS reads the CONFIG.SYS file in the root of the boot drive if one is found (otherwise it uses default settings). CONFIG.SYS contains
    • Commands to load memory managers
    • Information on how memory should be configured
    • Information about installed hardware
    • Commands to load hardware drivers
    • Settings including number of file handles and buffers

  7. Next, IO.SYS loads COMMAND.COM from disk. In addition to supplying the User Interface, COMMAND.COM processes batch files, and it completes the boot process by finding and processing AUTOEXEC.BAT (automatically executing batch file). (AUTOEXEC.BAT must be found in the root directory of the boot disk).

    AUTOEXEC.BAT is a text file containing a set of commands to be carried out each time the computer is booted. It can include:
    • DOS internal commands (such as COPY and DEL)
    • External commands (load TSR's, other batch files, programs)
    • Create custom environmental variables like PROMPT, PATH, and SET

  8. Finally, the boot is complete, and COMMAND.COM displays a prompt on the command line to signify that the OS is loaded and ready to process commands. Typically, one would then enter the name of a DOS command to execute or an application to load.

While an application is running, the DOS kernel program (a part of MSDOS.SYS) watches over all of the ongoing processes, managing input/output and primary and secondary memory on behalf of the application. When the application (singular because DOS is single-tasking) requests the use of hardware resources (software interrupts) the kernel redirects the request to the rest of the operating system. When the user directs an application to save data to disk, the application requests filing services from the OS.

When the user terminates the application program, the OS reloads COMMAND.COM. COMMAND.COM then displays the DOS prompt to show that the system is once again ready for a command.

Making Disks Bootable

All disks must be formatted before they can be used. Formatting in DOS is done with the FORMAT command.

A disk format is a magnetic map on its surface: sectors (slices of pie) and tracks (concentric circles). After creating this magnetic grid, the DOS FORMAT program creates a File Allocation Table, or FAT. The FAT is the disk's table of contents. The format and the FAT are used by the DOS filing system to keep track of files on the disk.

If the disk is to be bootable, it must be a system disk, i.e. in addition to the filing system's format and FAT, it must also have system files and a boot record.

To format a system diskette:
FORMAT [d:] /s

To format non-system diskette:

The six components of a System Disk:

  1  Boot Sector           Always side 0, track 0, sector 0
       Boot Record         Loads operating system files

     Master Boot Sector    Always side 0, track 0, sector 0
       Partition Table     Contains location of active boot sector
       Master Boot Record  Activates active partition boot record
     Boot Sector           Location varies, recorded in partition table
       Boot Record         Loads operating system files

  2  Hidden system files   IBMBIOS.COM and IBMDOS.COM
  3  Command interpreter   COMMAND.COM
  4  File Allocation Table An index to the location of all files
  5  Directory area        A file's status (is it deleted?)
                           Complete name and extensions
                           File attributes
                           Time and date stamps
                           The FAT entries
                           Files' sizes, in bytes
  6  Data tracks           Space for storage of data files

Hierarchic Disk Filing Structure

Using the DOS command MD (Make Directory), a disk can be logically divided into an organized hierarchy of directories and subdirectories (folders and subfolders in the Windows vernacular).

DOS provides this flexible and efficient method of dividing up disk space to make it possible to organize the huge number of files which can be stored on a hard disk.

A full file specification is a complete and unique description of where a file can be found in the hierarchic filing structure. It consists of a drive designation, a path, a file name, and a file extension:


Neither the filename nor extension can include reserved characters (?/\.:;,*<> and the space character).


The highest level directory is called the root directory. It is represented by the first \ (backslash) symbol in the file specification example above.

In addition to representing the root directory, the backslash is used to separate one directory from the next in the path description.

A directory's parent directory is the directory directly above it in the hierarchy. In the example above, DOCS is LETTERS parent, while the parent of DOCS is the root directory.

To copy, delete, or rename disk files it is necessary to identify them to DOS using their file specification. Example: to make a copy of TM_JUN89.DOC named TST_COPY.DOC, use this command:


The DOS commands for working with directories are MD (Make Directory), CD (Change Directory), and RD (Remove Directory). CD is the command which allows us to navigate the disk structure.

Example: to make LETTERS the current directory, the command would be:


Note: spaces must be used appropriately because they are used as delimiters to show COMMAND.COM where one part of a command ends and the next begins.

Internal and External DOS commands

All application programs have either an .EXE or .COM extension. Like the DOS external commands, they reside on disk and must be loaded into memory each time they are to be used. Exceptions are TSR (terminate-and- stay-resident) programs, which can be re-activated with a "hot-key" any time until the computer is shut off once they have been loaded into memory.

How DOS finds commands

When we give a command from the DOS prompt, DOS always uses the same algorithm to find the program we have requested. First, it searches COMMAND.COM's table of internal commands to see if the command is already in memory. If not, the command is assumed to be an external command and DOS uses the following steps in an attempt to find it on disk.

Always searching for the name of the command we typed, in the order of:

it looks in:
  1. The current directory of the current drive
  2. Each of the directories specified in the PATH statement

    The PATH statement is a list of places for DOS to look for program files when they cannot otherwise be found. The path statement puts the list into the
    DOS environment.

If unsuccessful, COMMAND.COM gives up and displays the error message

Bad command or file name.