Welcome Visitor: Login to the siteJoin the site

Introduction to Dos

Essay By: ravneetpurohit
Other



It is the brief introdution to MS dos///


Submitted:Dec 3, 2011    Reads: 17    Comments: 0    Likes: 1   


Disk Operating System (DOS)

5.1 INTRODUCTION

When the computer starts, it starts the operating system that takes the control of the machine. An Operating System is a set of programs that help in controlling and managing the Hardware and the Software resources of a computer system. A good operating system should have the following features;

1. Help in the loading of programs and data from external sources into the internal memory before they are executed.

2. Help programs to perform input/output operations, such as;

    • Print or display the result of a program on the printer or the screen.
    • Store the output data or programs written on the computer in storage device.
    • Communicate the message from the system to the user through the VDU.
    • Accept input from the user through the keyboard or mouse.

5.2 OBJECTIVES

At the end of this lesson, you would be able to;

  • explain the concept operating system
  • discuss the functions of operating system
  • understand the procedures of loading operating system into the memory
  • use file management features of operating system
  • create separate locations for logically related files
  • copy files from one computer to another
  • use Windows for File Management

5.3 DISK OPERATING SYSTEM

As the name suggests, the operating System is used for operating the system or the computer. It is a set of computer programs and also known as DOS (Disk Operating System). The main functions of DOS are to manage disk files, allocate system resources according to the requirement. DOS provides features essential to control hardware devices such as Keyboard, Screen, Disk Devices, Printers, Modems and programs.

Basically, DOS is the medium through which the user and external devices attached to the system communicate with the system. DOS translate the command issued by the user in the format that is understandable by the computer and instruct computer to work accordingly. It also translates the result and any error message in the format for the user to understand.

(a) Loading of DOS

The BOOT Record into the computer memory loads DOS. BOOT Record in turn is triggered by ROM program already there in the computer.

The system start-up routine of ROM runs a reliability test called Power On Self Test (POST) which initializes the chips and the standard equipment attached to the PC, and check whether peripherals connected to the computer are working or not. Then it tests the RAM memory. Once this process is over, the ROM bootstrap loader attempts to read the Boot record and if successful, passes the control on to it. The instructions/programs in the boot record then load the rest of the program. After the ROM boot strap loader turns the control over to boot record, the boot tries to load the DOS into the memory by reading the two hidden files IBMBIO.COM and IBMDOS.COM. If these two are found, they are loaded along with the DOS command interpreter COMMAND.COM. COMMAND.COM contains routines that interpret what is typed in through the keyboard in the DOS command mode. By comparing the input with the list of command, it acts by executing the required routines/commands or by searching for the required routine utility and loads it into the memory.

5.4 COMPUTER FILES IN DOS

A file may contain a program or any other kind of information. Generally, a file must be given a name that can be used to identify it. DOS permits the user to assign a name consisting of two parts to a file - primary and secondary names. Primary name can be of a maximum of eight characters consisting of Characters, Alphabets, Number and Hyphen), and the Secondary name should consist of three characters, which is optional. The primary name and the secondary (or extension) name, if any, are to be separated by a dot (.).

Primary name can be linked to proper name, whereas extensions are like surnames of people. Using an extension with the file name is preferable, though optional. However, once the extension is specified, using the complete name (primary name and extension, with the period separating them can only refer the file). Using extensions can be an excellent way of naming a file so that it can be identified easily.

Examples:

Filename Primary Name Separator Secondary Name Employee Employee Employee.Exe Employee . Exe Employee.Dbf Employee . Dbf

DOS has a way of showing which disk drive is currently active. The floppy disk drives are assigned alphabets A and B, whereas the hard disk drive is assigned the alphabet C. If your PC has a single floppy drive, the drive would be A and if it has two, they would be termed as A and B. If your PC includes a hard disk, besides a FDD (Floppy Disk Drive), the drive names would be A and C. If the prompt is A, then it implies that the first floppy disk drive is active. Where as the DOS prompt would be C, if the hard disk is active. Data as well as instructions reside in a file stored in a disk.

5.5 DIRECTORY STRUCTURE IN DOS

The files in the computer come from various sources. Some files come with DOS, while other come with publications such as a word processor. These files contain codes and other information that is necessary to make the computer application operational. Before long, there will be hundreds or even thousands of files in the computer, which can make it difficult to locate specific files.

