4.1 DEFINITION OF THE TERM:
‘OPERATING SYSTEM’
Operating System as defined earlier, is a set of programs available within the system software that standardizes the way a computer’s resources are made available to the user and to applications software.
4.2 FUNCTIONS OF AN OPERATING SYSTEM
The following functions are identified as common to all Operating Systems:
4.2.1 Memory Management
An Operating System allocates memory to itself and to its resident system programs, sets aside areas of application programs and user partitions, arranges the input and output buffers (areas on RAM where input data and output data are temporarily stored) and reserves storage for specialized purposes.
4.2.2 Input/Output (I/O) Management
The Operating System controls reading of data coming in from the various input devices into the memory and writing of data to output devices such as printers.
The Operating System will ensure that each time the user types in commands those inputs are accepted into the memory, and if the latter is busy the it holds the same temporarily on buffers until the memory is free and also does the same to output data awaiting to be displayed on the monitor or to be sent to the printer if the same are busy.
4.2.3 Resource Allocation
Operating System load programs into the computer memory and starts them running after receiving instructions from the user, at the same time, operating systems must have ability to divide resources available to different users, memory and of course the peripherals to different processors going on at the same time so that none of the users gets “stuck” or “deadlocked” during the operation for lack of a computer resource.
4.2.4 Error Handling
Any Operating System must have the ability to handle errors in the computer system be it hardware or software faults and be able to provide routines to correct these errors.
4.2.5 Provision for User Interface
Any Operating System should have the ability to receive commands from the user and respond to them accordingly.
4.2.6 Interrupt Handling
An interruption could be caused by software errors, mechanical faults of a machine or by the operator by pressing the Break key for example which halts the system. The operating system should always be able to handle such interrupts without causing any malfunctions as a result.
4.3 TYPES OF OPERATING SYSTEMS
There are majorly two types of Operating Systems that we will discuss in this section.
4.3.1 Single User System
In this type of Operating System, only one user can use the machine at a time, load one program at a time in the main memory and process only that one program. Most of the small microcomputers employ single user systems. Examples are Ms-DOS, Pc-DOS and Windows.
4.3.2 Multi User System
This system as the name suggests is for multi user, as opposed to the single user system. This system is employed by larger microcomputers and minicomputers. More than one program can be loaded into the main memory by different users and processed at the same time in an interactive manner. Examples of such an operating system are UNIX and Windows NT.
4.4 FILE MANAGEMENT
Medium of storage employed by most microcomputers is often disk. Data that is stored on disks are often held in a file. The latter is often referred to as a group of related records. The records may hold data about customers, employees of the organization and names of students in a school and the like depending on the organizations.
Therefore, the file as a group of program instructions is actually a computer program. When files are stored on such storage media, then the term “file” refers to anything stored on the medium, be it a program or data file.
4.4.1 File and Directories
The work of the Operating System is to keep or maintain a directory of the address of the files on disk. Each file on the storage media is assigned a name called filename (one word). The directory is a list of filenames and the disk addresses at which the file may be found. When the user refers to a particular filename, it causes the operating system to consult its directory of filenames, locate the address of the required file and make it ready for use.
Let us have a look at a directory listing of files of a system disk using Ms DOS. All of the files in this directory are programs. A system disk is so called because it contains the directory system. We shall list directory for system drive A:
Volume in drive A: has no label. Directory of A:
COMMAND COM 18107 13-12-97 13.00PM SYS COM740713-12-97 13.00PM
DIRECTORY COM 1307 13-12-9713.00PM FINDEXE 127813-12-97 13.00PM
4 FILE(S) 142890 BYTES FREE
What the list shows:
- the name of the file g. COMMAND
- Filename extension e.g. COM
- The number of bytes contained in this file
- Date and time on which it was printed into the
- The total figure at the bottom of this directory listing show the number of bytes remaining for storing other
MS-DOS has certain rules for formation of filenames for example;
A filename must not exceed 8 characters in length and in some cases requires filename extensions, which is 3- character in addition to the filename. In the above example, COM and EXE are extensions. Although not visible, there is usually a full stop between the filename and the extension e.g. Diskcopy.COM is the complete name for the above file. The user has to type in the computer name of the file including the period in order to effectively use some file maintenance utilities like copying or deleting. Filename extensions usually indicate the type of file for example “COM” and “EXE” above will refe-7r5-to program files.
4.4.2 Directory Hierarchy
Files stored on a disk can always be organized into subdirectories. Directory hierarchy refers to a “tree” like structure formed by directory – subdirectories – files. For example, we could have a directory called KENYA with subdirectories of towns NAIROBI, MOMBASA, NAKURU and files of Estates within each town, e.g. Hurlinghum, Nyali and Milimani. The figure below shows the directory hierarchy.
To be able to specify which file to open, the user has to specify to the operating system the data path or path to that file. For example, to open a filename Milimani, the following path must be specified: Kenya\Nakuru\Milimani.
A path is often defined as a logical, sequential list of directories and subdirectories leading to a filename. The names of directories and subdirectories are separated from each other by determinates which could be a backslash(\) or a hyphen (-) or a slash (/) depending on the Ms
-Dos version in use.
The directory names have extension DIR wheras the files have TXT. The directory named Kenya under which the subdirectories Nakuru, Mombasa and Nairobi are stored is called root directory.
4.1.1 Volume Lables and Directories
A labels is a name given to a disk to enable you identify the contents from those of other disks when it’s off-line in that if it’s not mounted on a drive.
Since the use could have multiple disk drives on-line (mounted) at one time, the operating system must have a way of determining when disks are actually mounted on the driver. To do this, we use volume labels or volume directory, which simply a name assigned to each disk used in the computer installation. The difference between volume labels identifies a storage medium as physical unit while the latter two identify data stored on disk. Suppose we gave a volume label country to the hierarchy above, the complete name for reaching Milimani file will be:
COUNTRY\KENYA\NAKURU\MILIMANI
The operating system will ensure that disk on a volume label Country is located first if it is the one mounted, before it searches for the actual file in the specific directories.
4.1.2 Tab Control
Computers and their operating systems can perform a great number of different tasks, not just one job as say a stand-alone word processor or a calculator. Therefore, the user of the system must be prepared to tell the operating system what particular task to perform at the moment.
When the computer system is complete, usually the application program is what the user communicates with the program when a particular task is desired. When the application program finishes, it is no longer a part of the system.
The user therefore must communicate with the operating systems to tell it what to do next. He or she does this through the use of what we call OS’s Tab Control Language or TCL. TCL consists of a number of operating system commands also called system commands that control the operating system.
How does one know that the application program has finished its work and it is no longer loaded by the operating system? The operating system will display that by displaying its prompt; it could be a character or two that will signal the user it awaits further system commands.
The MS-DOS Operating System, uses the prompt C:\> or C>. The “C” in the prompt indicates the disk drive in which the operating system will look for any files referred to by the next TCL instructions. The disk drive attached to the system are usually identified by letters of the alphabet through a system with four drives could have drive identifiers A: through
- Any reference to a drive must include the colon in the drive identifier. The drive identifier displayed by the dos prompt is known as a logged drive, the default drive or the active drive.
4.2 MS-DOS COMMANDS
Using system commands is quite easy. It is a matter of knowing the right commands key, key it in and press enter key for the command to be accepted. System commands help us to manage our files and directories for example; we can copy a file from one disk to another, delete files or change names. We can also manage our disks for example to format a disk, label a disk or copy disks.
The Syntax of a Dos Command
A Dos command usually has a command name (i.e the system command the user intends to use) and an argument which is information required by the command. An argument used with a Dos command will indicate the disk drive on the file to be used by the command
Example: COPY ANN 1 TO ANN 2
The command has a command name COPY. The arguments are
ANN 1 and ANN 2. This command copies a file known as ANN 1. The new copy is named ANN 2.
N/B: ANN 1 and ANN 2 are arguments and are separated from each other by a blank space. They are also separated from the command name by a blank space.
4.2.1 Running a Program
It is important to note that a Dos Command represents a program. A command name is just like a file name of any other program. To be able to run a program using Dos, first the operating has to be loaded. Loading the operating system is simply switching on the computer, it will open a program loaded in ROM to check if the operating system is loaded in drive A or any other and load, other wise it will load from the hard disk.
To run a program with filename extension COM, BAT, TXT, simply enter its filename without the extension for example to a Basic Program simply enter BASIC. Its filename is BASIC.COM.
When you want to execute a program that is not stored on a disk in the logged drive, the first thing would be to change the logged drive to the disk containing the program. For example, suppose you wanted to run a program with the filename MILO.EXE which is on the disk in drive B:, and the logged drive is A:, to specify the drive on which Dos should look for the program, proceed with the filename with the drive identified with no blank in between the colon and the filename.
B:MILO
4.3 FILE MANAGEMENT COMMANDS
- Changing the Logged Drive
To change the logged drive from the active one, simply enter the letter of the alphabet for the new drive at the prompt of the active drive followed by the colons and then press Enter key.
For example, if the active drive is C:\>, simply type A: at the prompt and press Enter.
C:\> A:\>
A:\> or A:\>
- Determining the Contents of a Diskette
To determine the contents of your disk, Dos provides a program command DIR (Directory) that will display the files stored in your disk with the exception of the hidden files.
The files are usually listed one per line with their filenames, filename extension, size and the date and time they were last saved.
If you have many files than can be displayed on the screen, then Dos passes them so fast over the screen that you cannot be able to read or identify a particular program. There are two solutions to that program:
1. /P (Pause) Switch
To see the files with all the relevant information i.e. filename, filename extension, size and date and time, then /P switch does the work. The files will be shown one screen at a time and tests the user to see the files with instructions to “press any key to continue…” The format is DIR/P
<ENTER>
2. /W (Wide) Switch
This command will display filenames and their extension only for the entire directory at once. They will be displayed in rows five files wide. The format is DIR/W <enter>.
To see only a particular file on Disk
Simply use the filename of that file as the argument, thus: DIR B:FILENAME.TXT
In this case, Dos will display the particular information about that file or tell you that it is not on disk.
To see Directory files with similar extensions.
If your files have the following extensions; BAS for Basic Programming files, DBS for Database files, to see their directory of all the Basic programming files, enter:
DIR*.BAS or DIR/P.BAS or DIR/W*.BAS
The asterisk is called a wild card. What it means is that you “substitute the position with any characters.” For instance in the command DIR*.BAS will list all the files with the .BAS extension.
Directory of files with similar names and different extensions
Suppose your filenames are the same but have different extensions,
all that you need to do is: DIR Same.*
All files called “Same” will be displayed.
Suppose you decided to identify your files as Same 1, Same 2 and so on, and therefore you wanted to only display a filename Same but with specific extension DBF, you would enter:
DIR Same*.DBF
To see all same files you would enter: DIR Same*.*
The asterisk wildcard is a many character wild card. It fills out a filename or extension from its position to the end of the name in the above EXE file, the asterisk is the fifth, sixth, seventh and eighth character if they exist in the filename beginning with SAME.
Another wild card used in the Dos command if? It is usually called a one character wild card. When it appears in a command, you can substitute it with one character e.g.
DIR ?AME*.DBF, will substitute ? with any character as long as the next line i.e AME is part of that filename. So if it is a command, like DIR SAME*??? Would be the same as DIRD SAME*.* when the three questions marks in the former stand fir three character.
4.3.3 Changing Directories
Let us go back to the example we gave with root directory KENYA. Suppose you wanted to make Hurlinghum your current directory, you simply need to enter to command:
CD C:\NAIROBI\HURLINGHAM. <ENTER>
If you are already in C: as the logical drive, you do not need to enter it again, simply type: CD. If you wanted to move up one level of the directory
i.e. to Nairobi, type: CD.. <ENTER>
Suppose you were to go straight to the root directory i.e. KENYA, all you need to type in at the prompt is:
CD\ <ENTER>
If you want to see the subdirectory of a current directory, type DIR.
<ENTER>.
For example if you have made Nakuru your current directory, to see subdirectory like Milimani simply enter the latter command!
4.3.4 Making Directories
Suppose you wanted to make a subdirectory of your current directory Nakuru, what you need to do is enter that command MD (Make Directory) and the name you intend to call the subdirectory, thus:
MD LANGA <ENTER>
If towards creating the directory named LANGA you want to work in it, simply use the CD command to place yourself in it, thus:
CD LANGA <ENTER>
4.3.5 Removing Directories
To remove a directory, first ensure that the directory to be removed is empty. You can empty a directory by using DEL command after making back-up copies of the same.
To effect the command to remove a directory like NYALI, ensure you place yourself in MOMBASA directory first, thus:
CD MOMBASA <ENTER> RD NYALI <ENTER>
4.3.6 Copying a File
It is often necessary to make a copy of a file. All important files should always be copied so as to guard yourself against the loss of data. Data loss often occurs if you accidentally erase a file, Power goes off before you save your files, store data under an incorrect name, do physical damages to a diskette.
When you copy a file to protect against loss of data we say you are backing up a file. The copy command requires 2 parameters/arguments to accomplish the task. It is a resident command.
- The first argument is the name of the file to be
- The second argument is the filename for the If the file is not on the logged drive, then drive identification must be included.
4.6.6.1 Copying from the same Drive
Thus: Copy SAME1.DBF ZAME2.DBF
The above command will copy file named SAME1 on the same drive and give it a new name ZAME2.DBF. it is important to note that if you are copying within the same drive, then the new file must have a different name.
4.6.6.2 Copying from one Drive to another
To copy a file from one drive to another giving it the same name.
Enter:
COPY SAME1.DBF B:
New file name is not necessary on the target drive (B:) since it is the same as that of the source drive.
4.6.6.3 Copying a range of Files.
To copy a range of files, we employ wildcards for example:
Copy same*.*B will copy all files on the logged drive that start with same onto the diskette in drive b: irrespective of filename extension.
To copy the entire contents of drive A: to B, we can use the following command:
COPY A:*.*B:
N/B: Ensure that the destination diskette is formatted before the operation is started since this command COPY doesn’t copy formatting information as does DISKCOPY command (4.7.4).
4.3.7 Renaming Files
For the sake of clarity, the user can rename an old file with a new name. The command is RENAME or simply REN. The format of this resident DOS command is:
At the prompt of the logged drive containing the disk with the old filename type:
RENAME OLDNAME.TXT NEWNAME.TXT
This DOS internal command will not allow you to change a file name to one already existing in the diskette.
Notice the single space left between the arguments themselves and between Dos command and the argument oldname.
The use of wildcard is important here as they could help rename a wide range of files, for instance:
RENAME SAME*.DBF SAME*.WPF
This will change all the filename extensions of all the SAME files to Word Processing Files (WPF). To rename a file on a different drive, you would do this:
RENAME B: SAME.DBF ZAME.DBF to rename a file in B:
4.3.8 Deleting Files
Two Dos commands available for deleting files are DEL and ERASE. The format is:
DEL ZAME.DBF <ENTER>
This will delete only a file named ZAME. To delete the entire directory of ZAME (that is plus the subdirectories), enter:
DEL *.* <ENTER>
That is if you are placed inside the directory ZAME.
4.3.9 To Display the Contents of a File
To be able to simply display the contents of a file on the monitor. The command type is provided. The format is:
TYPE Filename.EXT
Indicate the filename that is plus extension if you intend to display the contents on the screen. NB: You can press CTRL + S to stop the contents on the screen from passing too fast for you.
4.3.10 To print the Contents of a File
If you need a hard copy of the contents of a file, then enter the format below:
TYPE Filename.EXT>PRN
N/B: You could also use the command PRESS CTRL + P which will sent everything on the CRT to the printer. To stop printing pre CTRL + P again.
4.4 DISK MANAGEMENT COMMANDS
Under Disk Management commands, we will examine the following commands:
- Formatting a Floppy Disk
- Inserting a Floppy Disk
- Copying disks
- Adding Dos to a formatted disk
4.4.1 Formatting a Diskette
Formatting is a process of preparing new diskettes for data storage.
The system command is FOMART.
What formatting does: it organizes the disk so Dos can store data, keep track of them and retrieve them from disk. It also ensures that there are no defective areas on the new disk. If at all the defective areas are found, FORMAT will mark them so Dos does not store data in them.
Formatting usually takes two ways: A disk can be formatted to include Dos or not. Disks that include the operating system or Dos are called system disks or boot disk or command disk and can be used to start the computer (or load the operating system). Disks that do not have the operating system stored in them have more room to store data than the former.
Procedure:
- To Format a non system or data disk
Simply enter FORMAT followed by a drive identification if the new disk is not to be in the logged drive i.e.
FORMAT or FORMAT B:
This command will prompt Dos to load format program and display the following message:
INSERT NEW DISKETTE FOR DRIVE A: and strike any key when ready.
In the file case or
INSERT NEW DISKETTE FOR DRIVE B: and strike any key when ready in the second case.
Simply put the new diskette in the indicated drive and press any key.
Dos will display:
Formatting …
After a few minutes, Dos repeats
Formatting……Format Complete 362496 bytes total disk space 362496 bytes available on disk Format another (Y/N)
To which you will answer “Y” or “N” press Y if you want to format another otherwise press N key from the keyboard.
- Formatting a disk so that it includes the
Simply follow the above procedures with addition of letter S for system thus:
FORMAT /S or FORMAT/S B:
The messages displayed are the same as the ones above with addition of the ones indicating that system transferred and how much space it required.
A disk with the system includes some hidden files the names of which do not appear when you look at the contents of the disk, and a file called COOMAND.COM. These files form the resident portion of Dos.
4.4.2 Adding Dos to a Formatted Diskette
Adding Dos to a formatted diskette is a two-step process:
- With the target diskette in B: and a system disk in the logged driver, copy the hidden files to the diskette with the SYS command:
SYS B:
SYS is a non-resident program (or transmit) i.e. it is not kept in RAM. It generates the following messages:
SYETEM TRANSFERRED
- After the above process, copy COMMAND.COM from your system disk t the disk you are modifying by entering
COPY COMMAND.COM B:
NB: you can add Dos to any diskette as long as there is enough space to store the three files. If a disk already has hidden files and you try to use SYS command to place them on the disk anyway, you will get an error message indicting that there is no room on the disk for the system. The only way to replace the hidden files once installed is only by formatting the disk again.
4.4.3 Labeling a Disk
A volume name is used to identify disks just as you identify them by writing identification information on a label placed on the disk envelope. The volume name however, is recorded on the disk itself and can be checked by the operating system to ensure that the correct disk has been installed in the disk drive.
Volume label (11 characters; ENTER for None)? MYDISKETTE 362496 bytes total disk space
362496 bytes used by the system 321536 bytes available on disk Format another (Y/N)
A>
NB: Always have some formatted disks with you because some application programs will not give the leeway to format a disk while working on it.
4.4.4 Copying Disks
There is a utility called Diskcopy that is often provided for in most versions of Ms-Dos and Pc-Dos. What this utility does is that it copies the entire contents of the source disk to the destination disk. It also transfers the operating system and formats the destination document as well.
What this utility does not do is to check for errors in the destination disk and mark them so that data is not stored in by the Dos. While using the diskcopy command, care must always be taken to clearly identify which disk contains data (i.e. the source disk) and which disk is empty (i.e. the destination disk). If this is not done, then it is possible to wipe out everything on the source disk because you inadvertently copied the contents of a blank disk to the data disk you intended to reproduce.
Procedure:
The format for DISKCOPY includes two parameters:
- Source Drive and
- Destination
To be able to execute the command, enter the following: DISKCOPY A:B:
This command will copy the contents of the entire drive A: to the one in drive B:.
NB: Everything on the disk in B:, the destination drive, will be destroyed by the operation. After the command, Dos will prompt you to insert the disks.
You can as well specify DISKCOPY B:A: if you intend to copy from drive B: to drive A:.
This method is often effective for disks that are full, otherwise we would use the command:
COPY A:*.*B:
To copy all the files in drive A: with any extension to a disk in drive B. this command as opposed to diskcopy, will always check for faulty areas on the destination drive and mark them so that no data is kept in them.
4.5 SUMMARY
- An Operating System is a set of program “housed” within the system software that standardizes the way the computer’s resources are made available for the user to applications
- The functions of an operating system are the following: Memory management, Input/Output management, Resource allocation, Error handling, Provision for user interface, Interrupt handling, File management and Job
- Operating Systems could be single user of multi user. Ms-Dos commands can be divided into File Management Commands and Disk Management Commands. Some Dos commands are internal (or resident) and some are external (non-resident or transient) which means they have to be logged first before they can be
- Examples of file management commands are: Deleting, copying and renaming files, viewing, changing and creating directories. Examples of Disk Management commands are: Copying disks, labeling disks and formatting
- Resident Dos commands include: DIR, COPY and DISKCOPY, RENAME.
- Non–resident Dos commands include: FORMAT, SYS.