You are on page 1of 36

Revision no.

: PPT/2K804/04
PPT/2K403/02

Disk Operating System & Commands


Revision no.: PPT/2K804/04

History of DOS

• Towards the 1980s, a number of personal computers had


appeared on the market, based on 8-bit microprocessor chips
such as the Intel 8080.
• IBM made the decision to enter the market with a 16-bit
processor, the Intel 8088.
• IBM realized that it did not have time to develop its own
operating system and at that time CP/M written by Gary Kildall
from Digital Research dominated the market.
• IBM had negotiations with Digital Research but the
negotiations did not result in an agreement.
• IBM then had given the contract to write the new OS to
Microsoft.

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

History of DOS (contd )

• In 1979, a small company called Seattle Computer Products


decided to write its own operating software to test some of its
Intel based products which was called QDOS (Quick and Dirty
Operating System) made by Tim Patterson.
• Microsoft bought the rights to QDOS for $50,000 keeping the
IBM deal a secret from Seattle Computer Products.
• Microsoft made slight changes to QDOS and then presented
"Microsoft Disk Operating System" or MS-DOS to IBM.
• IBM PC was announced in August 1981, with version 1.0 of
MS-DOS.
• More than 50 other hardware manufacturers also used DOS,
after IBM selected MS-DOS.

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

Microsoft DOS

• Microsoft designed DOS to run on an 8086 processor and


never truly upgraded DOS to take advantage of the more
advanced Intel processors' protected mode.
• MS-DOS remains as it began, a single-tasking OS.
• Interface of DOS was command line, meaning that there was
no mouse, no menus, or any graphical components.
• Text commands were entered from the keyboard and the
computer's response appeared as text on the monitor.
• DOS manifests each program and piece of data as an
individual file.
• Names are broken down into two parts: the filename and the
extension.
© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

Microsoft DOS (contd)

• Filenames can be no longer than eight characters and


extension, which is optional, can be up to three characters
long.
• No spaces or other illegal characters (/ \ [ ] | < > + = ; , * ?) can
be used in the filename or extension.
• The file name and extension are separated by a period, or
"dot." and this naming system is known as the "eight dot
three" (written as "8.3") system.
• Examples of DOS filenames:
– WORD.EXE
– SYSTEM.INI
– AJAY.DOC

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

Drives and Directories

• DOS assigns a drive letter to each hard drive partition and to


each floppy or other disk drive.

• DOS cannot support more than two floppy drives and are
assigned drive letters A: and B:

• Hard drives start with the letter C: and can continue to Z: if


necessary.

• DOS uses a hierarchical directory tree to organize the contents


of these drives.

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

DOS Structure: Three Main Files

• DOS operating system is composed of three main files,


accompanied by roughly 80 support files.
• Three main files of DOS are IO.SYS, MSDOS.SYS and
COMMAND.COM.
• IO.SYS handles all the talking to the BIOS and hardware.
• MSDOS.SYS is the primary DOS code, often called the kernel.
• COMMAND.COM actually interprets commands typed into the
computer and passes that information to MSDOS.SYS. It is
also called the Shell or command interpreter.

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

DOS Commands

• It has two types of commands


• Internal Commands
– Code for these commands is loaded into computer’s RAM
memory as part of the OS at boot up and these commands are
available at all time.
– Egs. dir, del, md, cd, rd, type, time, date, cls etc.
• External Commands
– Code for these is kept as files on the boot disk or on the DOS
directory and must be loaded into RAM Memory when required.
– DOS flushes the external commands from the memory to make
more room for other commands or applications.
– Egs. format, xcopy, help, edit, sys, fdisk etc.
© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

Internal DOS Commands

• These commands reside in computer’s memory and can be

executed immediately, when the DOS prompt (:>) is displayed

on the screen.

• Internal command routines are loaded onto the memory as a

part of the boot-sequence, while the external commands

routines reside as files in the disk.

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

Internal DOS Commands Examples

DIR To view the contents of the directory


CD To change from one directory to another
MD To make a new directory
RD To remove or delete a directory
TYPE To display the contents of a text file
COPY To copy one or more files to another location
REN To change the name of a file or files
DEL To delete a specified file or a group of files
CLS To clear the screen

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

