Вы находитесь на странице: 1из 21

Disk Operating System By Naman kumar navikunjan/1

Disk Operating System

Operating System is a set of programs that is extremely important to


activate and Co-Ordinate the activities of various hardware resources like the processor
and Input/Output devices. In other words, Operating System controls the movement of
information on in the Computer.
OR
An operating System is a collection of programs that manage System is to provide a
basic set of computer instructions to manage the flow of information in the computer.
The operating System forms the communication interface between the computer
hardware, application software programs and the user.
Computer Boot Process

Post
Boot Record
Dos Kernel
Device Drivers
Config.sys
Command.com
Autoexec.Bat
Dos prompt

POST(Power - On Self Test)

Whenever we switch on a PC a program called POWER-ON SELF TEST


(POST) is executed from the ROM-BIOS(BASIC INPUT OUTPUT SYSTEM).It checks
the hardware of the PC step by step and if it finds any error the PC will halt with an error
massage displayed on the screen. If it does not find any error, it will enable the PC for
further operation.
OR
The POST(POWER- ON SELF TEST) is a firmware which is always present in ROM-
BIOS of any PC and whenever the PC is switched "ON" the first program which
is executed is POST. Basically POST is a series of programs which checks all
the logic on the motherboard which contains the CPU and all the support
chips, the base memory on the motherboard as well as on the expansion card
and all the I/O devices that are connected with the PC.

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.

1. The number of bytes per sector


2. The number of sectors per cluster, per track, per disk
3. The number of sides
4. The total number of sectors on disk
5. The maximum no. of entries that root area can hold
Disk Operating System By Naman kumar navikunjan/2

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"

Guide lines for DOS command


(1) You can type commands in uppercase or lowercase letter or a combination of both.
Disk Operating System By Naman kumar navikunjan/3

(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.

WILD CARD CHARACTERS


The wild card characters are used to restrict the scope of a DOS command to only those
files which matches the pattern specified.
There are two types of wild card :- "*" & "?"
Where "*" can substitute a set of characters & "?" can only substitute a character at a
particular position.

DOS COMMANDS

There are two types of DOS commands :-


1. INTERNAL COMMANDS 2. EXTERNAL COMMANDS

1. INTERNAL COMMANDS :- Internal Commands are those commands which get


transferred into computer's memory. For e.g.:- DIR, COPY etc.
2. EXTERNAL COMMANDS :- External Commands are those commands which don't
get transferred into computer's memory. For e.g.:- XCOPY, FORMAT etc.

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

C:\>TYPE RAJ.BAT >PRN


NOTE :- If you wants to redirect the output a file, use filename instead of PRN.
COPY
This command is used to copies one or more files to another specified disks.
Syntax :- COPY [drive:] [path] <file name> [drive:]
[path]<filename>
Ex. :- C:\> COPY RAJ.BAT NISHA .BAT

C:\> COPY RAJ .BAT+ NISHA .BAT JEETU.BAT


C:\> COPY*.* A:

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

Ex. :- C:\> MOVE RAJ. BAT NISHA.BAT

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:-

FILE EDIT SEARCH OPTION HELP

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]

Ex. :- C:\> XCOPY A *.*/S/E


C:\> XCOPY A *.*/P
NOTE :- /S --> switches used to copies directories and lower level subdirectories
unless they are empty.
/P --> switches prompts you before copying each file to you let confirm whether
you want to create each target file.
/E--> switches copies any subdirectories even if they are empty.

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

MONO --> specified a monochrome display adapter with a


constant display width of 80 characters per line.

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

SORT [/R] [/+n] [[drive1:][path1]filename1]


[> [drive2:][path2]filename2] [command |]
SORT [/R] [/+n] [> [drive2:][path2]filename2]

/R Reverses the sort order; that is, sorts Z to A, then 9 to 0.


/+n Sorts the file according to characters in column n.
[drive1:][path1]filename1 Specifies file(s) to be sorted
[drive2:][path2]filename2 Specifies a file where the sorted input is to be stored.
command Specifies a command whose output is to be sorted.

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

