Você está na página 1de 78

PAN African e-Network Project

PGDIT
Operating Systems and Data Storage
Semester - II
Session - 1


Mr. Abhishek Singhal
Topics to be covered
What is an Operating System
Computer System Structure
Four Components of a Computer System
Goals of Operating System
Evolution of Operating Systems
Types of Operating Systems
Simple Batch Systems
Multiprogramming Systems

Topics to be covered
Time-Sharing Systems
Parallel Systems
Distributed Systems
Real-time Systems
Functions of Operating System
Operating System Components
Operating System Services


What is an Operating System

An Operating system (OS) is an organized
collection of software modules that provide an
effective interface between the computer users
and the computer resources.
The computer resources are CPU, Main
memory, I/O Devices as Keyboard, Mouse,
Monitor, hard Disk Drive, Floppy Drive, CD ROM
etc.

What is an Operating System

The Users execute applications programs, which
make system calls to the OS modules for
allocation of resources. In response, the OS
modules provide the necessary resources in a
systematic manner. The users can also
interactively request resources through system
demands made directly to the OS commands
made directly to the OS modules. So the users
and users programs have to go through the
operating system modules for the allocation of
needed resources.
Computer System Structure
Computer system can be divided into four
components
Hardware provides basic computing
resources
CPU, memory, I/O devices
Operating system
Controls and coordinates use of hardware
among various applications and users

Computer System Structure
Application programs define the ways in
which the system resources are used to solve
the computing problems of the users
Word processors, compilers, web browsers,
database systems, video games
Users
People, machines, other computers
Four Components of a Computer System

OS as a Resource Manager

Operating systems acts as a resource manager.
OS Decides:
Which process should get what resources?
In what quantity?
At what time?
And for how long?
OS as
Resource Manager

OS as a Control Program

OS is a control program
Controls execution of programs to prevent
errors and improper use of the computer

Goals of Operating System
Convenience:
An OS makes a computer more convenient to
use.
Efficiency:
An OS allows the computer system resources
to be used in an efficient manner.
Ability to evolve:
An OS should be constructed in such a way
as to permit the effective development,
testing, and introduction of new system
functions without interfering with service.

Evolution of Operating Systems
Bare Machine Approach
Serial Processing
Batch Processing
Multiprogramming
Time Sharing Systems

Evolution of Operating Systems..
Bare Machine Approach
In the early days, programs are entered
directly in machine language to the computer
system. This is now known as bare machine
approach.
This type of scenario was available in
machines like PDP-11 where a program was
entered into RAM through front panel
switches and executed.
Evolution of Operating Systems..
Bare Machine Approach
Results are displayed on a set of LEDs mounted
on the front cover itself.
It was difficult to code a program and enter into
the system through switches.
Whole process was too time consuming. This
results low throughput.
In case of power failure, whole data was erased.



Evolution of Operating Systems..
Serial Processing
There was no OS.
These computers were run from a console
consisting of display lights, toggle switches, some
form of input device, and a printer.
Programs in machine code were loaded via the
input device (e.g., a card reader)
If an error halted the program, the error condition was
indicated by the lights.
If the program proceeded to a normal
completion, the output appeared on the printer.

Evolution of Operating Systems..
Serial Processing
Machines run from a console with display lights,
toggle switches, input device, and printer
Problems include:
Scheduling
Most installations used a hardcopy sign-up
sheet to reserve computer time.
Typically, a user could sign up for a block of
time in multiples of a half hour or so.



Evolution of Operating Systems..
Serial Processing
A user might sign up for an hour and finish in 45
minutes; this would result in wasted computer
processing time.
On the other hand, the user might run into
problems, not finish in the allotted time, and
be forced to stop before resolving the
problem.


Evolution of Operating Systems..
Serial Processing
Setup time
A single program, called a job, could involve
loading the compiler plus the high-level
language program (source program) into
memory, saving the compiled program (object
program) and then loading and linking
together the object program and common
functions.


Evolution of Operating Systems..
Serial Processing
Each of these steps could involve
mounting or dismounting tapes or setting
up card decks.
If an error occurred, the hapless user
typically had to go back to the beginning of
the setup sequence.
Thus, a considerable amount of time was
spent just in setting up the program to run


Evolution of Operating Systems..
Batch Processing
With the invention of hard disk drive, jobs are
stored now on hard disk drive. This was creating
a pool of jobs on the disk.
The Os commands written in a control language
used to be embedded in the job stream together
with the user programs and data.
A memory resident portion of the Batch OS
called Batch monitor used to read, interpret and
execute these commands automatically.
Evolution of Operating Systems..
Batch Processing
This will group the pooled jobs into separate
batches placing similar jobs having identical
needs in the same batch, based on pre-specified
criteria.
Batch systems are executed automatically one
after another without any manual intervention.
This improves system utilization.