DIR

• Syntax
– dir {drive:}{path}{filename}{.ext}{/p}{/w}{/a{{:}attribute}}
{/o{{:}sortorder}}{/s}{/b}{/l}

• Used to view the contents of the directory.


• The following are the dir command switches:
– /p pauses between each screen-full display.
– /w displays the listing in wide format.
– /a displays only the names of directories and files with the
specified attribute.

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

DIR (contd.)

• When /a option is not used, dir displays all files except those
with hidden or system attribute. Any combination of values
can be used.

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

DIR (contd.)

– /s lists all occurrence of filename in specified directory and its

subdirectories.

– /b lists, one per line, each directory name or filename, (including

the extension). Suppresses the heading and the summary

information. The /b switch overrides the /w switch.

– /l displays unsorted directory contents in lowercase. Does not,

however, convert extended characters into lower case.

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

DIR (contd.)

• Examples
– To list all the files starting with alphabet “a” having any
extensions
c:\> dir a*.*
– To list all the files starting with alphabet “a” having extension of
“.txt”
c:\> dir a*.txt
– To list all the files starting with “a” having 2nd & 3rd character
position to be any alphabet with extension “.txt”
c:\> dir a??y.txt

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

CD

• Syntax
– cd {drive:}{path}{..}
• Used to change from one directory to another directory.
• Examples
– To change the current drive and directory
a:\>cd c:\word
– To return to the parent directory from the current child directory,
use double dot (..) parameter.
c:\word\lookup> cd..
– To return to the root directory from any position, only the
backslash parameter needs to be issued.
c:\word> cd \
© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

MD

• Syntax
– md {drive:}{..}{path}{name}

• Used to make a new directory.


• Examples
– To create a new subdirectory from the current directory the
required parameter is the name.
c:\program> md data
– To make new subdirectory in any directory, other than the current
directory, the path must be provided.
– C:\> md \word\temp

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

RD

• Syntax
– rd {drive:}{..}{path}{name}
• Used to remove or delete a directory.
• Example
– To delete directory which is not a subdirectory of the current
directory, the path must be provided.
C:\> rd \word\temp
• While removing any directory using the ‘RD’ comand, the
directory should be empty. If we try to delete the directory
consisting of sub-directories and files, then it gives an error
message saying “ directory not empty”.

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

TYPE

• Syntax

– type {drive:}{path}{filename}

• Used to display the contents of a text file.

• Example

– To view the contents of a file named ‘test’, command would be

C:\> type test.txt

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

COPY

• Syntax
– copy {con}{/a|/b}{{source {/a|/b}}{+source {/a|/b}}{+ ...}} {destination
{/a|/b}}{/v}{printerport}
• Used to copy one or more files to another location.
• Example
– To copy a file from source to a destination in another drive the
path must be specified
A:\>copy thisfile.doc c:\word\thatfile.txt
– To copy a file directly from the keyboard or to create a file
C:\>copy con prog
– Using con and printer port name you can copy a file directly from
the keyboard to the printer
A:\>copy con lpt1
© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

REN

• Syntax
– ren {drive:}{path}{ filename}{newname}

• Used to change the name of the file.

• Example
– If the file to rename are not in the current directory, the drive and
path will need to be specified.
c:\> ren a:thisfile.txt thatfile.txt

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

DEL

• Syntax
– del {drive:}{path}{ filename}{/p}

• Used to delete a specified file or group of files.

• Example

– If the file to delete is not in the current directory, the drive and
path will need to be specified.
c:\> del \word\lookup\*.txt

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

CLS

• Syntax

– Cls

• Used to clear the screen.

• CLS command is invoked without parameters.

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

External DOS Commands

• External DOS commands are executable programs with .COM

or .EXE file name extension.

• To use any of the external DOS commands, the command

must be available on the floppy disk or the hard disk drive.

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

External DOS Commands Examples

EDIT To start a full screen text editor.


