MS-DOS (Microsoft Disk Operating System)
Introduction.
DOS was the main OS for Intel-based PCs from 1980 - 1995. It is supplied by Microsoft
Corporation for use on IBM PC compatible computers or Clones.
DOS is a single-user, single-tasking OS that is disk-based & controls your computer & the
devices connected to it.
It provides the most basic instructions the computer needs to operate. It tells the computer how
to process information, how to handle Input & output, and how to manage files and directories by
use of commands.
*DOS is a 16-bit OS (written for 16-bit Microprocessors running 16-bit applications).
*DOS provides a Command-based interface to the user enabling him/her to execute programs.
It controls the operations of your computer when you use any programs. E.g., when you
create any files using DOS applications, the files are managed using MS-DOS.
DOS is normally supplied on a floppy disk or pre-installed on the Microcomputer.
DOS is used for starting the Microcomputer & managing the computer resources, which include:
* The I/O devices, e.g. Monitor, Keyboard, Printer, Floppy disk drives, Hard disk drives, etc.
* Files.
* Memory.
Memory Requirements.
The older versions of DOS required very little memory. DOS 3.0 required about 30KB of the
DOS Conventional memory & less than 1MB of Hard disk space.
DOS 6.0 & above requires at least 5MB of Hard disk space & 50KB of the Conventional RAM.
BASICS OF DOS.
DOS STRUCTURE.
DOS consists of 4 basic modules:
(i). The Boot Record.
This record begins on Track 0, Sector 1, Side 1 on every disk formatted using the DOS
FORMAT command. On a fixed disk, the Boot record is on Sector 1 of the DOS partition.
The Boot record identifies the disk & contains the initial boot program for the disk.
(ii). The BIOS.
The Basic Input Output System (BIOS) is located in ROM. It is a low-level interface to
the machine & is responsible for hiding the vagaries of the hardware from all other
software.
The BIOS provides a series of functions that programmers can use to perform operations
without having to concern themselves with the details of the underlying hardware.
(iii). The DOS Programs.
DOS is implemented by 2 programs: (a). The I/O System - an interface module loaded from disk that augments (enhances) the
ROM BIOS functions & usually contains a set of standard device drivers.
Input/Output activities - These are the Read or Write actions that a computer
performs.
A computer performs a “Read” when you type information on your Keyboard or you
choose items using a Mouse. When trying to open a file, the computer reads the disk
on which the file is located to find and open it.
76
�MS-DOS 6.x
A computer performs a “Write” whenever it stores information on a disk, displays
information on a Screen or sends information to a Printer.
I/O addresses - locations within the I/O address space on your computer, used by a
device, such as a printer.
(b). The Disk Operating System (DOS) itself. It is a high-level interface for all programs
that run on the computer, whether or not they make use of the disk.
(iv). The Command Processor.
It is the normal interface to DOS for people working with the system. It generates the
Command Prompt (C:\>), accepts commands, and executes programs requested by users of
the system.
STARTING DOS (BOOTING).
Booting is a term used to describe the startup procedure in Microcomputers.
There are 2 ways of booting a computer loaded with DOS.
(a). From a DOS diskette.
(b). From the Hard disk.
Starting the computer from the Hard disk.
Computers can be booted up from the hard disk if DOS has already been installed on it.
 Simply switch on the computer to start it up after making sure there is no diskette in drive A.
Note. Today, computers start or boot from Windows loaded onto your hard disk.
To start DOS, use the MS-DOS Prompt.
Starting the computer from a DOS Diskette.
When a computer has no hard disk, you must load DOS on diskettes.
A DOS diskette contains the DOS commands needed to start & use the computer.
 Insert the DOS diskette in drive A: (default drive) & then turn on the power switches on your