The names of all the files created in a disk are stored in its directory. Directory is just like a file folder, which contain all the logically related files. DOS files are organized in a hierarchical or an inverted tree-like structure. The general analogy is with a file cabinet containing a number of drawers, which in turn may contain folders. The content of these folders is the needed information.

The file cabinet here is the ROOT DIRECTORY, the drawer is INDIVIDUAL DIRECTORY, the folders areSUBDIRECTORY and the information in these folders may in turn be classified as FILES.

Otherwise, the large number of files that get created for various purposes in a disk can make the directory huge and difficult to view and manage. Therefore, DOS enables the user to organize the files in a disk into directories and sub-directories in a hierarchical structure. Directories can contain other directories. A directory within another directory is called a sub-directory.

Of course, there may be sub-directories of sub-directories, but a file name is the furthest you may descend down the (inverted) tree of directories and files. Thus, a file name corresponds to a tree leaf, a sub-directory to a branch, the directory to the trunk, and the root directory to the root of the tree, hence the name ROOT DIRECTORY.

Sample of Directory Structure

dos1.gif (2876 bytes)

The directory/sub-directory is represented in bold letters.

5.6 DIRECTORY COMMAND

The content of each of the sub-directory cannot be viewed unless it is made active, or a sub-directory is specified as part of the DIR command. Doing either of these requires an understanding of the concepts of navigating around the disk.

The directory, the user is in at any point of time, is called the WORKING/PRESENT/CURRENT directory. DOS indicates which directory you are in by displaying the directory's name in the command prompt. For example, the following command prompt indicate that you are in the DOS directory: C:\DOS>. Knowing which directory is current helps you find files, and to move from one directory to another more easily. Typically, the ROOT DIRECTORY (\) is the initial working directory. The entire specification of directory from root is called a PATH. By itself, the DIR command is applicable to the working/present directory. The names of the sub-directories at adjacent levels are separated by backslash (\), while specifying the path to be followed while traveling to a sub-directory.

5.7 USING PATH TO SPECIFY THE LOCATION OF FILES

A path is the route that leads from the root directory of a drive to the file you want to use.

For example, to access the NOS.LET file in the LETTER subdirectory of NOS directory, DOS must go from the ROOT (\) directory through the NOS directory to the LETTER directory, as shown in the following figure:

dos2.gif (2231 bytes)

To specify the same path at the command prompt, you would type it as shown in the following illustration:

C:\NOS\LETTER\NOS.LET

This is the path or route to the file NOS.LET. The first letter and the colon (C:) represent the drive the file is on. The first back slash (\) represents the root directory. The second backslash separates the NOS directory from the LETTER sub-directory. The third backslash separates the LETTER sub-directories from the file name, NOS.LET.

Note: MS-DOS recognizes path up to 67 characters long (including the Drive letter, colon, and backslash).

5.8 DIR COMMAND

The DIR command gives the list of is there on the disk that is mounted on the active drive.

Syntax : C:\> DIR A:\> DIR

Example

A:\> DIR

Volume in drive A has no label
Directory of A:\

COMMAND COM 23612 10-20-88 11.30a DISKCOPY COM 4235 10-20-88 12.00p FORMAT COM 15780 03-12-89 12.00p 3 files 325012 bytes free

A:\>

As can be seen, on typing DIR followed by <Enter> key at DOS prompt, five columns of data followed by the number of files and bytes that are free in the disk are displayed. The first column contains the primary name of each file resident on the disk. However, most files are named with an extension, which appear in the second column. Whereas, the third column contains the size of the file in bytes, and the fourth and fifth columns show the date and time on which the files was created or last modified. The last line displays the number of file(s) and remaining disk space free in bytes. It is important to note that the DIR command only displays the names of the files and not their contents.

5.9 CHANGING A DIRECTORY

All the names displayed using DIR command that have <DIR> besides them are directories. You can see the list of files in another directory by changing to that directory and then using the DIR command again.

The Change Directory (CHDIR) or CD command enables the user to travel around the directories in a disk. Type the CD command at the command prompt.

Syntax:

A:\> CHDIR {path} or a:\> CD {path}

Examples : (Refer to the figure)

# 1. A:\>CD \NOS

This command makes the NOS sub-directory under the root directory (\) active.

# 2. A:\>CD \NOS\LETTERS

The backslash indicates the root, and LETTERS, which is a sub-directory under the NOS directory, becomes the working directory.

# 3. A:\> CD \

The root directory becomes the working directory; i.e. you will change back to the root or main directory. The slash typed in this command is a backslash (\). No matter which directory you are in, this command always returns you to the root directory of a drive. The root directory does not have a name, it is simply referred to by a backslash (\).

