Anda di halaman 1dari 69

Abstract Views of an Operating System

What is an OS?
Abstract views
To a college student: SW that permits access to the Internet.
To a programmer: SW that makes it possible to develop programs
on a computer system.
To a user of an application package: SW that makes it possible to
use the package.
To a technician in a computerized chemical plant: invisible
component of a computer system that controls the plant.
An abstract view focuses only on essential characteristics

Computer H/W

Computer Peripherals

What is an OS?

Goals of OS
Fundamental goals of an operating system

Efficient use of computer resources

User convenience (Imp components of user interface)

Command Interpreter

File System

On-line-Help

Application Integration

Efficient Use
OS ensures efficient use of memory, CPU, and
I/O devices

Poor efficiency can result if a program does


not use a resource allocated to it

OS itself consumes CPU and memory


resources, which constitutes overhead It
reduces resources for user programs

OS can monitor use of resources to ensure


efficiency (It would increase the overhead)

OS uses policies that ensure efficiency

Key Concerns O S (Responsibility)

Programs

Resources

Scheduling

Protection

Computational structure & OS


resposibility
Is a configuration of one or more programs that
work towards a common goal.

Single program

Sequence of single programs

eg. .bat

Co-executing programs

eg. cat names | sort | uniq | wc-1

Resource Allocation
Two popular strategies for resource allocation
are

Partitioning of Resources. (static allocation)

Allocation from a pool. (Dynamic allocation)

Partitioning Vs Pool Allocation

Sharing Of resources
Program can share a resource in two ways

Sequential Sharing

Concurrent Sharing

Sharing of Different Resources

CPU Sharing

Memory Sharing

Disk Sharing

Virtual Resources

CPU Sharing

Memory Sharing

Memory Sharing

Virtual Resources

Security & Protection


The protection function counters threats of
unauthorized use or interference that are
posed by the users of a computer system
The security function counters simillar threats
that are posed by person outside the control of
an OS

Trojan Horse, Virus & Worms

Computer Virus
In computer security terminology, a virus is a
piece of program code that makes copies of
itself and spreads by attaching itself to a host,
often damaging the host in the process. The
host is another computer program, often a
computer operating system, which then infects
the applications that are transferred to other
computers.

Worms
A

computer worm is a selfreplicating computer program,


similar to a computer virus. A virus
attaches itself to, and becomes
part of, another executable
program; a worm is self-contained
and does not need to be part of
another program to propagate
itself. In addition to replication, a
worm may be designed to do any
number of things, such as delete
files on a host system or send
documents via email.

Trojan Horse

OS & the Computer System

Program Status Word (PSW)

Memory Hierarchy

I/O

Programmed I/O

Interrupt I/O

Direct memory access

I/O

I/O Transfer

I/O Modes

Interrupt Classes

Interrupt Action

Interrupt Action Steps

System Call
Definition : A system call is a request that a
program makes to the operation system.
A system call uses the special instruction called
software interrupt instruction.
<SI_instrn> <int_code>
Where values of <int_code> have standard
meanings in the OS.

System Call Types

Classes of Operating Systems


There are generally various types of Operating systems ,
categorized based on the
1)

How the data is entered into the system

2)

Number of users, OS can support

3)

Number of Tasks, OS can run in parallel

4)

Response time for a service

5) Type of architecture of the computer

Classes of Operating Systems

Efficiency & User convenience in


Different OS

Batch Processing System

Punch cards
Early computers often used punch cards for input both of programs
and data. Punch cards were in common use until the mid-1970s.

Above: Card from a Fortran program: Z(1) = Y + W(1)

Punch card

Above left: Punch card reader. Above right: Punch card writer.

punch tape

Above: 8-level punch tape (8 holes per row)

Batch Processing System

Turn Around Time

Turn Around Time

Time until batch is formed


Time spent in executing all jobs of the batch
Time spent in printing and sorting the result
belonging to different jobs.

Batch Monitor functions


It performs three functions

Scheduling (is implicit in information of batch)


Memory management and sharing(at boot
time)
protection

Multiprogramming System

Architectural Support for


multiprogramming

Functions of the multiprogramming


kernel

Scheduling (simple priority based scheduling)

Memory management (partitioned or pool)

I/O management (partitioned or pool)

Concepts and techniques in


multiprogramming

Performance
TRT = Number of programs processed/Total time
taken to process them
In multiprogramming system i/o-bound programs
should have higher priority than cpu-bound
programs

CPU-bound program has high


priority

I/O-bound program has high priority

Time Sharing System


In an interactive computing environment, a user
can provide input to a program from the
keyboard and examine its output on the
monitor screen. A different OS paradigm is
used in such environment to provide quick
service to user request; it creates an illusion
that each user has a computer system at his
sole disposal. This paradigm is called time
sharing

User service
User service is characterized in terms of the time
taken to service a subrequest, i.e., the
response time (rt).
Emphasis on good response times, rather than
on efficient use or throughput.

Scheduling
Each user must also receive reasonable service.
Two provisions are made to ensure this.
1. Programs are not assigned priorities because
assignment of priorities may deny OS attention
to low priority programs. Instead, programs are
executed by turns.
2. A program is prevented from consuming
unreasonable amount of CPU time when
scheduled to execute. This provision ensures
that every request will receive OS attention
without unreasonable delays.

R-R sceduling with time slicing

Responce time & efficincy

Nn No. Of users
Time of
completion
CPU time spent in
switching

Execution of programs P1 and P2


by themselves and together

CPU Burst P1,P2 are 15 & 30msec


I/O burst are 100 & 60msec

Time sharing Scheduling

Memory management
Swapping is a
technique of
temporarily
removing
inactive
programs
from the
memory of
the
computer.

Real Time Operating Systems

Distributed Operating Systems


Definition : Is a system consisting of two or more
nodes, where each node is computer system
with it's own memory, some networking h/w &
a capability of performing some of the control
functions of an OS.

Distributed Operating Systems

Key concepts & Techniques used in


a Distributed OS.

Anda mungkin juga menyukai