When we run backup first time, then we are prompted to perform a


compatibility test. This ensures that Backup is setup properly for your computer.

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. Write the commands to display and print the DOS files.


Ans. Describe TYPE command to see file's content (With MORE command)
Print May be taken through ">PRN" with Type command. "PRINT", an
external command can also be used to print a text file. To do so type the
command in following way :-
PRINT <Filename>
This command print from background. Also printing through "EDIT"
command may be explain.

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.

Various options available in MS-DOS for formating is :-


/S - To transfer system file after formatting.
/U - To does not save any unformatted information
/C - To check for bad cluster and if not repairable then mark it as bad
area, that operating system does not write anything there later.
/V:label - To tell about volume label after formatting.

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

Syntax :- SCANDISK [drive name:]


Ex :- C:\>SCANDISK A:

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.

Q. What is the purpose of ECHO command in a batch file?


Ans. This command is used to turns off or on all the commands to display on
screen after using it. We can use this command on command prompt and in a
Batch file too.
At the command prompt when we type "ECHO OFF", then command
prompt disappears from the screen. However we can give instructions through
Disk Operating System By Naman kumar navikunjan/11

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.

Q. Describe the purpose of FDISK command in DOS.


Ans. The FDISK command is an external DOS command that prepares a fixed
(or hard) disk for use. This command is available with DOS versions 2.00 and
later. It is used to organize your fixed disk into partitions, which allocates disk
space to separate usable areas.
Each partition is assigned a logical drive letter, like C, D and E when more
than one partition is used on a single disk device. Because the maximum amount
of disk space addressed by DOS versions released prior to 4.01 was 32
megabytes, it was necessary to be familiar with partitioning strategies offered b
the FDISK command in order to organize disk drives having storage capacities in
excess of the 32-megabyte barrier. Smaller disks are normally given a single
DOS partition.
The FDISK command is used after your fixed disk has received a low-level
format. Performing this procedure erases all stored data. Therefore, if your hard
disk is already formatted, then use it carefully.
Partitions created with FDISK command is generally used to keep two or
more operating system in each partition. Sometimes, people also make partition
in disk to keep different types of data in different drives. So that when one
partition standing any problem than another can be use. Suppose that operating
system and application programs may be keep in Drive C and working data in
Drive D. Songs or games may be keeep in Drive E and so on.

Q. How is MSBACKUP command an improvement over the BACKUP


command?
Ans. BACKUP command is used with fixed disk systems using DOS versions
2.00 through 5.00. Later it changed into MSBACKUP command. BACKUP
command was a charater based command in which a user remembered lot of
switches but MSBACKUP command is a menu driven command, so now a user
can select their choices from menu to take backup.
Backup is an external command used to copy files automatically from a
fixed disk to floppy disks. BACKUP lets you copy selected files, all files in a
specified directory or every file on the fixed disk. It also lets you copy only those
files that have been changed or created from last backup. If the files being
copied exceed the capacity of the target floppy disk, BACKUP prompts you to
change disks and then to continue the process.
MSBACKUP if using, then first of all a compatibility test will be performed.
The compatibility test is used to tell the Backup program about your system and
user can configure the backup as per his requirement. Through MSBACKUP
command a user can also verify backup data and compare the data with original
data.

Q. Explain the purpose of the RECOVER command?


Ans. The RECOVER command is an external command available on DOS
versions 2.00 and later. It is used to recover one or more files from a defective
disk.
Assume that you are experiencing problems reading or copying a file
named LETTER.TXT in drive B. You suspect data errors. You may be able to
recover the file using the command RECOVER B:LETTER.TXT.
The bad data is often omitted by eliminating a bad disk sector from the
file. If recovery is successful, you may be able to recreate the discarded data,
Disk Operating System By Naman kumar navikunjan/12

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.

Q. What is the function of SUBST command?