computer.
Types of Booting.
There are 2 types of booting, namely;
(i). Cold booting - Turn on all the computer power switches.
(ii). Warm booting - Press CTRL+ALT+DEL to restart the computer.
Note. Pressing CTRL+ALT+DEL can also be used to quit an application that has stopped
responding to the system.
1). When Power is turned on, the computer first executes a small program, POST (Power-OnSelf-Test) that is permanently stored in ROM.
POST instructs the computer to run diagnostic tests like checking the computer memory
(RAM) to make sure it is operating correctly; check the CMOS (BIOS), check the Hard disk
Controller, Floppy disk drive Controller & the Keyboard. If a problem is found, it displays
an error message on the screen indicating where the problem is located.
2). If no problem is found, the computer starts looking for a “Bootable disk” (a disk that has the
DOS “bootstrap” program on it). It starts with default drive (drive A:), followed by drive C.
3). If the bootable disk is found, a program in ROM executes 2 hidden Operating system
programs; IO.SYS & MSDOS.SYS found in DOS.
IO.SYS is a system boot file, while MSDOS.SYS gives the booting information, i.e. path,
Multi-boot, etc.
4). COMMAND.COM is then loaded into RAM.
77
�MS-DOS 6.x
FILES & FILE STRUCTURES.
What is a File?
A File is a collection of information initially created in memory and then stored with a filename
on a secondary storage device for preservation & future reference.
Creating a file means grouping related information so that it can be easily accessed.
Types of Files
There are three different types of files:
System files
The operating system needs system files to run.
Examples of system files:
a).
AUTOEXEC.BAT
This is a batch file (i.e., a file which contains a list of commands), that is run whenever you
start your computer. However, it is not needed by the computer for it to be able to run.
b). COMMAND.COM
This file is very important in the startup of your computer. It contains the user interface for
Microsoft DOS (i.e., the DOS prompt, and all common commands).
c).
WIN.COM
This file is essential to Windows systems as it is used to start up the GUI (Graphical User
Interface) for Windows. Without it Windows cannot start, even if the file was just
accidentally renamed or moved.
d). CONFIG.SYS
Config.sys is not needed to run the computer, but it can be used to tell Windows or DOS
specific information about the hardware that you are using, or to create a simple startup
menu.
e).
IO.SYS
This is one of the most important system files, as it tells your computer how to
communicate with its hardware on the lowest level. Without it, nothing will happen on
your computer, and Windows will not start.
f).
MSDOS.SYS
MS-DOS.SYS is a basic system file for DOS. It is similar to IO.SYS in its functions, and
still needs to be included for compatibility.
g).
USER.DAT
USER.DAT is a data file that can be found in the Windows directory of your computer.
It is needed together with SYSTEM.DAT for the Windows registry (a large database
containing all the information about your computer’s hardware & software).
Application (program) files
They are used to run application programs & are installed onto your computer’s hard disk.
Document (user) files
These are files that contain user information and are created using application programs.
79
�MS-DOS 6.x
File Management.
This is the organization & maintenance of files in a computer storage media.
File management enables the user to arrange his/her files into groups according to types; thus
speeding up storage & retrieval of information.
Naming of Files.
Filenames.
A Filename is a reference name given to a file when it is saved.
A file must be given a unique name in order to help the user differentiate it from other files
(especially if there are many files stored on one disk drive) & also it helps one to remember what
is inside the file.
A filename consists of a ‘file-name” and an “extension”.
The file-name must not exceed 8 characters & can contain any alphanumeric characters, A-Z, 0-9
except the following: Full stop (.), Square Brackets ([ or ]), double quote (“), colon (:), semicolon (;), slash (/),
backslash (\), less than or greater than sign (< or >), question mark (?), plus sign (+), equal sign
(=), asterisk (*), or blank space.
You can also mix numbers, letters and symbols when entering a filename.
File extension.
An extension enables the user to group files into categories or file types by giving more
information about what is in the file, such as Text (.TXT) files or Command (.COM) files.
Rules that apply to filename extensions.
(i).
Use a period/dot (.) followed by a maximum of 3 characters for the extension.
(ii). Don’t use any spaces between the filename and the extension.
Note. DOS reserves certain filenames for specific devices that the computer uses, and therefore,
they cannot be used when naming files.
They include; AUX, CLOCK, COM, CON, KEYBD, $, APT, PRN, etc. These names can be
used as extensions but not as filenames.
DOS DIRECTORIES & DIRECTORY STRUCTURES.
What is a Directory?
A directory is a unit that groups related files for storage in a disk.
Directories are stored on the disk with files in them.
Directory Structure.
This is a method of organizing files so that one can efficiently store and retrieve data.
DOS uses a Tree (hierarchical) structuring system that allows the user to easily store and
manipulate a large number of files efficiently.
Every disk formatted by DOS contains a directory called the Root directory. The Root directory
is the main (top-level) directory & is used to hold a list of all the files stored on a disk.
You can create separate directories called Sub-directories under the main/root directory or
within other directories & use them to hold files that you want to keep separate from those in the
root directory.
80
�MS-DOS 6.x
It is the route MS-DOS must travel, starting at the root directory to get the files in another
directory.
Before DOS can find a file in a directory (other than the current directory), you must tell it where
to locate the file by specifying the Pathname.
E.g., a pathname can be a drive specifier, a series of directory names & a file specification. Each
of the elements is separated by a Backslash.
A:\directory1\directory2\filename.extension
A – The drive.
Directory 1, 2 – name of your directory. You can enter as many directory names as necessary.
Filename – name of the file you want to locate.
Extension – type of the file.
E.g., to specify the path of a file named README.WRI located in the WINDOWS directory,
you would type,
C:\>Windows\Readme.Wri ↵
Filespec.
This refers to the full file specification when a drive letter is included. A full file specification
usually consists of the drive letter, a colon & the filename.
The drive specifier must be placed before the filename. It tells DOS where the file is located.
E.g. A:\MOF\Sample.Txt
Descriptive Questions.
1. What is a Computer file?
2. Differentiate between a file and a directory.
3. (a). A file name consists of three parts. Name them.
(b). What characters can be used when naming a file?
(c). List at least three reserved words in DOS that should never be used as a filename.
4. Define the word ‘Filespec’ and give an example of a filespec.
5. With the help of a diagram, describe the directory structure of DOS.
6. What are the uses of sub-directories?
7. What is the purpose of the PATH command in DOS?
8. Name the command that shows the structure of a directory like the branches of a tree.
MS-DOS COMMANDS.
What is a Command?
A Command is an instruction issued by the user to the computer telling DOS what to do.
DOS commands are provided in DOS diskettes bought with each microcomputer.
Other than the DOS commands, every application program may have its own sets of commands
to perform specific tasks.
Internal commands of DOS.
These are the simplest & the most commonly used commands. They are stored in the Main
memory for fast access.
The Internal DOS commands are found in COMMAND.COM file. The commands cannot be
seen when you list the directory (using Dir), because they are part of the Command.com file.
They are executed via the Command.Com file, which is loaded automatically into RAM when
DOS is booted.
COMMAND.COM (the most important DOS command) is used to start up the machine. It
contains Internal commands such as “Dir” and “Prompt”. It is responsible for accepting user
commands & interpreting them for DOS.
82
�MS-DOS 6.x
Examples;
DATE
TYPE
DIR
COPY
CLS
TIME
CD / CHDIR
MD / MKDIR
RD / RMDIR
- used to have file contents displayed or printed.
- used to obtain a directory listing (to view directories).
- used to duplicate one or more files and save it.
- used to clear the screen. On typing this command, everything on the screen gets cleared
off & the DOS Prompt appears on the top left corner of the screen.
DEL - used to delete one or more files from disk.
VER - used to find the version number of DOS that is in use.
REN / RENAME - used to rename files.
DATE & TIME commands.
DOS uses the computer clock to keep data and time information.
The date information is given as mm/dd/yy (where mm=month; dd=day; yy=year).
The time information is given as hh:mm:ss (where hh=hours; mm=minutes; ss=seconds).
(a). To display or set the computer’s date, type:
DATE {without parameters} ↵ - to display the current date setting & prompts for a new
date. To keep the displayed date, press ENTER.
 To verify the date.
