Disk Operating System
Disk Operating System
Post
Boot Record
Dos Kernel
Device Drivers
Config.sys
Command.com
Autoexec.Bat
Dos prompt
If the POST find any error or malfunctioning of the hardware, it has four different
methods of indicating the error.
(a) Display error massage as error code.
(b) Output the different tomes (short or long) at the speaker.
(c) Output the check points on Port A of programmable peripheral interface
(PPI)
(d) Display a detailed error message.
With the help of the above error indicating methods, it becomes easy to locate and
rectify the error that occurs in a PC.
BOOT RECORD
Once the POST performs the job of checking the computer and its
attached devices, the control is then transferred to "BOOT RECORD". The main
function of "BOOK RECORD" is to convey the following information which it requires to
know to access information from disk.
6. The most important part of Boot record is to find out whether the disk is
bootable or not.
DOS KERNEL
From the boot record the control is then transferred to the most important phase called
DOS KERNEL.. DOS KERNEL is made up of two special hidden system files namely
IO.SYS and MSDOS.SYS. DOS kernel works in tandem with COMMAND.COM for
interfacing the computer, the user and the programs.
IO.SYS
IO.SYS provides the basic facilities for handling the input and output (I/O device)
such as keyboard and the display on your terminal screen.
MSDOS.SYS
MSDOS.SYS is the control program that runs everything OR This is a program for
Application program to use it contains special subprograms to make many commonly
easy for programmer.
CONFIG.SYS
The CONFIG.SYS file is a text file that contains special commands. these commands
configure your computer's hardware components. so that MS-DOS and applications can
use them. When MS-DOS starts, it carries out the commands in the CONFIG.SYS file.
Typically, the CONFIG.SYS file is located in the root directory of current drive.
COMMAND.COM
After setting the computer to suit the user's needs, the control is then transferred to
"user interface" or "command interpreter" or COMMAND.COM This lie gets loaded
into memory and then takes up the role of "policeman", who is on constant vigil to help
out people in trouble.
The command processor consists of four distinctly separate parts:-
(1) A RESIDENT PORTION resides on memory immediately after
MSDOS.SYS & its data area. This portion contains the routines to
process interrupts of
Critical error handling
Control break handling
Terminate address.
This includes displaying error messages and interpreting the reply Abort,
Retry or lgnore. All the DOS error handling is done within this position of
the command processor.
(2) AN INITIALIZATION PORTION follows the resident portion. This section
contains the Autoexec file processor setup.
(3) THE TRANSIENT PORTION is loaded at the high end of memory which is
command processor itself. It contains:-
All the internal command processors.
The batch file process.
Produces the system prompt.
Accepts the keyboard commands & causes it to be executed.
(4) THE LOADER PORTION loaded with a routine to load & execute external
commands, i.e., files with the extension .COM and .EXE. This portion is at
the highest end of memory and is invoked but the EXEC function called to
load the program.
AUTOEXEC.BAT
An AUTOEXEC.BAT file lets you to run programs automatically when you
start MS-DOS OR Some information you want to flash out when you start the computer.
HOW TO (RE)BOOT COMPUTER
(A) Set CPU button to ON.
(B) Press Reset Button.
(C) Press "CTRL+ ALT+ DEL"
(2) Commands must be spelled correctly. Incorrectly spelled commands may result in a
"Bad command or file name" message.
(3) A colon (:) must be included when specifying a drive letter.
(4) Commands are usually followed by one or more parameter.
(5) To abort a command, press control and c (CTRL+C) and Control and Break
(CTRL+BREAK) at the same time.
(6) The DOS prompt consist of the default drive letter and the character ">" E.g.:-
C:\>
(7) Commands start executing only after you press the ENTER key.
DOS COMMANDS
INTERNAL COMMANDS
DATE
This command is used to enter or change the date known to the system
Syntax : - DATE [mm/dd/yy ]
Ex : - c:> DATE
TIME
This command is used to enter or change the time known to the system.
Syntax : - TIME [ hh : mm:[ss[.xx]]]
hh = 0 - 23
mm = 0 - 59
ss = 0 - 59
xx = 0 - 99 (hundredths of a second)
Ex. : - C:\> TIME
CLS
This command is used to clear the screen.
Syntax : - CLS
Ex. : - C:\> CLS
VOL
This command is used to see the volume label of the specified drive.
Syntax : - VOL [Drive name:]
Ex. : - C:\> VOL
VER
This command is used to see the MS - DOS version.
Syntax : - VER
Ex. : - C:\> VER
Disk Operating System By Naman kumar navikunjan/4
DIR
This command lists the files and the sub directories in a directory except the hidden
system files.
Syntax:- DIR[drive:] [path ] [file name [.ext]] [/p] [/w] [/A] [/s]
Ex.:- C\> DIR ( display all files)
C:\> DIR NAME ( display only specified name)
C:\> DIR/P (display pause wise)
C:\> DIR/W (display width wise)
C:\> DIR/A (display files with specified attributes )
C:\> DIR/S (display all files in a directory and all subdirectory)
C:\> DIR ABC.*( display all files having name ABC)
C:\> DIR ?.*( display all files having file name one character)
MD ( MKDIR)
This command is used to creates a directory in the specified disk.
Syntax :- MD [drive:] [path ] <directory name>
Ex. :- C:\> MD RAJ
CD (CHDIR)
This command changes the DOS current directory of the specified directory OR displays
the working directory.
Syntax :- CD [drive:] [path] <directory name>
Ex. :- C:\> CD RAJ
CD..
This command puts in the parent directory to the working directory.
Ex. :- C:\> ABC\RAJ> CD..
C:\>ABC>
CD\
This command changes the current directory of the default drive to its root directory .
Ex.:- C:\ABC\RAJ> CD\
C:\>
RD (RMDIR)
This command removes a directory from the specified disk.
Syntax :- RD [drive:][path] <directory name>
Ex. :- C:\> RD RAJ
RESTRICTION:-
Directory should be empty.
Hidden system directories can't be removed.
REN
This command is used to changes the name of the file specified in the first
parameter to the name and extension given in the second parameter.
Syntax :- REN[drive:] [path]<old file name>
<new file name>
Ex. :- C:\> REN RAJ.BAT NISHA.BAT
DEL or ERASE
This command is used to delete or erase a specified file(s).
Syntax:-DEL [drive:] [path]<filename>[p]
Ex.:- C:\>DEL RAJ.BAT
C:\> DEL*.BAT(deleted all files having extension .BAT)
C:\> DEL*.*/P
( /P option is used for confirmation before deleting each file.)
Disk Operating System By Naman kumar navikunjan/5
TYPE
This command displays the contents of a text file on the screen.
Syntax:-TYPE [drive:] [path] <filename>
Ex.:- C:\> TYPE RAJ.BAT
PATH
This command displays or sets a search path for executable files.
Syntax :- PATH [drive:] [path] ;[drive:] [path]
Ex. :- C:\> PATH A\;C:\
NOTE:-Type PATH; to clear all search- path settings and direct MS-DOS to search only
in the current directory.
Type PATH without parameters to display the current path.
PROMPT
This command set a new MS-DOS prompt.
Syntax:- PROMPT "prompt string"
Prompt can be made up of normal characters and the following special codes
$Q --> =(equal sign)
$$ --> $ (dollar sign)
$T --> Current time
$D --> Current date
$P --> Current drive and path
$V--> MS-DOS version number
$N -->Current drive
$G --> > ( greater -then sign)
$L --> < (less- than sign)
Type PROMPT without parameters to reset prompt to the default setting.
EXTERNAL COMMANDS
DOS KEY
This command is loads the DOSKEY program into memory. The DOSKEY program
recalls MS- DOS commands and enables you to edit command lines.
Syntax :- DOSKEY
Ex :- C:\> DOSKEY
NOTE :- F7 key is used to display all command into the computer memory. F9 issued to
select a line number. ALT+ F7 key is used to remove all the previous used command
from its memory.
DELTREE
This command deletes a directory and all the files and subdirectories that are in it.
Syntax :- DELTREE [drive:] [path] <subdirectory
name>or <file name>
Ex. :- C:\>DELTREE RAJ
MOVE
This command moves one or more files to the location specify . It can also be used to
rename files and directories.
Syntax :- MOVE [drive:] [path] <source file> <target file>
Disk Operating System By Naman kumar navikunjan/6
SCANDISK
This command detects, diagnoses and repairs disk errors. It can repair both our file
system (FAT) and physical disk, i.e. cross linked files, lost clusters, surface flaws etc.
This is more useful than CHKDSK command.
Syntax :- SCANDISK [drive name:]
Ex :- C:\>SCANDISK A:
EDIT
This command starts MS-DOS editor, a text editor you can use to creates and change
ASCII text files.
Syntax :- EDIT [drive:] [path] <file name>
Ex :- EDIT AUTOEXEC.BAT
NOTE:- After using this command we get following MENUS:-
If you want to activate menu for doing the various types of job we have to select first
character of that menu with ALT key.
DISKCOPY
This command copies the contents of the diskette in the source drive to the diskette in
the target diskette is unformatted, during the copy the disk is formatted.
Syntax :- DISKCOPY <source drive name:>
<target drive name:>
Ex. :- C:\> DISKCOPY A: B:
DISKCOMP
This command is used to compares the contents of two floppy disks
Syntax :- DISKCOMP <source drive name:>
<target drive name:>
Ex :- C:\> DISKCOMP A:B
XCOPY
This command copies files, directories and their subdirectories.
Syntax :- XCOPY [drive:] <file name> [/P] [/S] [/E]
FORMAT
This command formats a specified desk. Formatting analyzes the entire desk for
any defective tracks. This command is also used to format all new desk before MS- DOS
can use them.
Syntax :- FORMAT [drive:] [/S] [/4] [/U] [/Q] [/C]
Ex. :- C:\> FORMAT A /S/C/U
NOTE:- /S--> This option is used to copy the operating system files.
/4 --> This option is used to format a low density( DSDD) in a
high density (1.2 MB) drive.
/U --> This option is used to unformatting unsave.
/Q --> This option is used to quick formatting.
/C --> This option is used to correct the bad clusters.
Disk Operating System By Naman kumar navikunjan/7
SYS
This command creates a startup desk by copying hidden MS-DOS system files and the
MS-DOS command interpreter (COMMAND.COM) to the disk.
Syntax :- SYS < drive name:>
Ex. :- C:\> SYS A:
LABEL
This command creates, change or delete the volume identification label on a desk.
Syntax :- LABEL [drive:] [volume label]
Ex :- C:\>LABEL A:AKSHAT
TREE
This command graphically displays the structure of a directory.
Syntax :- TREE [drive name:] <directory name> [/F]
Ex :- C:\>TREE A : RAJ/F
NOTE:- /F option lists the full path of each directory and subdirectory on the specified
drive.
ATTRIB
This command sets or resets the file attributes for a single file, for selected files in a
directory or for all files in a directory level . It also display the attributes of a file.
Syntax :- ATTRIB [+R] [-R] [H][-H] [+A] [-A] [path]
<file name>
Ex. :- ATTRIB +H RAJ.BAT
NOTE:- +H --> change specified file(s) to hidden.
-H --> makes hidden file(s) visible again.
+R --> change specifies file(s) to read only.
-R --> change specifies file(s) to write only.
+A --> sets the archive attribute of a file.
-A --> clear the archive bit of the specified file.
CHKDSK
This command is used to checks the status of a disk and displays a status report. Can
also fix disk errors.
Syntax :- CHKDSK [drive:] [/F] [/V]
Ex. :- C:\>CHKDSK A /F/V
NOTE :- /F --> This option direct CHKDSK to fix errors found in a directory of FAT (File
Allocation Table)
/V --> This option display the name of each file in every directory as a desk is checked.
WARNING:- Do not use CHKDSK with the /F switch when you are running windows.
UNFORMAT
This command is used to recover files from an accidental desk format.
Syntax :- UNFORMAT [drive name:]
Ex :- C:\>UNFORMAT A:
UNDELETE
This command is used to restores files that where previously deleted by using the DEL
command.
Syntax :- UNDELETE [[drive:] [path] file name]
Ex. :- C:\> UNDELETE RAJ.BAT
MODE
This command sets operation modes for devices.
Syntax :- MODE n
Ex. :- C:\> MODE CO80
Where "n" specified one of the following values 40, 80, CO40, CO80, MONO.
NOTE :- 40 --> indicate 40 characters per line.
80--> indicate 80 characters per line.
Disk Operating System By Naman kumar navikunjan/8
MORE
This command that reads data from the standard input device, sends one screen of data
to the standard output device and then pause with the message ---MORE---
Syntax :- MORE
NOTE :- The MORE command will not work if the disk is full or write protected because to
hold input information until it is displayed. This command viewing long files.
Ex. :- C:\> TYPE RAJ.BAT | MORE
C:\> MORE <RAJ. BAT
When the screen is full, the message ---MORE--- appears on the bottom line, press any
key to see the next screen.
FIND
This command is used to searches a files, several files, or piped input for a string.
Syntax :- FIND [/V] [/C] [/N] [I] "string" [drive:] [path ]
< file name>
Ex. :- C:\> FIND /C "TEXT" RAJ. BAT
NOTE:-
/V Displays all lines NOT containing the specified string.
/C Displays only the count of lines containing the string, but does
not display the lines also.
/N Displays line numbers with the displayed lines.
/I Ignores the case of characters when searching for the string.
“string” Specifies the text string to find.
[drive:][path]filename
Specifies a file or files to search.
If a pathname is not specified, FIND searches the text typed at the prompt or piped from
another command.
SORT
Sorts input and writes results to the screen, a file, or another device
SETVER
This command causes DOS to supply a different version number to an
application. It updates a table of application that require DOS to provide an earlier
version number. We must load this table into memory by including the Command :
DEVICE = SETVER.EXE in your CONFIG.SYS file.
Syntax : SETVER <Drive:\path\application> <Version>
[/D or Delete]
Example : C:\>SETVER OLDGAME.EXE 3.3
C:\>SETVER/D OLDGAME.EXE
BACKUP
Both MSBACKUP (Backup for DOS) and Backup for Windows are used to copy
your files to one or more backup diskettes for safekeeping. In this way, if you
experience a disk drive failure or data error, you can restore your files from the backup
media.
Disk Operating System By Naman kumar navikunjan/9
RESTORE
This command restored files back to a fixed disk after they have been copied to
floppy disks using BACKUP. This command available from DOS versions 2.00 through
5.00. Later versions of DOS include its own restore utility. Windows also uses same
command.
Q. Describe the process of formatting of hard disk. What are the various
formatting options available in MS-DOS.
Ans. Make/Get a fresh set of floppies/ CDs of those operating system, want to
install in Hard Disk later. That floppy/Cd should contain FORMAT Command.
However, FORMAT command may be applied from the same disk too, but later
above disks required.
Then give the following command :-
FORMAT/U/S C:
System prompts a warning about removing all data, Press "Y" and the
formatting procedure starts. A counter appears as 1%, 2% ....100% and after
100% format completed. IF "/S" Option had been given then SYSTEM files will be
transferred to Hard Disk. After it, system prompts for enter "Volumn Label".
Either enter something upto 11 character or press enter for none and it will show
a report about disk status, i.e. how many bytes the disk have, free bytes, used
bytes by system files etc.
Q. Describe the command that you will use to analyse the directories, files
and the file Allocation Table (FAT) on the designated drive and the
process of generating a disk and memory status report.
Ans. Scandisk command is used to analyse the directories, fiels and FAT etc. It is an
utility software which was introduced in DOS 6.2. This utility detects, diagnoses,
and repairs disk errors on both uncompressed and DoubleSpace compressed
drives. Scandisk can repair both of our file system (File Allocation Table or FAT)
and physical disk errors. Examples of file system errors are cross linked files and
lost clusters. Physical disk errors include surface flaws. Scandisk also maintain a
log of repairs, i.e. what it had done in his repairing process.
Whenever Scandisk finishes checking our drive's file system, it asks us if
we want to perform a surface scan. Surface Scan takes lot of time depending
upon the size and speed of processor. It can be used as follows :-
Disk Operating System By Naman kumar navikunjan/10
Q. Describe the DEFRAG command. Write the command that will fully
defragment drive C and arrange files in alphabetical order.
Ans. File defragmentation occurs as files are read from and written back to your disk.
Files are written randomly into available space. Therefore, part of a file may be
written to one location on your disk. When another file is encountered on the disk
the system searches for the next available space. This process continues until
many of your files become fragmented, which slows down read and write
operations. The DEFRAG program is used to collect the files back into contiguous
disk sectors. This speeds up file access and therefore can noticeably improve
program performance. With the introduction of DOS 6.2, DEFRAG makes use of
extended memory. This feature enables DEFRAG to defragment larger disks
containing many more files and directories.
Type simply DEFRAG at command prompt followed with drive name. A
menu driven program appears from which we can select various options. To
Defrag the files of Drive C: we have to do following thing.
C:\> DEFRAG C:
Defragmentation starts. From the coming menu using TAB key goto Sort
option and choose Name radio buttom and press enter to start defragmenting.
It is a good idea to use SCANDISK before DEFRAG command.
Q. Describe the command that will compare the contents of one file with
the another file and displays the first ten differences between them.
Ans. COMP and FC commands are external DOS commands that compares the
contents of two specified files. Both of these commands perform similar
operations.
The most notable use of the COMP command is to compare one or more
copies of a file to the original file to verify an exact reproduction. This is the
quickest way to ensure a good quality file copy. If you suspect copy problems,
you may wish to use COMP or FC each time you make a copy of a file just to be
safe.
You can also use the COMP and FC commands to locate differences in
ASCII text files. This lets you go directly to the area of change for a visual
comparison.
Following is the function of FC command :-
FC [/A] [/C] [/L] [/LBn] [/N] [/T] [/W] [/nnnn] [drive1:][path1]filename1
[drive2:][path2]filename2
FC /B [drive1:][path1]filename1 [drive2:][path2]filename2
/A Displays only first and last lines for each set of differences.
/B Performs a binary comparison.
/C Disregards the case of letters.
/L Compares files as ASCII text.
/LBn Sets the maximum consecutive mismatches to the specified
number
of lines.
/N Displays the line numbers on an ASCII comparison.
/T Does not expand tabs to spaces.
/W Compresses white space (tabs and spaces) for comparison.
/nnnn Specifies the number of consecutive lines that must match after a
mismatch.
DOS commands, but command prompt remain hidden. Again when we apply
"ECHO ON", it appears.
In the Batch file when we use "ECHO OFF", then instructions after it does
not show on screen, only their results are shown. We can also use it to show any
message on screen as "ECHO <Message>" in batch file. To get a blank line in our
batch file report we have to give "ECHO.".
In a batch file this command is used to show any message, creating
menus etc.
which is preferable to having to recreate an entire file. You should be aware that
recovered files often have extra data at the end. This can be deleted using a
standard ASCII word processors. Be sure to check the end of the file and
eliminate any added "Garbage" as required.
Redirecting Input
To accept input from a source other than the key board, a less-than symbol (<) is used.
The symbol is placed just before the input source.
eg : C:\> label < input.txt
Redirecting Output
To send output to a destination other than the screen, enter a greater-than (>) in the
command line. The symbol is placed just before the output destination. You can also
redirect output of the DIR command to a file.
eg : C:\> dir > Rajeev
C:\> dir > prn
devices such as printer, scanner, mouse, CD-Drive etc. are controlled by there
Device Drivers which is loaded through CONFIG.SYS or AUTOEXEC.BAT.
The DOS command processor or the command interpreter is contained in the
COMMAND.COM program. This essential program controls the prompt, error
messages, other messages, DOS environment etc.
Some utilities program such as FORMAT, SCANDISK, DEFRAG etc. are used to
enhance the power of the Disk Operation System. These program is used to repair
the disk and organise it so it can work fast.
Disk Operating System By Naman kumar navikunjan/14
which files are stored in folders and folders can contain other folders are known as
hierarchical directories. Following is the example of a hierarchical directory :-
Disk Operating System By Naman kumar navikunjan/15
MS - DOS ERRORS
Disk Operating System By Naman kumar navikunjan/18
When an error is detected during reading or writing to any of the input or output device
on your system MS-DOS displays an error message called DEVICE ERROR it may
display some other massage but in case of Device Error, the system waits for you to
respond.
If you know what caused the what caused the problem, take corrective action
before choosing a respond.
DEVICE ERRORS :- If a desk or device error at any time during a command or program,
MS-DOS disk or device error occurs at any time during a command or program,
MS-DOS displays an error massage in the following format :-
Abort, Retry, Ignore
To recover from an error condition, the respond should be made in the following order :-
R --> Retry the operation because the error may not occur again. The system tries the
read or write operation again.
A --> Abort the program. The system terminates the program that requested the read
or write operation.
I --> Ignore the error condition and continue the program the system is unable to
determine whether the condition is dangerous. Be careful when choosing this response
the data may be lost.
BAD COMMAND OR FILE NAME :-
This error message is displayed when you issue an invalid command to the device
specified in the error message.
Check your command and make sure everything you are trying to do is supported.
Data error:-
This error message is displayed when MS-DOS is unable to read or write the data
correctly due to a defective disk.
Try choosing R(Retry) several times to retry the operation or choose A (Abort) to
terminate the command. Make a new copy of the disk because if it's defective, your
data may be lost.
GENERAL FAILURE :-
This error message is displayed when
Diskette type and drive type do not match
The disk is not completely inserted in the drive or the drive door is open.
The diskette is not formatted properly.
Check the disk is properly inserted or not. If you are using a new unformatted disk,
format it.
This error occurs when you try to write data on a write- protected diskette. If the disk
has a write protected tab, remove the tab before writing on the disk. If the disk dose not
have a write - protected notch, you cannot write on that disk.
MS DOS MESSAGES
The massage means that you have typed PATH and pressed the enter key to find out
what search path is but did't set a command search path.
Program too big to fit in memory
MS-DOS displays this message when the file containing the external command can't be
loaded because it is larger than the available free memory. It is possible that some
programs you have run are still using some memory. Reduce the number in the
BUFFERS= parameter in your CONFIG.SYS file, restart your system, and reissue the
command. If the same message persists, your system does not have enough memory to
execute the command.
Syntax error
This message indicate that the command format you have typed is incorrect. Check to
make sure that you have typed the correct format of the command.
System transferred
This is an informational message telling you that the system files have been transferred
during FORMAT(with /S parameter) or SYS Command processing.
Unable to create directory
MS-DOS displays this message indicating that the directory you want to create
Already exists.
A file by that name already exists in that directory.
The directory name you specified contains invalid characters or is a reserved device
name.
You attempted to add a directory to the root directory and it is full.