Ans. The SUBST command was introduced in DOS versions 3.10. The command
word SUBST is an abbreviation for substitute. It is an external command that lets
you assign a disk drive designator to a drive and file path of your choice. If you
have a subdirectory designated as C:\DOS\UTIL, you can use SUBST to shorten
this notation to a single disk drive letter. For example, the command
SUBST E: C:\DOS\UTIL return
E: => C:\DOS\UTIL
lets you use E: as a shorthand form for the notation "C:\DOS\UTIL". This
shows you current substitution settings. You can see a file directory of
C:\DOS\UTIL with DIR E:.
A substitution setting is disconnected with SUBST E:/D. This cancels the
drive and/or pathname relationship associated with E:.

Q. Explain the Redirecting command Input and Output?


The internal and external DOS commands normally take their input from the
keyboard (standard input device) and display their output on the screen (standard
output device). However, you can instruct the DOS to accept input from a source other
than the keyboard and send output to a destination other than the screen by redirecting
and piping.

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

Adding Output (Appending)


If you want to add the new data to the end of an existing file, enter two greater-than
symbols in the command line.
eg : C:\> Dir/s >> Rajeev

Redirecting command Input and Outpur


eg : C:\> SORT < NAMES > LIST
This command sorts the contents of file "NAMES" alphabetically and stores it in a
file named "LIST".

Q. How is MS-DOS Organised? Describe what is I/O system, the Command


Processor and Utilities in MS-DOS.
Ans. MS-DOS is an operating system developed by Microsoft Corporation. MS-DOS is a
large collection of different types of files among which minimum four files are
compulsory for MS-DOS, i.e. IO.SYS, MSDOS.SYS, COMMAND.COM & DRVSPACE.BIN.
Other files such as TREE.COM, EDIT.COM etc. are additional files which is
necessory when we use External command of DOS.
IO.SYS, MSDOS.SYS, CONFIG.SYS, HIMEM.SYS, RAMDRIVE.SYS etc. are those files
who control the Input and Output devices of computer, i.e. how a user instruct the
computer and how the operating system control different part of the computer.
Standard input and output devices are controlled by IO.SYS and MSDOS.SYS. Other
Disk Operating System By Naman kumar navikunjan/13

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

Q. What are hierarchical directories? Illustrate a structure of a hierarchical


directory.
Ans. We can store number of files on our disk. But if all the files will be stored on same
location then searching a file will become much more lengthy. So, we keep all the
files in some folders. These folders may also contain sub-folder and so on. These
folders are used to keep related files together. System of storing files on disks, in

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

Additional Knowledge of DOS


BATCH FILE
Batch files are ASCII text files that store a series of commands that are later
automatically executed line-by-line when you run the file. It’s Extension should always
be .BAT. A batch file may include following elements :-
DOS commands
Program names
Batch language commands
Command line and environmental variables

Different commands used in a Batch file are :-


1. @ - Turns off the display of command followed by @.
2. Echo - Turns off or on all the commands to display on screen after using it.
3. Pause - Prompts to strike any key to continue...
4. Call <Filename> - Runs a second batch file and returns to the batch file from
which it was called.
5. Goto <Label> - Used to transfer the control of program at any specific label.
6. <:Labelname> - Label is used to give a specific name to a line of batch file.
7. %0 - %9 - Lets you substitute from one to ten character strings in a batch file
command line.
Suppose that we have created a file named REPORT.BAT :-
C:\>COPY CON REPORT.BAT
@ECHO OFF
GOTO %1
:SALE
TYPE SALE.TXT
GOTO END
:BUY
TYPE BUY.TXT
GOTO END
:MARKET
TYPE MARKET.TXT
:END ^Z
1 File(s) Copied.
C:\>REPORT <SALE> <BUY> <MARKET>
Now when we type any string followed with REPORT then %1 will be
replaced with that string and then labeled set of command will be executed.
8. IF - This command is used to compare two different objects. These comparison
may be of three types :-
(a) Checking about existing of a file
(b) Comparison between two words, whether they are equal or not
(c) To know about ErrorLevel
(A) IF [NOT] EXIST <FILENAME> COMMAND - This command checks the existance of a
file and if returns True then execute command of the same line, otherwise control will
be transferred to next line.
@ECHO OFF
IF EXIST %1 GOTO YES
ECHO %1 FILE DOES NOT EXIST
GOTO END
:YES
ECHO %1 FILE EXIST
:END