E.g., To change the date to 11/28/2003 or 1/1/99, type:
DATE ↵ then type:
11-28-2003
or
01-01-99
(b).To display or set the computer’s time, type:
TIME {without parameters}↵ - to display the current time setting & prompts for a new
time. To keep the current time, press ENTER.
 To verify the time.
E.g., To change the time in the system to midnight or 8 pm or 11 minutes past 10
am, type:
TIME ↵, then type:
12:00a (for midnight)
or
08:00p
or
10:11:20a↵
External commands of DOS.
The External DOS commands are stored within the DOS directory on a secondary storage
device, such as hard disk, from where they can be called when required. This means that, they
cannot be accessed directly when the computer boots up.
Examples.
DISKCOPY.COM – Copies the contents of one floppy diskette to another.
FORMAT.COM
- Formats diskettes for use with MS-DOS.
BACKUP. COM
– Copies files from a fixed disk to a diskette.
DISKCOMP
– Compares the contents of two floppy diskettes.
PRINT.EXE
When you enter a command, DOS checks its library to see if the command exists. The sequence
of search is:
 Main memory
- Internal commands.
 Secondary storage - External commands.
83
�MS-DOS 6.x
(d). Name the command used to start up the computer.
3. Suppose you change the year of a microcomputer clock using the DATE command from
2001 to 2003 and then switch it off. What will be the date indicated by the microcomputer
when it is switched on again after a few minutes?
4. What is the main difference between ‘deleting’ and ‘backspacing’?
5. What is a Template? How do you recall the last command entered via the keyboard?
FILE COMMANDS.
Dir
Move.
Rename or REN.
Type.
Del or Erase.
More.
Undelete.
Copy.
Print.
1). LISTING (DISPLAYING) FILES IN A DIRECTORY OR DISK.
(a). To list all the files contained in the current directory, type:
DIR ↵
(b). To list the files in the root directory in your floppy disk (drive ‘A’):
At A:\>, type:
DIR ↵
-OrAt C:\>, type:
DIR A:\ ↵
(c). To list the files in the directory MOF in drive C:
At C:\>, type:
DIR C:\ MOF↵
-
The directory listing (or the DIR command) gives you 5 columns of information:
Name of the file.
Extension (if any).
File size (no. of bytes).
Date the file was created or updated.
Time the file was created or updated.
Note. DIR has 2 options; /W and /P. These two options make file or directory listings easier to
read.
/W (WIDE) - causes the directory to be displayed horizontally across the screen.
/P - pauses the directory listing once the screen is filled.
 To display the contents of drive A, pausing after every screen is full:
At A:\>, type:
DIR/P ↵
-OrAt C:\>, type:
DIR A:/P ↵
 To display the contents of drive A, horizontally across the screen (or using the Wide
format display):
At A:\>, type:
DIR/W ↵
-OrAt C:\>, type:
DIR A:/W ↵
2). DISPLAYING TEXT FILES.
ASCII text files can be displayed using the TYPE command.
Syntax: TYPE <filename.extension> ↵
The MORE command.
The MORE command is used to pause the screen display of files or directory listing, i.e. it
allows you to view a screen page at a time.
85
�MS-DOS 6.x
Syntax:
TYPE <filename>|MORE↵
-OrMORE <filename>
3). CREATING FILES USING DOS.
Files can be created directly from the DOS Command Line using the COPY CON (Console)
command.
If you type COPY CON followed by a filename, all inputs received from the Console or
keyboard (CON) will be copied into the designated file.
After the last entry, close the file and write it to the disk by pressing F6 (or CTRL-Z) and
<ENTER> keys.
E.g., to create the file ‘SAMPLE.TXT’ on a disk and enter the text ‘red, blue, green’, type the
following:
A:\>COPY CON Sample.Txt{press ENTER}
Red {press ENTER}
Blue {press ENTER}
Green{press ENTER}
Press CTRL-Z or F6, then press ENTER
The latest DOS versions have an editor called EDIT that can be used to create or edit MSDOS text files. The MS-DOS Editor is a full-screen editor, which allows you to create, edit,
save and print ASCII text files.
To create a file using EDIT, type:
C:\EDIT <filename> ↵
4). DELETING FILES.
Files that are no longer needed take up space on the hard disk or floppy disk. To delete these
files, use ERASE or DEL commands.
Note. Deleting files is dangerous, because you can sometimes delete files that you still need.
Make sure that you only delete files that are no longer in use.
To delete a file, you must specify the filename & its extension (if any), together with the
directory in which the file is located. Otherwise, DOS will assume the current directory.
Examples:
(a). To delete the file named MEMO1 from the current directory.
DEL MEMO1↵
(b). To delete all the files with an extension .DBF from a directory named MOF in drive A.
DEL A:\MOF\*.DBF {ENTER} -Or- change to A:\MOF>, then type: DEL *.DBF
{press ENTER}
(c). To delete all the files from the root directory on drive C:
DEL C:*.* { ENTER} -Or- change to C:\>, then type: DEL *.* {press ENTER}
(d). To delete a file named SAMPLE1.TXT on drive A:
A:\>DEL SAMPLE1.TXT {press ENTER}
(e). To delete all the files in C:\TEMP directory;
C:\TEMP>DEL *.*↵
-Or- C:\TEMP>DEL ↵
Tip. /P –prompts for confirmation before deleting each file.
Note. Subdirectories cannot be deleted by the DEL command. To delete all the files &
Subdirectories within a directory use the DELTREE command.
UNDELETE command.
86
�MS-DOS 6.x
COPY Memo2 A:\↵
(iv). To Copy all the files from the root directory on drive A to the current drive, current
directory.
COPY A:\*.*↵
(v). To copy all files with an extension .DBF from a directory named MOF in drive A to a
directory named MOF in drive C.
COPY A:\MOF\*.DBF C:\MOF↵
-OrChange to A:\MOF\>, then type: COPY *.DBF C:\MOF↵
(vi). To copy the CONFIG.SYS file from drive C to drive A:
C:\>COPY Config.Sys A:↵
Tips.
/V –verifies that the new files are written correctly.
/-Y –causes prompting to confirm you want to overwrite an existing destination file.
Wildcards can be used to copy a group of files. For instance, to copy all Command files (files
with extension .COM) from the DOS directory in drive C to drive A:
C:\DOS>COPY *.COM A:↵
Note. To copy all the files in a directory, including the files in the subdirectories of that directory
and also hidden files, use the external XCOPY command.
At C:\>, type: XCOPY C: A: ↵
Descriptive Questions.
1.
2.
3.
4.
State four examples of File commands.
What is the function of the MORE command in DOS?
What facility does DOS provide to create ASCII text files?
Give the command used to:
(a). Display the name of the current directory or change from one directory to another.
(b). Copy entire directories including all the subdirectories.
(c). View the contents of the directory.
5. By giving examples, explain the functions of the ‘*’ and ‘?’ characters as used with DOS
commands.
6. Consider the DOS Hierarchical directory structure shown below.
88
�MS-DOS 6.x
Assume that all subdirectories are empty initially. Unless changed otherwise, for each action
below, start from the root directory and write down the commands required to perform the
following:
(a). Create two subdirectories under SYSTEM called LOTUS and WP.
(b). Create a file called Maths1.txt under MATHS subdirectory with the following contents.
1+1=2
3+3=6
(c). While in the MATHS subdirectory, copy Maths1.txt to Maths2.txt.
(d). Remove MATHS subdirectory.
(e). Remove LAB subdirectory.
DIRECTORY COMMANDS.
Dir
CD / CHDIR
RD / RMDIR
MD / MKDIR
1). CREATING (MAKING) A SUBDIRECTORY.
MS-DOS creates the root directory any time it formats a disk and then specifies the current
directory on your screen.
MS-DOS will indicate the root directory in a given drive by the drive letter followed by a
colon & then a backslash. E.g., the root directory on drive A will be A:\, while the root
directory on drive C will be C:\
To create a directory, use the MD command or its longer form MKDIR.
(a). To create the subdirectory MOF under your root directory in drive C, and then change
to the subdirectory, type:
C:\>MD MOF↵
C:\>CD MOF↵ (DOS will change the prompt to read C:\MOF>)
(b). To create the subdirectory MISD under the subdirectory MOF;
Change to the subdirectory MOF, then type: C:\>MD MISD↵
2). CHANGING SUBDIRECTORIES.
To work in another directory, use the Change Directory (CD) or CHDIR command.
(a). To change from the root directory on drive C to the subdirectory MOF;
CD MOF↵
DOS will change the prompt to read C:\MOF>
(b). To further change to the subdirectory MISD, which is a subdirectory of MOF;
While in C:\MOF>, type: CD MISD↵
(The prompt will now change to C:\MOF\MISD>)
(c). To move to a subdirectory called PETER which is under the directory USER; type:
CD\USER\PETER {press ENTER}
(d). To move one level of directories backwards, use
CD.. (CD followed by two periods) or CHDIR..
(e). To change to the root directory (C:\>), use
CD\ (CD followed by a backslash).
3). COPYING FILES BETWEEN DIRECTORIES.
When subdirectories are created, they are empty. You can copy or create files in them. To
copy files to the directory, use the COPY command.
When copying files between subdirectories, the full path of where the file is coming from
(source) and where it is to be copied (destination) must be included.
89
�MS-DOS 6.x
 5¼-inch diskettes (360KB, 1.2MB).