Evolution of Operating Systems..
Multi-programming
In this, more than one programs used to be
activated concurrently.
One program are active utilizing CPU and other
programs are utilizing the I/O devices at the
same time.
Others are in the waiting state i.e. waiting for
resources to be available.
Evolution of Operating Systems..
Multi-programming
This improves utilization of system resources.
Also this will increase system throughput.
Significant performance gains are achieved by
interleaving the execution of more than one
program.


Evolution of Operating Systems..
Time Sharing Systems
In addition to multi-programming, programs are
entered and executed in an interactive mode.
Each user is assigned a time slice in a round
robin manner, during which it controls the CPU.
During the time-slice, the process gets control of
CPU and tries to complete its computation.
If computation is not completed in given
assigned time slice, said process is preempted.


Evolution of Operating Systems..
Time Sharing Systems
Then it will wait for time slice in the next round to
resume the computation from the state where it
was preempted.
Time slice is adjusted in such a manner that
each user feels that CPU has assigned all of its
time to this user only.
It decreases the drastic reduction in the program
development time.

Types of Operating Systems
Based on type of processing, operating systems
are categorized into following category:
Batch OS
Multi-programming OS
Time Sharing OS
Real Time OS
Combination OS
Distributed OS
Batch OS
This is the most primitive type of OS.
Batch Processing required that a program, its
related date and relevant control commands should
be submitted together, in the form of a job.
Batch OS allows no interaction between the users
and the executing programs.
Thus, the programs that have long execution times
and require little operator interaction during
execution, were well served by batch processing.
Batch OS
However, due to long turn-around delays and
infeasibility of online debugging, the batch
processing was not at all suitable for software
development.

Batch OS
Typical features of a batch OS are
Scheduling: The scheduling of jobs was normally in
the order of their arrival i.e. first come first served.
Memory management: Memory used to be divided
into permanent partitions-one permanently occupied
by the resident portion of OS and the other
dynamically used to load the transient programs for
execution.
I/O Management: Only one program used to be
under execution.
File Management: One file at a time, no concurrency
control.

Multi-programming OS

A multi-programming system permits multiple
programs to be loaded into the memory and
execute the programs concurrently.
A program in execution is called a process.
The concurrent execution of programs has a
significant potential for improving the utilization
of system resources and thus enhancing the
system throughput as compared to batch and
serial processing.

Multi-programming OS

This potential is exploited by multi-programming
OS, which multiplexes the computer resources
amongst a multitude of concurrent programs.
Time Sharing OS

They are large multi-programmed multi user
systems, designed for program development.
the main features of time interactive OS are:
MEMORY MANAGEMENT: Isolation and
protection of co resident programs is provided.
they do not involve much inter-process
communication.
Time Sharing OS

I/O DEVICE MANAGEMENT: they work to cope
up with the requirements of multiple users ,
contending for multiple devices. however due to
relatively slow speed of terminals and users,
processing of terminal interrupts would not be
so critical.
Time Sharing OS

FILE MANAGEMENT: since multiple users
share access to multiple files, the file
management must provide protection and
access control.
Real Time OS
It refers to the environment of embedded
systems, with a very rigid requirement to
complete the processing of input data.
In a pre-specified time, the input data, in such
systems, is invariably received from real world
sensors.
The outputs may be used to control some real-
world processes.

Real Time OS
its features are:
SCHEDULING: the primary objective here is
to provide a real time system that generates
quick response to external events. the
scheduling is normally priority based pre-
emptive in which the processes handling the
external world inputs are assigned higher
priority and whenever a higher priority
process becomes ready to run, it pre-empts a
lower running process.

Real Time OS
The real time system OS can be categorized
into:
Hard Real Time OS
Soft Real Time OS
Combination OS
Different types of OS are optimized or geared up
to serve the needs of specific environments.
However, sometimes an environment may be a
hybrid of such environments.
The commercial OS like UNIX, VMS etc. are
designed to provide a large set of services,
catering to the needs of various environments.
Such systems would normally employ time-
sliced, priority-based preemptive scheduling.

Combination OS
Different types of OS are optimized or geared up
to serve the needs of specific environments.
However, sometimes an environment may be a
hybrid of such environments.
The commercial OS like UNIX, VMS etc. are
designed to provide a large set of services,
catering to the needs of various environments.
Such systems would normally employ time-
sliced, priority-based preemptive scheduling.

Combination OS
A combination OS will be the one which caters
for the needs a wide spectrum of target
environments.
For obvious reasons, such OS will not be
optimized for a specific environment.