(B) IF [NOT] <STRING1>==<STRING2> <COMMAND> - This command compares two


text strings and execute same line’s command if the both is same, otherwise control
will be transferred to next line.
@ECHO OFF
IF .%1 == .GOTO Errmsg
Disk Operating System By Naman kumar navikunjan/16

ECHO You have typed %1


GOTO end
:Errmsg
ECHO Please type a parameter
:End
Save this file with IFF.Bat.
C:\> Iff abc.txt
This command line replace %1 with abc.txt, so .abc.txt will not be same as . (i.e.
no any parameter), so condition become false and next line will be executed, i.e. “You
have typed abc.txt”.
C:\>Iff
This command line have no any second parameter, so now %1 will not have
any value and .==. will become true so control will be transferred to :Errmsg and
we will get “Please type a parameter”.

(C) IF [NOT] ERRORLEVEL == <EXITCODE> <COMMAND> - When we run any program


then after completing its execution, it returns a code to OS, who tells OS that whether
the program executed successfully or not. If any error had been appeared during
the execution then what was it. DOS stored this code in a variable “ErrorLevel”. So,
through this variable, if used with “IF” command, we can know about the error.
Exit code Description
4 Lack of Memory
3 Fatal Error
2 Ctrl + C was pressed during the execution
1 Non Fatal Error
0 Program Executed successfully.
@ECHO OFF
XCOPY FF.BAT TEMP
IF ERRORLEVEL 4 GOTO MEM
IF ERRORLEVEL 3 GOTO DISKERR
IF ERRORLEVEL 2 GOTO BREAK
IF ERRORLEVEL 1 GOTO NON
IF ERRORLEVEL 0 GOTO OK
:OK
PAUSE
ECHO COPY COMPLETED
GOTO END
:NON
PAUSE
ECHO A NON FATAL ERROR APPEARED!
GOTO END
:BREAK
PAUSE
ECHO CTRL + C WAS PRESSED
GOTO END
:DISKERR
PAUSE
ECHO FATAL DISK ERROR APPEARED
GOTO END
:MEM
PAUSE
ECHO NOT ENOUGH MEMORY
GOTO END
:END
ECHO BYE!
9. CHOICE - Waits for the user to choose one of a set of choices.
CHOICE [/C[:]choices] [/N] [/S] [/T[:]c,nn] [text]
/C[:]choices Specifies allowable keys. Default is YN
/N Do not display choices and ? at end of prompt string.
Disk Operating System By Naman kumar navikunjan/17

/S Treat choice keys as case sensitive.


/T[:]c,nn Default choice to c after nn seconds
text Prompt string to display
ERRORLEVEL is set to offset of key user presses in choices.
10. FOR - Runs a specified command for each file in a set of files.

FOR %variable IN (set) DO command [command-parameters]

%variable Specifies a replaceable parameter.


(set) Specifies a set of one or more files. Wildcards may
be used.
command Specifies the command to carry out for each file.
command-parameters
Specifies parameters or switches for the specified command. To use the FOR
command in a batch program, specify %%variable instead of %variable.
11. REM - This command is used to give comment line in batch file.
Rem Developed by Rajeev Ranjan Kumar

CONFIG.SYS (SYSTEM CONFIGURATION COMMANDS)