Uses of Diskettes.
Diskettes are mainly used for:
(i).
Backing up files for safekeeping.
(ii). Backing up files that are not being used currently, to leave space on the hard disk.
(iii). Transferring files from one machine to another.
Write Permit/Protect Notch.
Diskettes are provided with a write protect notch. The notch prevents writing to the diskette.
In 5¼” diskettes, the write-protect notch is covered with a sticker. In 3½” diskettes, the writeprotect tab is slid towards the front of the diskette.
Checking a Disk – CHKDSK or SCANDISK.
CHKDSK command.
CHKDSK normally checks the status of a disk, fixes errors in it & displays a status report.
The report shows which errors were found in MS-DOS 6.2 filing system, which contains the
FAT and directories.
It also displays a summary information on the disk space used, disk space available & bad
sectors (if any). Otherwise, it gives an error message if errors are found in the disk.
Some of the information returned by the CHKDSK command includes:
 Disk information: Volume name, date created, total disk space and the space used.
 Main memory information: total bytes and bytes available.
(i). To check the status of drive A that contains data files & display the status report.
At C:\>, type: CHKDSK/F A:↵ -Or- at A:\>, type: CHKDSK/F↵
(ii). To check the status of the current disk (hard disk) that contains data files, type:
C:\>CHKDSK/F ↵
The /F switch – tries to fix errors on a disk when using the CHKDSK command.
Note. Running CHKDSK/F when files are open can result in corruption or loss of data.
Therefore, never run it from another program or from Microsoft Windows.
SCANDISK command.
SCANDISK is a full-featured disk analysis & repair program that checks a disk for errors &
repairs (corrects or fixes) any problem if found.
If you suspect that files in your hard disk or floppy disk may be corrupted or there may be any
other problems with your disk, run Scandisk (without parameters) to check for & repair errors
on the current drive.
Scandisk checks & fixes problems in the following areas: FAT
File system structure (lost clusters, cross-linked files). Lost clusters are the remains of
temporary files that are not cleared if the user crashes out from Windows, & are normally of
no use and take up disk space. Lost clusters are not linked to a filename, but are recorded in
the FAT as holding data.
Cross-linked files are clusters on disk that are linked to more than one file.
 Directory tree structure.
 Physical surface of the disk (bad clusters).