XCOPY To copy files and directoriesincluding sub-directories
DELTREE To remove a directory along with it's files and sub-directories
ATTRIB To display or change the file attributes.
FORMAT To prepare the disk to accept DOS files.
MORE To display one screen of output at a time.

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

EDIT

• Syntax
– edit drive:\path\file /d

• Used to start full-screen text editor

• Example
– To start the editor with file ‘Text.fil’, the command would be
c:\edit Text.fil

– If the filename in the command doesn't already exist, the editor


creates it.

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

XCOPY

• Syntax
– xcopy source{destination}{/a|/m}{/d:date}{/p} {/s}

• Used to copy files and directories including sub-directories.


• The following are the XCOPY command switches
– /a copies those source files that have their archive file attributes
set and does not modify the archive bit of source file.
– /m copies source files that have their archive file attributes set
but turns off archive file attributes of the source file.
– /p prompts for user confirmation before creating each
destination file.

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

XCOPY (contd.)

– /s copies directories and sub-directories, but ignores if


they are empty.
• Example
– To copy the files from the source to the destinstion, the path must
be specified.
a:\> xcopy a: c:\word\temp\
– If no destination is given then xcopy copies files from the source
to the current drive and current directory, provided of course the
source is not the current directory.
c:\program\database> xcopy c:\word\temp

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

FORMAT

• Syntax
– format {drive:}{/v{:label}{/q}{/u}{/f:size}{/b}{/s}
• Used to prepare the disk to accept DOS files.
• The following are the FORMAT command switches
– /v:label specifies the volume label while formatting the disk.
– /q deletes the file allocation table and the root directory of a
previously formatted disk.
– /u specifies an unconditional format operation for a floppy
disk or a hard disk.
– /s copies the operating system files io.sys, ms-dos.sys and
command.com from your system’s startup drive to the
newly formatted disk.
© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

FORMAT (contd.)

• It creates a new root directory and file allocation table for the

disk.

• Example

– To format the floppy drive a:, the command would be

C:\> format a:

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

Redirections

• It is important to redirect the input or the output to a file or a


printer.
• The greater-than (>) sign sends the output to a file or a device.
• The less-than (<) sign takes the input needed for a command
from a file rather than from the keyboard.
• The double greater-than (>>) sign adds the output from a
command at the end of a file.
• Example
– C:\> dir > dirlist.txt

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

MORE

• Syntax
– more< {drive:}{path}{filename}
or
{command} | more

• Used to display one screen of output at a time.


• Example
– To display the file output one screen at a time the command
would be
c:\cms> more file1

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

Special Files of DOS

• DOS has two special text files for adding control to new
hardware via CONFIG.SYS and AUTOEXEC.BAT

Device Drivers
• BIOS is added through special files called device drivers.

• A device driver contains all the programming required to talk


to a new device.

• Most DOS device driver files use the extension SYS.

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

CONFIG.SYS

• When the computer is turned on, DOS checks for a


CONFIG.SYS file.
• CONFIG.SYS file is always found on the main directory of the
DOS boot disk.
• Device drivers load through a special file called CONFIG.SYS.
• To add device drivers in DOS, once the device driver is copied
to the C: drive a line is added to the CONFIG.SYS file.
• The file can also be used to define the buffer space during disk
I/O process, the size of stack memory,etc.

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

Batch File

• DOS creates and stores DOS commands that are acted upon

(or "executed") automatically one line at a time in the order

entered.

• File containing the series of DOS commands is called a batch

file and have the extension .BAT.

• If the batch file is given the special filename AUTOEXEC.BAT,

it is executed automatically when you first start your computer.

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

AUTOEXEC.BAT

• File automatically runs (or executes) the command lines

included within the file when your system is turned on.

• DOS "looks" for the AUTOEXEC.BAT file during the boot

process.

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute
Revision no.: PPT/2K804/04

Design & Published by:


CMS Institute, Design & Development Centre, CMS House, Plot No. 91, Street No.7,
MIDC, Marol, Andheri (E), Mumbai –400093,
www.cmsinstitute.co.in

© CMS INSTITUTE, 2006. All rights reserved. No part of this material may be reproduced, stored or emailed without the prior permission of Programme Director, CMS Institute

You might also like