Unit 01
Unit 01
1
OS - means Operating system
S/W - means Software
Introduction to Operating System
Computer System
A computer system
A computer system consist of hardware (CPU, memory, I/O devices), system
consist of hardware software (operating system), application programs (compilers, DBMS, Editor,
(CPU, memory, I/O spreadsheets) and the users Fig. 1.1.
devices), system
software (operating The hardware provides the basic computing resources. The applications programs
system), application define the ways in which these resources are used to solve the computing problems
programs (compilers, of the users. The operating system controls and co-ordinates the use of the
DBMS, Editor,
hardware among the various application programs.
spreadsheets) and the
users
Application Software
System Software
Hardware
2
h/w - means hardware
2
Operating System
Control Service
Programs Programs
Control programs permit user-computer communication, log jobs, and oversee the
overall computer operation to ensure that the various activities run smoothly and to
completion. The principal control programs are shown in Fig. 1.3.
Supervisor Program
The major operating system control program is commonly called the supervisor.
The supervisor handles the overall management of a computer system. It is
The major operating
maintained in memory and it supervises the loading of other parts of the operating
system control program
is commonly called the system from secondary storage into main memory as they are needed. It also
supervisor. supervises the loading of application programs for execution. The supervisor also
interprets user messages and it keeps track of jobs.
Control
Programs
Command
Supervisor
Interpreter
3
Introduction to Operating System
Command Interpreter
The portion of the operating system that can accept, interpret and carry out user
commands is referred to as the command interpreter. The command interpreter
consists of a number of individual program modules, each responsible for handling
a single command.
The portion of the
operating system that can Individual user commands to COPY a file, FORMAT a disk and so on, are handled
accept, interpret and
by the command interpreter. Commands to the operating system of a
carry out user commands
is referred to as the microcomputer are actually requests to execute individual command interpreter
command interpreter. programs. For example, the command
COPY SUM B :
FORMAT B :
Interrupt Handler
The interrupt handler acknowledges and processes all interruptions to the system.
One of the most common sources of interrupts is from I/O devices such as the
keyboard, printer, and secondary storage. These devices must communicate with
the CPU through the operating system. Thus the operating system is never idle, but
The interrupt handler
acknowledge and
must constantly be on the alert for an interrupt triggered by internal or external
processes all events, such as an I/O device indicating that it has completed its task or that an
interruptions to the error condition may have occurred.
system.
The function of the interrupt handler can vary greatly from a microcomputer
system to a mainframe system. Most microcomputer systems handle only one task
at a time. Hence, interrupts generally come from the particular device being used at
that moment, or from a user-initiated activity, such as a command issued from the
keyboard to load a program, execute a program, or abort job.
4
Operating System
The input/output control system (IOCS) schedules and activates the proper I/O3
The input/output control device as well as the storage unit. It also monitors the operation of input/output
system (IOCS) schedules
devices. If a needed device is not available, the IOCS will substitute another device
and activates the proper
I/O device as well as the in its place. It controls and coordinates the flow of data between I/O devices, for
storage unit. example, from a terminal keyboard to a display screen, or to other output devices
like disk drives and printers.
In addition top control programs operating system also include service program.
There are two types of service programs: utility and library programs, which perform
Two types of service a variety of labor-saving tasks and functions for the programmer. Whenever a
programs: utility and specific tack is required, the appropriate service program is accessed and executed
library programs, by the operating system.
which perform a variety
of labor-saving tasks Service
and functions for the Program
programmer.
Utility Library
Programs Programs
Utility Program
3
I/O - means input/output
5
Introduction to Operating System
Utility programs give the user greater control over the computer system through
efficient file management. For example, file can be easily prepared, copied, deleted,
merged, sorted, and updated by using the appropriate utility programs.
Library Program
The library program maintains a directory of frequently used software modules and
their locations. These programs might consist of manufacturer-supplied or user-
The library program written routines or complete programs to compute mathematical functions, control
maintains a directory of
input/output devices, maintain appointments, and so on. The library program
frequently used software
modules and their
makes these routines available when requested by the user, the operating system, or
locations. an application program.
System Software consists of programs designed to facilitate the use of the computer
by the user. These programs perform such standard task as organizing and
maintaining data files, translating programs written in various languages to a
language acceptable to the hardware, scheduling jobs through the computer as well
System Software consists
of programs designed to
as aiding in other areas of general computer operations.
facilitate the use of the
computer by the user. System software refers to programs that are tools to assist the computer user to
generate application programs, debug and test them, modify them and, finally
execute them. These programs are generally written by the computer manufacturer
for one specific computer or system. The same system programs can be used by
many different users and many different application programs.
System Software can be classified as follows.
System
Software
6
Operating System
1.6. Exercise
i) programs
ii) hardware
iii) monitor
iv) all of the above.
i) 2
ii) 3
iii) 4
iv) None of the above.
7
Introduction to Operating System
Let us start with the simple class, the serial batch processing operating system.
Serial batch processing operating systems can run only a single user program at a
time. These are simple systems generally used on mainframes that run in batch
mode and on single-user microcomputers. In another words, a system in which a
Running one program at number of similar items or transactions to be processed are grouped (bathed) for
a time.
sequential processing during a machine run. For example, suppose the operators
received one FORTRAN job, one COBOL job and another FORTRAN job. If they ran
them in that order, they would have to set up for FORTRAN (load the compiler
tapes), then set up for COBOL and finally set up for FORTRAN again. If they ran
the two FORTRAN programs as a batch, however, they could set up only once for
FORTRAN, saving operator time. The following diagram shows how each program
is run before the next begins.
8
Operating System
O Jobs executed
P sequentially by
E S
R Y the CPU.
A S
T T
I E Job B
N M
G
OUTPUT LISTINGS
Job A
advantages
disadvantages
CP/M, DOS, and Macintosh operating system are the example of serial batch-
processing systems.
Multiprogramming is similar to the work of a lawyer. A lawyer does not have only
one client at a time. Rather several clients may be in the process of being served at
9
Introduction to Operating System
the same time. While one case is waiting to go to trial or for papers to be typed, the
lawyer can work on another case; with enough clients, a lawyer need never be idle.
MULTIPLE
INPUTS
O
.
Jobs are
P . executed
S
E .
Job A executing concurrently,
Y
R Job B executing
. utilizing CPU
S
A Job C executing time spent by
T
T Job D executing others jobs
E
I awaiting I/O or
M
N . storage.
G .
MULTIPLE
OUTPUTS
The primary reason multiprogramming operating systems were developed, and the
reason they are popular, is that they enable the CPU to be utilized more efficiently.
If the operating system can quickly switch the CPU to another task whenever the
one being worked on requires relatively slow input, output, or storage operations,
then the CPU is not allowed to stand idle. This means that more can be
accomplished during a given amount of time. For example, if a particular program
needs to read data from a disk drive, that task can be delegated to channel and the
CPU can be put to work on another program while the data are being read in.
Multiprogramming is thus an effective way to keep the fast-working CPU busy
with computations while slower input, output, and storage operations are being
carried out.
advantages
10
Operating System
disadvantages
disadvantages
it is fairly sophisticated and more complex than serial batch processing
operating system.
a multiprogramming operating systems must keep track of all the jobs it is
concurrently running.
11
Introduction to Operating System
2.5. Exercise
3. Multiprogramming increases
i) real time
ii) execution time
iii) CPU utilization
iv) minimizes throughput.
12
Operating System
Time sharing operating systems are time driven multiprogramming systems that
serve several users concurrently by rapidly switching among them. With time
Serving several users
sharing systems, many users simultaneously share computer resources. Each makes
concurrently. use of a tiny slice of CPU time and then relinquishes the CPU to another uses. As
the system switches rapidly from one user to the next, user are given the impression
that they each have their own computer. Users to be unaware that there are other
users on the system.
2 - millisecond JOBA
time slices of JOBB
CUP attention JOBC
JOBD
JOBB
JOBA
Job B is given
higher priority by
allowing it two
time slices per 13
cycle.
Introduction to Operating System
JOBB
One cycle
JOBC
JOBD
JOBB
JOBA
JOBB
JOBC
JOBD
JOBB
14
Operating System
Common
main
storage
Video High-speed
display printers
termainals
15
Introduction to Operating System
3.4. Exercises
i) event driven
ii) time driven
iii) input driven
iv) output driven.
i) 2 general types
ii) 3 general types
iii) 4 general types
iv) 5 general types.
16
Operating System
Process control systems take input data from sensors, analyze them and then cause
actions to occur that change the processes that they control.
Process monitor systems also take input data from sensors, but they merely report
the data without actually affecting the processes that they are monitoring.
Both of these types of real-time operating systems are being used for more and
more industrial and military applications. Real time operating systems are currently
Uses being used for such applications as automated environmental monitoring for air
and water pollution, directing and monitoring the flows in a chemical plant, police
inquiry system, airline reservation, microscopic assembly processes, medical
analysis systems, air and automobile traffic control, factory production, oil pipeline
regulation and some display systems.
Sensor
cpu
Control
17
Introduction to Operating System
Real time systems are required to be highly reliable. For example, failure of a
system which controls a space vehicle in motion may result in a fatal accident. In
such cases, duplicate systems are used so that if one system fails, the other will take
over.
4.3.1. Segmentation
Subroutine C
Segment 3
Subroutine D
Segment 4
18
Operating System
4.3.2. Paging
Paging is similar to segmentation except that programs are divided into equal sized
portions. As with segmentation, the operating systems keeps track of page locations
by constructing page table. As pages are fixed sizes, the use of paging can result in
less waste of real storage space. Since segments can be of different sizes, swapping
in new segments from virtual storage can leave little fragments of unused space in
real memory. By making all program pieces the same size, paging eliminates this
type of waste.
SECONDARY STORAGE
PRIMARY STORAGE (virtual storage)
(real storage)
Program
Page 1
Page 2 Pages transferred
into real storage
as needed Page 2
Page 3
Page 4
Page 5
End of program
19
Introduction to Operating System
4.4. Exercises
1. How many types of real-time operating system are there in this lesson?
i) 2
ii) 3
iii) 4
iv) 5.
20
Operating System
21
Introduction to Operating System
22
Operating System
Allocation of Resources : If, there are multiple users or multiple jobs running
Allocation of resources at the same time, then an operating system must coordinate the use of all
available resources. A good operating system accomplishes this in the most
efficient manner possible.
OS have been evolving through the years. In the following sections we will briefly
look at this development.
The earliest computer systems had no operating systems; users had access to
computer resources only via machine language programs. Programs were run one
at a time by computer operators who manually entered the commands to initiate
and complete each one. This pattern of usage wasted a great deal of computer time,
since the CPU remained idle between the completion of one task and the initiation
of the next.
History of OS The 1950s were marked by the development of rudimentary operating systems
designed to smooth the transitions between jobs (a job is any program or part of a
program that is to be processed as a unit by a computer). This was the start of batch
progressing, in which programs to be executed were grouped into batches. While a
particular program was running, it had total control of the computer. When it
finished, control was returned to the operating system, which handed any
necessary finalizations and read in and started up the next job. By letting the
computer handle the transition between one job and the next instead of having it
done manually, less time we taken up and the CPU was more efficiently utilized.
During the 1960s, operating systems became much more sophisticated, leading up
to the development of shared system. These multiprogramming, time-sharing and
multiprocessing systems (which we have defined and discussed in more detail in
the previous lessons) allowed several user programs to be run on a single computer
system, seemingly at the same time. Additionally, these systems were the first to
allow usage to take place in interactive, or conversational, mode, in which the user
communicates directly with the computer, rather than submitting jobs and
passively waiting for their completion. These developments made computer
systems more widely accessible and easier to use.
23
Introduction to Operating System
Real-time systems also emerged during the 1960s. These operating systems enabled
computers to be used to control systems characterized by the need for immediate
response, such as weapons systems or industrial plants. For example, if an oil
refinery is being controlled by a real-time system, hat system must responds
immediately to temperature conditions that could cause an explosion.
In the late 1960s and the early 1970s, there was a trend toward general-purpose
operating systems. These tried to be all things to all users. Often called multi-mode
systems, some of them simultaneously supported batch processing, time sharing,
real-time processing and multiprocessing. They were large, expensive, and difficult
to develop and maintain, but they helped sell a lot of computers. The prime
example of this type of operating system was the one offered with the IBM 360
family of computers first introduced in 1964. To get one of these monsters to
perform even the simplest task, users had to learn a complex job control language
(JCL) and employ it to specify how their programs were to be run and what
resources they would need.
The operating systems from the mid-1970s to the present cannot be characterized by
a single, all-encompassing feature. The development of microcomputers and of
simple, easy-to-use, single-user operating system has had a profound effect on the
newest systems being developed for all types of computers. The features most in
demand are a high degree of user-friendliness and a computing environment that is
menu-driven (refers to the user of displays and prompts that aid users in selecting
History of operating
system. functions). Also, operating systems that support on-line processing, computer
networking, data security, and distributed data processing are the latest word.
Modern operating systems create a virtual machine, an interface that relieves the
user of any need to be concerned about most of the physical details of the computer
system or network being accessed. The virtual machine presented by the operating
system lets users concentrate on getting done what they need, without having to be
familiar with the internal functioning of the actual hardware.
Most operating system researches and development has been done for mainframes
computers. Mainframe operating systems have been developing over the last thirty
years.
24
Operating System
25
Introduction to Operating System
5.5. Exercises
i) Memory management
ii) CPU management
iii) I/O and file management
iv) Debugging programs.
i) 2
ii) 3
iii) 4
iv) None of the above.
26