In order to make the computer system work efficiently, the DOS contains certain
system configuration commands. These are described below :
1. FILES - Sets the maximum allowed number of simultaneously opened files. The
syntax is :
FILES = n
The n parameter indicates the maximum number of concurrently open files.
Default value is 8; maximum numbers is 255. If you exceed the maximum
number of open files during processing, DOS displays the message "Too many
files are open".
Example : FILES = 60

 Each increment to this parameter decreases the amount of RAM available to


application by 128 bytes. Therefore it serves no purpose to set this parameter
any higher than the maximum possible number of files for our application.
2. BUFFERS - A buffer is an area of memory set aside for temporary data storage.
Buffers can speed up system performance by reducing the number of times DOS
must directly access the disk. However, each Buffer takes up about 530 bytes of
RAM reducing the amount of memory available for processing. Too many buffers
will slow down the system. Buffers command is used to sets the number of disk-
read buffers.
Buffers = n (n may be 1 to 99)
where n is the number of the buffers to be used by DOS.
3. COUNTRY - This command is used to start our system with a non United States
keyboard and display character set.
Syntax : COUNTRY = CODE, PAGE, DRIVE:\PATH\COUNTRY.SYS
Example : COUNTRY = 044,, C:\DOS\COUNTRY.SYS
Where 044 is the code for united kingdom, second comma is used to use
the default page and after it location of Country.Sys file is defined. Default
country code is 001 of United State.
4. DEVICE - Different devices of our system requires some additional files to work
properly. To do so we have to install and give accurate locations of that files and
also it should be mentioned in booting process. DEVICE command is used to
state the location of this type of file and because it is mentioned in CONFIG.SYS
file, so automatically at the time of booting all the Device drivers are loaded.
Example : Device = C:\MOUSE\MOUSE.DRV

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.

NOT READY ERROR:-


This error occurs when the device, usually a drive or printer, specified in the message is
not ready to accept or transmit data for disk drives make sure that the diskette is
formatted and the drive door is closed and then retry the operation. For printer assure
that the printer is on, on -line, not busy and has sufficient paper, then retry the
operation.

Sector not fond error :-


This error usually means that the disk has a defective spot so that MS -DOS cannot
find the requested information because the sector containing the data could not be
located on the disk.
Either rerun the command with a different disk or copy all files from the
disk onto a good disk and then try to reformat the defective disk.

Write fault error :-


This error occurs when MS -DOS is unable to write the data to the specified device.
Make sure the disk is properly inserted in the drive and choose R for Retry. If you get
the same massage, choose A for Abort and rerun the command with a different disk.

Write protect error :-


Disk Operating System By Naman kumar navikunjan/19

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.

File allocation table bad :-


This error occurs while reading or writing data on a faulty disk. possibly the disk was
incorrectly formatted or not before use. If you get the same massage even after
formatting the disk, the disk is unusable.

MS DOS MESSAGES

Abort edit ( Y/N)?


This message is displayed when you specify Q command to quit the editing session
without saving changes in EDLIN. Type a Y to end the edit or type a N to continue
editing the file.
Access denied
This message is displaced when the specified command violates the access mode of the
file, subdirectory, or device involved, e.g. If you try to write to a file marked read-only, or
read a file that is write or open a subdirectory as a file.
Are you sure (Y/N) ?
MS-DOS displays this message when you try to delete all files in the working directory
by using the *.* wildcard.
Type Y (for Yes) to delete all the files or N (for No)
Attempted write - protect violation
This message mean that the disk you are trying to format is write- protected.
Bad command or file name
MS- DOS displays this message when the command you just entered is not a valid
DOS command.
Check the spelling of the command and re-enter it. If the command name is
spelled correctly, check to see that the default drive contains the external command or
batch file you are truing to execute.
Bad or missing command interpreter.
This massage is displayed when MS -DOS is unable to find the COMMAND.COM file on
the disk; either the files is missing from the root directory, or the file is invalid, this
message also appears if COMMAND.COM has been removed form the directory it was
in originally when DOS was start to the CONFIG.SYS file contains any syntax
error/invalid parameter.
Either restart the system with a disk that contains the COMMAND.COM file or copy the
COMMAND.COM file from your backup MS-DOS disk onto the disk used to start MS-
DOS.
Disk boot failure
This message displayed when an error occurs while loading MS-DOS into memory.
Restart the system. If this error persists, place a backup DOS diskette in drive X: and
restart your system.
Disk unsuitable for system disk
MS- DOS displays this massage while formatting a diskette using /S parameter and the
format command detects a bad track on the disk where the DOS files should reside.
Use this disk to store data only.
Error in .EXE file
This message indicates that the .EXE file you have asked MS-DOS to load has an
internal format.
You cannot run this program. Check to make sure you are using the correct
version of MS-DOS. If you are using a program you wrote yourself, go through the
LINK procedure again.
File cannot be copied onto itself
This massage is displayed when you try to copy a file, using COPY or XCOPY, and place
the copy ( with the same name as the original) in the same directory and on the same
drive as the original file. Change the name given to the copy, or put it in a different
directory, or put in on another disk.
Disk Operating System By Naman kumar navikunjan/20