91
�MS-DOS 6.x
 MS-DOS boot sector.
If SCANDISK finds a problem, it displays a Problem found dialog box that briefly explains the
problem and how to fix it. For the computer to fix the problem, choose the Fix button.
To check & repair a drive, use the following syntax:
SCANDISK [drive:]/All/AutoFix/NoSave/NoSummary/Surface↵
/ALL – checks & repairs all local drives.
/AUTOFIX – fixes damage without prompting.
/NOSAVE – deletes lost clusters rather than saving as files.
/NOSUMMARY - prevents Scandisk from stopping at summary screens.
/SURFACE – performs a full surface scan for your drive after other checks.
/CUSTOM – configures & runs Scandisk according to SCANDISK.INI settings. Scandisk.ini is
a disk status tool configuration file.
/MONO – configures Scandisk for use with a Monochrome display.
File System - the overall structure in which files are named, stored & organized by the OS.
E.g., MS-DOS & earlier versions of Windows use FAT16 file system. Windows 98 can use
FAT16 or FAT32 file system.
File Allocation Tables (FAT) - A method used by OS to keep track of where files are stored
on a hard disk.
Checking Memory Usage – MEM
The memory configuration of a computer significantly affects the system’s performance. It is
therefore important to know how much & what type of memory your computer has.
The total amount of memory is usually shown in the upper left-hand corner when the computer
boots up.
To find out the memory configuration, use the MEM command, which displays information
about allocated memory areas, free memory areas, the total amount of memory used & the
programs currently loaded into memory in your system.
/CLASSIFY or /C – classifies programs by memory usage. Lists the size of programs, provides
a summary of memory in use, and lists the largest memory block available.
/DEBUG or /D - displays status of all modules in memory, internal drivers, & other information.
/FREE or /F - displays information about the amount of free memory left in both Conventional
& Upper memory.
/PAGE or /P - pauses after each screenful of information.
Partitioning of Hard Disks – FDISK.
Hard disks (not floppies) can be divided into partitions or sections.
MS-DOS supports 2 types of partitions: (i). Primary DOS partitions, and
(ii). Extended DOS partitions.
The primary DOS partition is the area that stores the DOS System files. It is therefore,
designated as the Active partition.
An Extended DOS partition is optional, and is used to divide the hard disk into more that one
section.
To configure (or create partitions in) hard disks for use with MS-DOS, use the FDISK program.
 To view your current drive status (display partition information);