Distributed OS
A Distributed OS caters for a distributed
environment, wherein a collection of
autonomous computer systems, capable of
communicating and cooperating with each other
through network, are connected to each other
through a LAN/WAN.
A distributed OS governs the operation of such
a distributed system and provides a virtual
machine abstraction to users.
Distributed OS.
The Distributed OS provides means for system-
wide sharing of resources like computational
capacity, I/O and file etc.
It provide the following services:
Global Naming of resources
Distribution of Computations
Enabling processes to access remote
resources
Enabling processes to communicate with
remote processes.
Functions of Operating System
Process Management
A process is an instance of a program in
execution. It is the smallest unit of work
that is independently schedulable.
To accomplish task, process needs
resources like CPU time, memory which
are allocated to the process either at the
time of its creation or when it is executing.


Functions of Operating System
OS functions related to Process Management
Process creation, which involves loading the
program from secondary storage to memory
and commence its execution.
Process Scheduling or dispatching i.e.
transferring a process from the ready state to
run state, when it controls the CPU.
Providing mechanisms for inter-process
communication, amongst concurrent
processes.

Functions of Operating System
OS functions related to Process Management
Suspending a process, which involves
transferring the process from run state to wait
state. This is done when a running process
requests from some I/O or requests Wait for
some Event.
Resuming a process i.e., transferring it from
wait state to ready state, when the requested
I/O has been completed or the event awaited
by the process occurs.



Functions of Operating System
OS functions related to Process Management
Providing mechanism for inter process
communication among concurrent processes
and deadlock handling.
Providing deletion or process termination
which is done either by successful completion
of process or when it has committed a fatal
error.