File creation error


This message is displayed when you try to add a new file name or replace a file that
already exists in the directory, or there was not enough space for the file. If the file
already exists, it is read-only file and cannot be replaced. This error message may also
occur if the root directory, or a hidden (or system) file.
File not found
This message is displayed when MS-DOS could not find the file that you specified on
the command or command parameter.
Retry the command using the correct filename.
Format another (Y/N)?
FORMAT displays this message when it has finished formatting a disk . Type "Y" if you
want to format another disk, or type "N" if you don't.
Insert disk with \ COMMAND.COM in drive X:
and strike any key when ready
This massage indicates that MS-DOS is attempting or reload the command processor,
but COMMAND.COM is mot in the drive that DOS was started from.
Insert the DOS diskette in the indicated drive and press any key.
Insert DOS disk in drive X:
and strike any key when ready
This message means that you have typed the FORMAT command using /S parameter,
so that FORMAT is trying to load the DOS files, but the indicated drive X: does not
contains the DOS diskette.
Insert the DOS diskette in the drive specified and press any key.
Insufficient disk space
MS-DOS displays this message to indicate that the disk does not contain enough free
to perform the specified operation.
If you suspect this condition is invalid, run CHKDSK to determine the status of the disk,
otherwise use another disk and retry the command.
Invalid date
This message indicates that you have entered an invalid date or delimiter. The only
valid delimiters in a date entry are hyphens (-) and slashes(/). Re- enter a valid date.
Invalid media or track O bad-disk unusable
MS-DOS displays this errors message when the FORMAT command is unable to format
track 0 on the specified media. This error occurs :-
Track 0 is unusable. track 0 is where the root record, File Allocation Table and
directory must reside. If track 0 is bad, the disk is unusable.
The diskette type and drive type are incompatible. If you try to format a double -
sided 320/360 KB diskette in a high - capacity, 1.2MB drive; or a high capacity 1.2MB
diskette in a double sided 320/360KB drive.
In this case retry the format command specifying the /4 parameter.
Invalid path, not directory
or directory not empty
This massage is displayed while removing a sub- directory using RMDIR Command. This
error occurs if
The specified path is not a valid directory name.
The directory you specified still contains entries for files or other subdirectories ( with
the exception of the .and .. entries).
you can't remove a current directory. Chang to a different subdirectory and try
again.
Invalid path or file not found
MS-DOS display this message when you specify a wrong directory or file name with the
command.
Invalid time
This message indicates that you have entered an invalid time or delimiter. Re-enter the
correct time. The only delimiters are
Colon(:) between the hours & minutes
Colon(:) between the minutes
Period(.) between the seconds and hundreds of a second.
No path
Disk Operating System By Naman kumar navikunjan/21

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.

Unrecognized command in config.sys


MS-DOS displays this message if while starting up the system an invalid command was
detected in the configuration file CONIG.SYS.
Correct the invalid command and restart DOS.

Вам также может понравиться