MS-DOS
Introduction
DOS is an operating system used on PCs (Personal Computers).
The Operating System is software which controls the hardware of the machine (the disks, keyboard, mouse, monitor, etc.) and allows the user's programs and packages to be run on the machine. It is the interface between your word processor or spreadsheet or other program and the electrical signals which the CPU (the Central Processing Unit or Processor), the heart of the computer, understands.
Sometimes DOS is stored on a Diskette, but normally it is stored on the Hard Disk, and it is easier to use when it is.
As with all programs (or software), different parts of DOS are brought into RAM and executed as they are needed.
It might be helpful to discuss some of the above terms before further discussing DOS.
Introduction to DOS - Disk Operating System
The Disk Operating System (DOS) is a computer program which is loaded from disk into the main memory of an IBM compatible PC, when the machine starts up, to control its operations. 'IBM compatible PC’ is a generic term used to refer to the majority of PCs, made by a number of manufacturers, e.g., Viglen, DEC, Compaq, Dell, IBM etc., which all run DOS. This term has come to mean, in effect, all PCs other than Apple Macintosh personal computers, (commonly referred to as Macs, rather than PCs) and Mac clones.
Over recent years three companies have produced DOS (or a brand of it); Microsoft, IBM and Novell. The latter has now dropped out of the market and IBM’s share is marginal. Microsoft DOS i.e. MS-DOS is now the de facto standard.
Here is a summary of the development of Microsoft DOS (MS-DOS)
Version Year Features
1.0 1981 Original Disk Operating System
1.1 1982 Support for double-sided disks
2.0 1983 Support for sub directories
2.01 1983 Support for international symbols
2.25 1983 Bug fixes
3.0 1984 Extended character set, large hard disks
3.1 1984 Support for PC networks, bug fixes
3.2 1986 Support for 3.5-inch disks
3.3 1987 Support for PS/2 computers
4.0 1988 Support for large partitions
4.01 1989 Bug fixes
5.0 1990 New shell, new editor, smaller kernel, memory management
6.0 1993 Disk Compression, better Memory Management, and Anti‑Virus software now included in the operating software. Previously they had to be bought separately, as Utilities. 6.0 Contained a number of bugs.
6.2 1993 Microsoft claims it was not a bug fix for 6.0, but most observers saw it as that.
Essential Components of DOS
DOS is composed of a number of files. You can choose to keep all of its components available on disk so that you can use all the facilities it offers (this is the norm if space is not a constraint). Alternatively you may choose to have a minimal setup in which case not all of its features will be available. However at a minimum there are three system files which you must have.
These are IO.SYS, MSDOS.SYS and COMMAND.COM.
The disk which your computer uses to load and run DOS must contain these files and is called the System, or Startup, or Boot, disk.
COMMAND.COM, the command processor (or shell) is the part of DOS that executes (or processes) the commands we will be looking at. These commands are either internal to the command processor (i.e. part of it), or external to it.
You must not create a file with the same name as an Internal Command. Examples of such commands are DIR, DEL and COPY, which are part of the COMMAND.COM program. You will find that the names of these commands cannot be seen when you list the files on your disk.
Each External Command is a separate executable program. When the user enters the name of an external command DOS reads the appropriate program file into memory and control of the computer system is passed to it; when the command terminates the command processor regains control of the system. External Commands e.g. XCOPY, can be seen when you list your files.
Directory Structure
It is possible to store hundreds of files on a disk and it can a tedious task trying to find a particular one you are looking for if they are not categorised in any way. Therefore DOS allows you to group related files together in directories. The main directory on a disk is called the ROOT directory, which is represented by \ (a back slash) and it is created by DOS when formatting the disk. You can create directories in the ROOT directory and within each other and they can each contain a number of files. The directory structure is often thought of as an inverted tree structure with the root at the top branching down into lower layer directories and subdirectories. For example -
Files and Filename
Data and programs are stored on disks in files. DOS itself consists of a number of files working together to provide the operating system. Other computer programs such as word processors and spreadsheets are also constructed from a number of files. When you save work produced with one of these packages (e.g. a document from a word processor) you save it to a file. When naming a file it is always a good idea to use a name which indicates the contents of the file. Likewise when naming a directory, which is a special type of file, you should use a name which helps to identify the files it contains.
DOS has certain rules governing the naming of files -
Filenames are not case sensitive.
Maximum length allowed for a filename is 8 characters.
Maximum length allowed for the extension to a file name is 3 characters.
The file name and extension are separated by a . (period).
Characters not permitted in naming files are
. " / \ [ ] : | < > + = ; , ? ^ * And Spaces
These characters have special meaning when used in or with a file name.
File extensions can have special meaning to DOS or other programs and are often used to indicate the type of a file.
e.g. The .BAT extensions signifies a Batch files. A batch file contains a batch or group of DOS commands which are performed one after the other when the file is executed (or run). You execute a batch file by typing its name, without the .BAT extension, at the DOS prompt. AUTOEXEC.BAT is a batch file which is often found on the boot disk. DOS accesses this file in the last stage of booting (i.e. starting) your system and executes each command it contains.
Here are some commonly used extensions and the type of file they indicate
BAK Backup file
BAS Basic program
BAT Batch file; it contains a group of DOS commands the user wants to run
COM Command file
DOC Document
EXE Executable file, Similar to COM file
PRN Print file
SYS System file
$$$ Temporary file
Directory Names
These follow the same rules as ordinary file names except that extensions are not allowed in version 5 and earlier versions of MS-DOS. Remember that a directory is just a special kind of file - i.e. a file which can contain other files.
When a list of files is displayed on screen the label <DIR> is appended to those names which in fact indicate directories.
Running DOS Commands
Commands are entered at the DOS prompt, e.g. A> or C> or F> which, as previously noted, informs you of the default or current drive. The exact form of the initial prompt depends on what type of disk booted the computer and whether the startup file AUTOEXEC.BAT, has customised the prompt. A letter plus > (greater than sign) is the default prompt.
For example A> indicates that the computer was booted with a floppy disk, whereas C> means the computer was booted from a hard disk and F> indicates that the computer may have been booted from a networked machine.
A command line can contain just a command itself i.e. a single word, but most commands can take parameters (or arguments) indicating files or directories on which the command is to operate. Parameters are separated from commands by one or more spaces.
You finish a command line by typing the Return or Enter key (<return> or <enter), and this signals the computer that you have finished typing in your command and that it should carry it out.
An example of an acceptable DOS command is
CLS
This is the clear the screen command. All existing text on the screen will be cleared and the prompt placed at the top left hand corner of the screen ready for the next command.
Changing the default disk drive
Unless you specify in a command line a particular (Disk) Drive to use, DOS will attempt to
execute the command on the current, or default, drive. i.e. It will look for the directories and files referenced in the command line on the disk in the drive indicated by the screen prompt, e.g.
A> (diskette)
C> (hard disk)
Suppose the current/default drive is C and you are going to perform a lot of operations on your diskette in drive A. To avoid typing A: in your command line every time you execute a command you can change the default drive.
To change the default drive from C to A type A: <return>
The prompt will now include A instead of C
To make C the default drive again type C: <return>
Command Line Syntax
command-name DRIVE:\PATH\DIRECTORY /SWITCHES
FILE
This is a simplified illustration of the basic format of DOS command lines. The command-name is of course essential but, depending on what that command is, the other elements of the command line may or may not be present. Moreover some command lines will contain additional elements not included in this example. The components of the command line are explained below.
(Note - it is not necessary to understand this abstract illustration of the DOS command line as examples are given for each of the commands discussed in these notes. Indeed you might prefer simply to look at the actual commands.)
The components of the command line are -
command-name = a DOS command
DRIVE: = a letter plus colon indicating the relevant disk (drive) for the following path and directory/file.
Usually C: for the hard disk drive.
A: for the floppy disk drive.
B: if there is a second floppy disk drive.
F: for a network disk.
PATH = a hierarchy of directories, each preceded by a \ (back slash), from the Root directory of the disk (represented by the first \) to the directory containing the directory or file on which the command is to be executed.
e.g. \faculty\dep_ment\admin
Note - If you are already in the directory which contains the file or directory to be manipulated then the drive and path do not need to be specified.
DIRECTORY = the directory on which the command is to be executed.
or FILE = the file on which the command is to be executed.
If a path has been specified then a \ must be placed before this item to separate it from the path.
e.g. \faculty\dep_ment\admin\minutes.doc
SWITCHES = ways of modifying the operation of the command.
Throughout the notes, a number of possible switches are listed for each
command, however often no switches will be required.
Switches can usually be combined - i.e. you can have more than one switch for a particular command.
Note - Very often elements of this syntax can be omitted, in which case DOS will use defaults. e.g. If no DRIVE: is specified in the command line, then DOS attempts to execute the command on the current drive (i.e. that indicated by the screen prompt).
If no PATH is specified, then DOS attempts to execute the command in the current directory (i.e. the directory in which you are currently working).
An example of how the commands are presented in the notes is now given using the DIR command. The command name and a brief note of what it does is given in the heading, followed by a little more explanation, its syntax and some examples.
DIR - Lists files and subdirectories
This command lists information about files and subdirectories and the amount of free disk space.
Command Syntax: DIR DRIVE:\PATH\DIRECTORY /SWITCHES
FILE
Where SWITCHES are
P - page through the screens
W - produce a wide listing
Example: List the contents of the root directory of the hard disk
DIR C:\
Error Messages
If what you type on the command line is not a valid DOS command, e.g. if you type in rubbish, or misspell a command, you will probably get the following response.
Bad command or file name
Likewise if you type in the name of a command correctly but add too many parameters, or an invalid switch to it, DOS will respond with an appropriate error message.
DOS Help
Version 5 of DOS came with a command which helps the user establish what each DOS command can do. (DOS 6 provides a similar, more graphical facility.)
Command Syntax: HELP command-name
Example 1: Display a brief description of what all the DOS commands do.
HELP
Example 2: Display more information about a particular command e.g. DIR
HELP DIR
or DIR / ?
This will provide the syntax of the command in a form similar to that used in the notes.

No comments:
Post a Comment