Functions of Operating System
OS functions related to Process Management
Providing mechanisms for inter process
communication, amongst concurrent
processes.
process deletion or [process termination- this
is done when either the process has
successfully finished its execution or when it
has committed a fatal error and is so
terminated forcibly by the OS. the resources
held by the process are fed and its PCB is
deleted




Functions of Operating System
Main Memory Management
for a program to be executed, it must be mapped
to absolute address and loaded into memory.

OS is responsible for the following functions related
to memory management
keeping track of which segment of memory is in
use and by whom
deciding which processes are to be loaded into
the memory when space becomes available.

Functions of Operating System
Main Memory Management
allocation or de-allocation of dynamic
memory.
swapping in and swapping out of processes.

Functions of Operating System
I/O Devices Management
An OS will have device drivers to facilitate I/O
functions devices like key board, mouse,
monitor, disk, floppy drive, CD ROM, Printer
etc.
The device drivers are nothing but software
routines that control respective I/O devices
through their controllers.
A device driver hides the peculiarities of its
I/O device.

Functions of Operating System
Network Management
A distributed system is a collection of
processors, which do not share memory or
peripheral devices.
each processor has its clock and RAM and
communicate through a network.
it permits increased speed, functionality and
enhanced reliability.


Functions of Operating System
System Protection
it refers to the mechanism for controlling the
access to computer resources by various users
and processes.
some system protection features are
at a time only one processor is enabled to take
control of the CPU.


Functions of Operating System
System Protection
at a time only process is permitted exclusive
access to an input output device for performing
I/O.
a process access memory only within the
segments allocated to it by the OS.
a user can access a shared file only to the extent
specified by the access.


Functions of Operating System
File Management
a file is a collection of related information, defined
by its creator. they are organized into directories
and sub directories.
the OS is responsible for
creating and deleting files
creating and deleting directories.
support manipulation of files and directories.
mapping files onto secondary storage
backing up files onto media like pages.


Functions of Operating System
Secondary Storage Management
Computer Systems use disks as principle on
line storage medium, for both programs and
data.
Systems utility programs like compilers,
editors, linkers etc. are kept stored on the disk
and loaded into RAM as and when required.
Because secondary storage is used
frequently, it must be used efficiently.

Functions of Operating System
Secondary Storage Management
The OS is responsible for the following
functions related to disk management
Storage allocation
Free space management
Disk scheduling.
Functions of Operating System
Command Interpretation
It is interface between user and OS.
Many commands are given to the operating
system by control statements.
When a new job is started in a batch system,
or when a user logs onto a time-shared
system, command interpreter is executed
automatically.
Operating System Components
Operating system is divided into sub systems
according to its functions. OS functions are as
follows:
Process Management component
Memory Management Component
I/O Management Component
File Management Component
Secondary Storage Component


Operating System Components


Network Management Component
Protection System
Command Interpreter
Accounting Component

Operating System Components
Process Management Component
Mechanism for Process Creation and Deletion
CPU Scheduler
Tools for Process Synchronization such as
Semaphores
Mechanism to support Inter-Process
Communication
Mechanism for deadlock handling
Operating System Components
Memory Management Component
This component includes algorithms for
memory allocation/de-allocation, swapper,
pager etc. to manage the main memory
I/O Management Component
This component includes I/O Drivers for
various devices supported by the system and
various I/O modes supported by the devices.
This also handles interrupt servicing.

Operating System Components
File Management Component
This includes mechanism for creation/deletion
of files and directories, mechanism to support
primitives for manipulation of files and
directories and mechanism to backup the files
etc.
Secondary Storage Component
This includes mechanism for allocation/de-
allocation of disk space, management of free
space and disk scheduling etc.
Operating System Components
Network Management Component
This includes mechanism to send/receive
messages through the network-ports
supported by the system, using networking
protocols like TCP/IP etc.
Accounting Component
It keeps account of the system resources
used by various users in a time sharing
system and generates bills at pre-specified
intervals.

Operating System Components
Protection System
It includes mechanism for the protection of
resources from the user processes protection
of user process from each other and
protection of the OS from the user process.
This is achieved by ensuring that all system
resources are accessed by the processes
only through OS. During access, the OS
ensures that a user process does not violate
the access rights.
Operating System Components
Command Interpreter
This component forms the outer most layer of
the OS. It provides an interface between the
system command issued by users and the OS
routines. This component intercepts the
system components, interprets the commands
and then invokes necessary OS routines to
service the commands.
Operating System Services
Program development
The OS provides a variety of facilities and
services, such as editors and debuggers, to
assist the programmer in creating programs.
Typically, these services are in the form of
utility programs that, while not strictly part of
the core of the OS, are supplied with the OS
and are referred to as application program
development tools.
Editors and debuggers.

Operating System Services..
Program execution
A number of steps need to be performed to
execute a program.
Instructions and data must be loaded into
main memory, I/O devices and files must be
initialized, and other resources must be
prepared.
The OS handles these scheduling duties for
the user.
OS handles scheduling of numerous tasks
required to execute a program


Operating System Services..
Access I/O devices
Each I/O device requires its own peculiar set
of instructions or control signals for operation.
The OS provides a uniform interface that
hides these details so that programmers can
access such devices using simple reads and
writes.
Each device will have unique interface
OS presents standard interface to users


Operating System Services..
Controlled access to files
For file access, the OS must reflect a detailed
understanding of not only the nature of the I/O
device (disk drive, tape drive) but also the
structure of the data contained in the files on the
storage medium.
In the case of a system with multiple users, the
OS may provide protection mechanisms to
control access to the files.
Accessing different media but presenting a
common interface to users
Provides protection in multi-access systems

Operating System Services..
System access
For shared or public systems, the OS
controls access to the system as a whole and
to specific system resources.
The access function must provide protection
of resources and data from unauthorized
users and must resolve conflicts for resource
contention.
Controls access to the system and its
resources

Operating System Services..
Error detection and response
A variety of errors can occur while a computer
system is running.
These include internal and external hardware
errors, such as a memory error, or a device
failure or malfunction;
and various software errors, such as division
by zero, attempt to access forbidden memory
location, and inability of the OS to grant the
request of an application.
Operating System Services..
Error detection and response
In each case, the OS must provide a
response that clears the error condition with
the least impact on running applications.
The response may range from ending the
program that caused the error, to retrying the
operation, to simply reporting the error to the
application.
Internal and external hardware errors
Software errors
Operating system cannot grant request of
application
Operating System Services..
Accounting
A good OS will collect usage statistics for various
resources and monitor performance parameters
such as response time.
On any system, this information is useful in
anticipating the need for future enhancements
and in tuning the system to improve performance.
On a multiuser system, the information can be
used for billing purposes.
Collect usage statistics
Monitor performance

Text Books

Operating Systems Concepts, Silberschatz
Galvin, Fifth Edition Addition Wesley Publication.
Modern Operating Systems, A S Tanenbaum,
Prentice Hall of India New Delhi, 1995.

Reference books
Design of UNIX Operating System, Maurice J.
Bauch, Prentice Hall of India.
Operating Systems Design, Peterson & Galvin

References
Operating Systems Concepts, Silberschatz
Galvin, Fifth Edition Addition Wesley Publication.
Modern Operating Systems, A S Tanenbaum,
Prentice Hall of India New Delhi, 1995.
Design of UNIX Operating System, Maurice J.
Bauch, Prentice Hall of India.
Operating Systems Design, Peterson & Galvin
Operating Systems:Internals and Design
Principles, 6/E William Stallings, Prentice Hall

Thank You
Please forward your query

To: asinghal1@amity.edu
CC: manoj.amity@panafnet.com

Você também pode gostar