Unit 7: Operating Systems: Lesson 1: Functions and Types
Unit 7: Operating Systems: Lesson 1: Functions and Types
Unit 7: Operating Systems: Lesson 1: Functions and Types
Introduction
133
Computer Basics
Operating System
Computer
Hardware
The operating system controls and coordinates the use of the hardware
for different application programs.
134
Operating Systems
$END
data from program
$RUN
$LOAD
program to be compiled
$FTN
$JOB
CPU
Ο Ο Ο Ο CPU Ο Ο Ο Ο
(b)
Figure 7.3 : (a) On-line and (b) Off-line operation of I/0 devices.
135
Computer Basics
disk
I/O
CPU
card reader line printer
Spooling also provides a pool of jobs which have been read and are
waiting to be run. This pool of jobs supports the concept of
Spooling support multi- multiprogramming. With multiprogramming, several jobs are kept in
programming. memory at one time; the CPU is switched back and forth between them
in order to increase CPU utilization and to decrease the total time needed
for the execution of a job.
monitor
Job 1
Job 2
Job 3
Job 4
136
Operating Systems
CRT
CRT
Time-shared
137
Computer Basics
File system manipulation : Programs may need to read and write files
and the users create and delete files by name. The operating system
provides numeric file operations.
System Calls
138
Operating Systems
System calls can be roughly grouped into three categories: process or job
control, device and file manipulation, and information maintenance.
Systems Programs
File modification : Text editors can be used to create files and modify
the content of files stored on disks or tapes.
MS DOS
139
Computer Basics
The DOS shell also provides an overview of the contents of the hard disk
and floppy disk any time. Several programs can be started at once but
only one program runs at a time, the others are suspended. Now-a-days
use of MS DOS is very limited. Now every one use MS Windows for
their daily works.
Windows
Microsoft Windows 3.XX is an extension to the DOS operating system
and cannot run without DOS. Its is a graphical user interface whose
features extend far beyond those of the DOS Shell.
UNIX
140
Operating Systems
1.6 Exercise
1. Multiple choice questions
i) 2 components
ii) 3 components
iii) 4 components
iv) 5 component.
i) Pascal language
ii) C language
iii) Visual Basic
iv) Assembly language.
i) 1980
ii) 1982
iii) 1984
iv) 1986.
2. Analytical questions
141
Computer Basics
2.2 Functions
DOS is the shorthand for disk operating system. IBM or IBM compatible
computers use DOS. Microsoft Corporation has developed the MS-DOS.
It has the following functions:
DOS is usually stored on the hard disk inside the computer which also
stores other applications such as, word processing or accounting
programs. Application programs operate through DOS.
All work is stored in files, which are stored on disks. A computer usually
has a hard disk installed inside. Besides the hard disk, floppy disks are
also used in floppy disk drives. Each disk drive is identified by different
Disk and drives letters. The hard disk drive is conventionally known as drive C, and the
floppy disk drives as drive A, and drive B. The current drive in use as
indicated on the screen as the letter, followed by a colon (A: or C: for
example).
Directories
142
Operating Systems
America Khulna
India
China
Australia Rajshahi
Figure 7.7 shows that the directory exists on drive C. The main directory
of the disk known as the root directory and is referred to by DOS as C:.
The root directory in this case has five sub directories. The subdirectory
Asia has four more sub directories; and the subdirectory Bangladesh has
another five.
Each file must have a file name and there are rules for the way these are
made up. A name of a file has two parts, separated by a dot. The first
part comprising of up to eight characters shows the file name and the
File name Structure second part comprising of up to three characters, showing type of file
(such as a text file, a program file, etc.) is called file extension :
FILENAME.EXT.
(8characters) (3 characters)
Examples :
There are also filename extensions which should not be used for
application programs. These are: BAK, BAT, BIN, COM, EXE, OBJ,
SYS, AUX, COM, CON, DEV, LPT, NUL, PRN, etc.
143
Computer Basics
Internal Commands
External Commands
After starting the PC with its prompt A:\> or C:\> with the flashing of
hyphen (called cursor) it awaits orders from the user.
C:\>date <return>
Current date is 07-01-93
Enter new date (mm-dd-yy):
To change the date the new date should be typed following the exact
syntax shown above and the enter key should be pressed (shown by <
return> ). If no change is needed, then enter should be pressed.
144
Operating Systems
C:\>time <return>
Current time 05:45:45
Enter new time:
The new time should be typed following the syntax shown and then
enter key should be pressed. New date and time are now loaded into the
memory and anything saved now are stored under the correct date and
time.
A:\>dir <return>
The drive will start spinning and listing of all files on the disk in drive
A: will be displayed. If A: drive has the DOS diskette the display of the
following nature may appear with some additional information:
Directory of A:\
Given the command from root directory of the hard disk, (i.e., C:\>dir) a
display of all files in the root directory will be produced.
145
Computer Basics
In the example shown above each line shows the above information as
under:
If sub directories are present, dir will modify the display and show sub
directories by putting <DIR> in front of the sub directories as shown
below.
Directory of C:\
'w' stands for wide. Here the display would be spread across the screen.
Only the names of files and sub directories are displayed. This is used to
get a quick glimpse of all files on the default directory without carrying
about the details of file size, creation date, etc.
C:\>SING <return>
146
Operating Systems
C:\>
DOS understands reserved words only and responds with the message
"Bad command or filename" and returns you to C:\> Prompt.
After giving the dir command and having the directory listing on the
screen, press on the following key combination. This will print the
screen display (the printer should be on).
<Shift> <Prtscr>, i.e. Shift key and Print Screen key together.
The symbols * and ? are called wild card or global characters and they
form a set of very useful symbols for speeding up the command entry
operations. These symbols are used to represent the entire file name, part
or whole of primary file name, and part or whole of file name extension.
A:\>
147
Computer Basics
This is the A:\> prompt which not only indicates that the computer is
awaiting for orders but it also tells that the default drive is A:
The default drive can be changed any time by the following command:
A:\>B: <return>
B:\>
C: \DOS>
A DIR command can now show the files in the DOS subdirectory. The
first two files with names as and.., where (single dot) represents the root
directory and (two dots) the subdirectory. The appearance of these two
files in the directory listing confirms that the listing is for a subdirectory.
Copying Files
148
Operating Systems
If the name of the target drive B: is not given in the above command the
COPYING FILES following will result:
3) Copy all files from a disk/directory in the default drive to the disk in
any other drive, say B:
This will copy all the files with all file extensions from default drive to
the disk in drive B: under the same names and extensions as the source
disk/directory.
Removing Files
The DEL or ERASE command is used to remove files from the diskette
which are not required any more. Examples follow:
149
Computer Basics
Note that since the PROG directory has files it cannot be removed.
DOS shell
DOS Shell provides link between the users and DOS itself. This makes
DOS easier to use. To use DOS one has to type commands at a prompt
DOS shell called the command prompt; DOS Shell however, bypasses this process.
Instead of having to type different commands for DOS, DOS Shell
displays different options on the screen. When the DOS SHELL is asked
to do something- such as to find a file DOS Shell refers to DOS for the
information, DOS then passes a message back to DOS Shell and the
information appears on the screen.
150
Operating Systems
2.4 Exercises
(i) dir
(ii) cls
(iii) clear
(iv) clean.
3. Analytical Questions
151
Computer Basics
Icons
Icons are simply on-screen pictures representing files and other windows
Icons elements. In Figure 7.8 has been shown Desktop Windows and other
program icons can be seen.
Many windows contain menu bars with drop-down menus. These menus
contain choices called commands. Menus can be reverted either by
pointing with mouse or by using the Alt key along with the arrow keys
on the keyboard.
Sometimes choices will be displayed on the menus. This indicates that
something else needs to be done before the command can be executed.
For instance, a document cannot be saved until it is created.
152
Operating Systems
Some menu choices have keyboard shortcuts that will save a trip to the
menu bar. Keyboard shortcuts are often listed to the right of commands
on drop- down menus.
Dialog Boxes
Dialog boxes are windows' way of asking questions and collecting the
Dialog Boxes
necessary information to complete tasks. Dialog boxes also give
information and issue progress reports. The page setup dialog box
illustrated in Figure 7.9 is an example.
Buttons
A dialog box contains buttons of a variety of sizes and shapes. (Fig 7.9).
Buttons The OK and cancel rectangles at the bottom of the dialog box are
Check Boxes
buttons. So are the small round option buttons near the top of it
Text Boxes etc.
(Margins, paper source, etc.). Pointing to these with the mouse and
pressing the right mouse button activates the choice.
Check Boxes
The box next to the words "Facing pages" in Figure 7.9 can be noticed.
Check Boxes
This is a check box. Clicking here with your mouse works like a toggle
switch to alternately place and remove an x mark in the box. This is
another way to indicate the preferences.
Text Boxes
The margin measurements in Figure 7.9 are contained in text boxes.
Text Boxes Frequently, empty text boxes one presorted like these in which such
things as name, values, or other text can be typed. In this example,
default entries are printed, which can be changed by typing over them.
153
Computer Basics
Lists
Dialog boxes frequently contain drop-down lists. Here the mouse is used
to reveal the menu, then a choice is picked.
Selecting
When working with Windows, items are often selected. Sometimes text
Selecting
is selected, while at other times an icon or a graphic element is selected.
While the process of selection differs, the purpose is the same. A
selection tells the computer what item or items are required next.
Selecting is usually done with a mouse or other pointing device.
154
Operating Systems
Starting Windows
Running a program
First select program in the program menu and then run the
program.
Prepare a short cut of a program on the desktop and then by
double clicking the short cut, you can run the program.
155
Computer Basics
156
Operating Systems
Each Icon shown in the desktop represents each Window. Under this
Window, there are windows uses some buttons to control the program.
Using this button one can minimize, maximize, close, restore. These
buttons are called control button.
157
Computer Basics
Any file, document or sub-folder can put in the folder. This folder can
make easily from the window desktop.
158
Operating Systems
Deleting folder
Copying file
Suppose, you have two 2 folders named “SST” and “DCSA” under the
desktop. You want to copy all files under the “SST” folder in the folder
“DCSA”. You can follow the following instructions.
159
Computer Basics
Then all files from the “SST” will be copied in the folder “DCSA”.
160
Operating Systems
Pointing
When the mouse is moved around on a flat surface the on-screen mouse
pointer can be seen easily. The process of moving the pointer this way is
Pointing called pointing. Slowly spinning the trackball with the fingers moves the
on-screen pointer. Trackballs taking fewer desks space and never bumps
things on the desktop.
Clicking
Mice and trackballs for Windows have two buttons, the right and left
Clicking buttons. Each of them performs different functions. Pressing and quickly
releasing a button is called clicking. Clicking is one way of selecting
things.
161
Computer Basics
Double-Clicking
Dragging
To move icons, windows and other things around on the screen, first the
item is pointed then while holding down the mouse button the mouse is
Dragging moved to the appropriate distance and direction. Releasing the button
completes the dragging. Some objects (like windows) can only be
dragged if a particular part of the object is pointed. The Windows can be
moved by dragging on the title bar.
Fig 7.15: To get on-line help, press the function key or use the
Help Menu available in most windows.
162
Operating Systems
To quit the help, outside of the Help window is clicked or Exit from the
Help window's File menu is chosen.
Quitting Windows
First close the running program. Uses file menu ⇒close⇒ Exit.
If you select “Restart the computer” option, the window will return to
the previous position (The computer will boot again). After shutting
down the Windows, you should off the switch of the monitor, UPS and
plug.
163
Computer Basics
In UNIX system, a user can do his work in two ways. If a work requires
long time, then the users can give command to do the work in
background and the user can do another in the foreground.
UNIX system give other interesting features also. Super user can see
what other users are doing. Moreover, each user can give read, write,
and execute command to other users or a group. He can also give
protection to his file from either reading or writing. So high security and
protection system exists in UNIX operating system. Moreover, a user
can send or receive message to other UNIX operating system user.
At the start a 'Login' message appears on the terminal. Then the user's
login name is typed and enter key is pressed. After that the correct
password of the user is typed. Three types of prompt of UNIX are $ %,
164
Operating Systems
#. The super user use # prompts for exiting. From % prompt, "logout" is
typed and enter key pressed for exiting,. To exit from the $ prompt exit
is typed and the enter key is pressed.
L
LS Like the DIR Commands of DOS
LC
165
Computer Basics
3.4 Exercise
a. UNIX is
i) printing
ii) managing files
iii) protection of windows
iv) managing pages.
i) DOS
ii) UNIX
iii) Windows
iv) Linux.
3. Analytical questions
166