At the MS-DOS Prompt, type: FDISK/Status↵
-OrType: FDISK↵, and then choose Display Partition information.
92
�MS-DOS 6.x
The FORMAT command creates a new root directory & 2 File Allocation Tables (FATs); one
for redundancy, on the disk. It can also check for bad areas on the disk.
Root directory - is the starting point from which all other directories branch. It keeps a listing
of all files along with the address of the first cluster assigned to each file.
\
File Allocation Table (FAT) - is a table of entries describing how each cluster on disk is
allocated. Each cluster has a specific entry and is marked as available, reserved, bad, the last
entry for a file, or used.
Note. FORMAT creates an image of the disk. The ‘image’ includes copies of the FAT and all
directory entries.
Warning:
 Format destroys (erases/removes) any existing files or information on the disk being
formatted. Therefore, a disk should be formatted only if the information in it is no longer
needed.
 You should never format drive C: (or hard disk).
The FORMAT command can be used to prepare an ordinary or a System disk. Ordinary
diskettes are used for backing-up files & programs, whereas System disks are used for starting (or
booting) the computer.
Preparing Ordinary Diskettes.
Syntax:
FORMAT [drive:]
(a). To format a diskette in drive A for backing up data using the hard disk, type:
C:\>FORMAT A:/V↵
/V – is used to specify the volume label, which is used to identify the disk.
/B – allocates space on the formatted disk for System files.
/C – tests clusters that are currently marked “bad”.
/Q – performs a quick format.
Quick format deletes the File Allocation Table (FAT) & the Root directory of a disk, but
does not scan the disk for bad areas.
Preparing System Diskettes.
Your computer needs the system files to start.
A System disk – a disk that contains the MS-DOS system files necessary to start MS-DOS.
System disks are used for booting (starting) microcomputers that runs or uses the MS-DOS
operating system.
There are 2 ways of preparing System disks:
(i). Format a newly partitioned disk, and then copy System files to it.
(ii). Add the Operating system files to a formatted disk.
Format a newly partitioned disk in drive A & copy system files to the formatted disk.
A System disk can be prepared by adding the /S switch that enables DOS system files to be
copied to the diskette after formatting.
At C:\>, type: FORMAT A:/S↵
System startup files will be automatically copied after your drive is formatted.
94
�MS-DOS 6.x
Adding System files to a formatted disk.
Use the SYS command to copy MS-DOS system files & Command Interpreter to a disk you
specify, making the disk bootable.
Syntax:
Drive1:\>SYS drive2:
Drive1 – the location of the system files.
Drive2 –the drive where the files are to be copied to.
 To copy system files from drive C to drive A.
At C:\>, type: SYS A:↵
 To SYS your drive C (to copy system files from A to C).
At A:\>, type: SYS C:↵
If the procedure is successful, a “System transferred” message appears.
The following system files are copied to your disk during the SYS procedure.
(i). IO.SYS
(ii). MSDOS.SYS
(iii). COMMAND.COM
If the procedure is not successful, check to make sure you’re typing the correct drive letter
for your drive.
To copy the Command.Com file to disk A, type:
COPY\COMMAND.COM A: ↵
The FORMATTING process.
There are 3 parameters (factors/considerations) that define how information is stored on
diskettes:
Volume
A single diskette is considered to be 1 volume.
Files
Information is stored on diskettes in units called Files. Files occupy physical
tracks on the disk.
Records
Information in files is further broken down into records, which occupy Sectors on
a disk. A group of sectors is called a Cluster.
During formatting, the surface of a disk is broken into Tracks (80 tracks for high density) each
with 512 bytes.
As the heads move toward the centre of the disk, each track is checked for integrity (reliability)
and is divided into Sectors (8 or 9 sectors, depending on the type of disk).
Formatting creates 4 parts:
1. Boot sector, which is accessed during booting.
2. The File Allocation Table (FAT).
3. The Root directory/folder.
4. The Data space for storing data.
The outer track (Track 0) is used for storing Systems information such as boot-sector
information & the File Allocation Table (FAT).
FAT contains information on the location of the files in the disk. It also holds system
information for booting up, especially in system diskettes.
UNFORMAT command.
The UNFORMAT command is used to restore a disk that was erased by the FORMAT
command to its former state if the disk was not formatted using the /U switch to specify an
“Unconditional” format. If the /U switch is used, then all the data on the disk is destroyed.