5.10 MAKING OR CREATING DIRECTORY

As the number of files increases in a disk, a need is felt to organize them in a meaningful way by creating sub-directories to store a group of logically related/similar files.

To create a directory, DOS provides the MKDIR (Make Directory) or MD command.

Syntax:

A:\>MKDIR [drive:] {pathname} or A:\>MD [drive:] {pathname}

Square brackets indicate that [drive:] entry is optional.

The MD or MKDIR command creates a new empty directory whose name is the last item specified in the pathname, in the specified drive. If active, the drive need not be specified. If the directory is to be created as a sub-directory of the working directory on the active drive, typing MD {directory name} at the DOS prompt or command prompt is sufficient.

Examples:

# 1. A:\> MD \ACCT\SALARY

makes a SALARY directory in the: drive, under ACCT directory.

# 2. A:\> MD C:\> SALARY

Makes a salary directory in the C: drive, under root directory.

5.11 DELETING A DIRECTORY

You may want to delete or remove a directory to simplify your directory structure. DOS provides RD (Remove Directory) to delete a directory.

Example:

# 1. A:\> RD \ACCT\SALARY

removes the SALARY sub-directory in ACCT directory.

NOTE: You cannot delete a directory if you are in it. Before you can delete a directory, you must type cd.. at the command prompt. At the same point of time, the directory to be deleted should be empty.

5.12 COPYING FILES

To copy a file, DOS provides `COPY' command. When you use `copy' command, you must use the following two parameters; the location and the name of the file you want to copy, or the source; and the location and the file name to which you want to copy the file or the target (destination). You separate the source and the destination or target with a space. The syntax of the `COPY' command is

COPY {source} {destination} or,

COPY [drive:] [path] [filename] [drive:] [path] [filename]

i.e. the first set of drive, path and filename refers to the source file, and the second set of drive, path and filename

refers to the destination file.

(a) Copying Single File

To copy the DEBUG.EXE file from the DOS directory to the NOS

directory

1. Return to the root directory by typing the following command prompt: CD\

2. Change to the DOS directory by typing the following commands at the DOS prompt: CD DOS

3. To copy the file DEBUG.EXE file from the DOS directory to the
NOS, directory type the following at the command prompt:

Copy c:\dos\debug.exe c:\nos and the following message appears: 1 file (s) copied

Examples:

# 1. A:\> copy a:\letter\office.doc \letter\office.bak

makes a copy of the office.doc file in the current or working directory with a new name office.bak

# 2. A:\> copy office.doc a:\letters\nos.mem

copy the file office.doc from the root directory to the sub-directory LETTER under root directory with a new name nos.mem.

If the target drive is not specified, the copied file will reside in the disk mounted on the active drive.

5.13 USE OF WILDCARD CHARACTERS

If you want to carry out a task for a group of files whose names have something in common, you can use wildcard characters to specify groups of files. DOS recognize two wildcard characters: asterisk (*) represents one or more characters that a group of files has in common; and the question mark (?) represents a single character that a group of files has in common. You can use wildcards to replace all or part of a file's name or its extension. The following table shows examples of wildcards:

Wildcard What it Represents Example *.TXT All files with a .TXT extension JULY.TXT
LETTER.TXT
REPORT.* All files named REPORT with any extension REPORT.TXT
REPORT.LET
REPORT.WRI
M*.* All files beginning with letter regardless of their extension M MEMO.TXT
MARCH.XLI
???.* All files having 3 letter names, with any or no extension SUN.BMP
WIN.LET

You can include the wildcard in the command.

Use of wildcard characters in COPY command

# 1. A:\>COPY \letters\*.COB B:

It means, copy all files with extension *.COB from the directory LETTERS under the ROOT directory to the working or ROOT directory of the `B' drive.

# 2. A:\> COPY B:\COMPANY\OPEL.*

The command is to copy all files with primary name OPEL (irrespective extension) in the directory COMPANY under ROOT of the drive `B' into the current working directory of the disk mounted in `A' drive. Incase of one drive, the system will ask for the source and

target drive.

The command,

#3.A:\>COPY C:\*.*

copies all files of the ROOT directory of the 'C' drive into the working directory of the 'A' drive.

# 4. A:\> COPY LETTE?.* B:

copies all files with primary name consisting of 6 characters in total and LETTE as the first five characters (irrespective of extension name) into drive `B'.

# 5. A:\> COPY B:\?.DOC

copies all files having a primary name of one character with an extension .DOC from ROOT directory of 'B' to the ROOT directory of `A' drive.

5.14 RENAMING FILES

To rename a file, DOS provides REN command. The REN command stands for "Rename". When you use the REN command, you must include two parameters. The first is the file you want to rename, and the second is the new name for the file. You separate the two names with a space. The REN command follows this pattern:

REN oldname newname

Example: REN NOS.DOC NOS.MEM

Rename the old filename NOS.DOC to a new filename NOS.MEM.

5.15 DELETING FILES

This section explains how to delete or remove a file that is no longer required in the disk. DOS provides DEL command, which means to delete.

Syntax : DEL {drive:} {path} {filename}

Example:

# 1. DEL \DOS\EDIT.HLP

delete the EDIT.HLP from the DOS directory under ROOT directory.

5.16 PRINTING A FILE

The `PRINT' command of DOS works more or less like `TYPE' com

mand, but at the same time, it enables the content of a text file

to be printed on a paper.

Syntax:

A:\> PRINT [drive:] {path} {filename}

Example:

A:\> PRINT \AIAET\LETTER\AIAET.LET

Top

IN-TEXT QUESTIONS 5.1

  1. The startup routine runs, when machine boots up is known as
    1. POST
    2. BOOT up
    3. Operating Routine
    4. I/O operation
  2. Operating system is also known as:
    1. database
    2. system software
    3. hardware
    4. printer
  3. What is the maximum length allowed for primary name of a computer file under DOS?
    1. 8
    2. 12
    3. 3
    4. None of the above
  4. Which of the following could be a valid DOS file specification?
    1. NOSFILE.POST
    2. NOSFILE.P.OST
    3. NOSFILE.DOC
    4. NOST.FILEDOC
  5. How many characters form a secondary name for a file?
    1. 8
    2. 12
    3. 3
    4. None of the above
  6. What is the name given to something that the computer will automatically use unless you tell it otherwise?
    1. a specification
    2. a wildcard
    3. a default
    4. a rule
  7. As per symbolic notation of DOS, which of the following indicates the ROOT directory
    1. *
    2. >
    3. /
    4. None of the above
  8. In wildcard specification `?' is used as replacement for
    1. one character
    2. two character
    3. three character
    4. none of the above
  9. With DOS, you may use the `*' and `?':
    1. when changing the default settings
    2. to represent unspecified characters in a filename
    3. instead of wildcard characters
    4. in the extension but not in the drive name or the file name
  10. DOS system file consists of
    1. IBMBIO.COM, IBMDOS.COM, COMMAND.COM
    2. COMMAND.COM, IBMBIO.COM, FORMAT.COM
    3. SYS.COM,IBMBIO.COM,IBMDOS.COM
    4. None of the above
  11. The batch file uses the extension
    1. .BAT
    2. .DOC
    3. .PRG
    4. .DOS
  12. To display the list of all the file of the disk you would type
    1. DIR
    2. COPY
    3. DIR FILES
    4. DIR AUTOEXEC.BAT
  13. State whether the following questions are True(T) or False(F).
    1. Command.Com is hidden file.
    2. Primary name of a file can be of 10 characters.
    3. The command MKDIR and MD performs the same task.
    4. Under DOS .EXE is not an executable file.
    5. DIR command is used to see the content of a specific file.

Top

5.17 WHAT YOU HAVE LEARNT

In this lesson you were introduced to one of the most popular desktop operating system and its working environment. It explained the directory structure, file naming conventions. It also talked in great length about the file management in terms of COPY, DEL, and MOVE. Here you learned the steps involved in loading of operating systems into computer.

TERMINAL QUESTIONS

  1. Explain in brief what do you understand by Operating system.
  2. Explain the process involved in loading of Operating System.

5.19 FEEDBACK TO IN-TEXT QUESTIONS

  1. b.
  2. b.
  3. a.
  4. b.
  5. b
  6. c.
  7. d.
  8. a.
  9. b.
  10. a.
  11. a
  12. a..
  13. True OR False
    1. False
    2. False
    3. True
    4. False
    5. False

Top





1

| Email this story Email this Essay | Add to reading list



Reviews

About | News | Contact | Your Account | TheNextBigWriter | Self Publishing | Advertise

© 2013 TheNextBigWriter, LLC. All Rights Reserved. Terms under which this service is provided to you. Privacy Policy.