Operating System

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 56

Introduction to operating system

• Operating system is a master control


program that control the overall operation
of the computer.

• Operating system is a system software.


• An operating system acts as an
intermediate between the user of a
computer and computer hardware(disk,
memory part and so on).
Computer system is divided into four parts:

1. Hardware
2. Operating system
3. Application software
4. Users
Hardware
O.S.
Application s/w
User

Structure of operating system


• The purpose of an operating system is to
provide an environment in which a user
can execute programs in convenient and
efficient manner.

• The most common operating systems are


the windows95, windows98,
windows2000, windows ME, windowsNT,
windowsXP, windowsVista, windows7.
Efficiency of operating system

• Throughput – it is the total amount of


work performed by the computer system
over a given duration of time.
2. Turnaround time – (response time)
its defined as the difference of time
between the time a user submits his job
to the system for processing and the
time he receives output.
FUNCTIONS OF O.S.

1. An operating system provides system


services, many of which can be started
automatically when the computer boots.
2. O.S. is responsible for creation, deletion,
suspension and restart of both user and
system process.

3. Handling process synchronization and


inter process communication.
4. Allocation and de-allocation of memory as
and when needed.
5. Keeping track of used and unused
memory space.
1 r
cto
Se

Track 0
Se
cto Track 1
r 2
TYPES OF OPERATING SYSTEM

1. Time sharing / Multitasking Operating


System
2. Multiprogramming Operating System
3. Real time system
4. Multi-user Operating System
5. Batch Operating System
Time sharing O.S.
• Time sharing implies that multiple task can
be handled simultaneously by the system.

• Time sharing is an operating system


features that allows several users to run
several tasks concurrently on one
processor or on many processor.
• In a time sharing system, allocates a very short
period of CPU time one by one to each user
process.

• Beginning from the first user access and proceed


through the last one. And again start from the first
one.

• The short period of time during which a user


program is known as Time slice, Time slot, or
quantum.
Advantage –
1. CPU utilization is efficient.
2. It allows user to interact with O.S. during
program execution.
3. Reduce turnaround time or response
time.
Disadvantage:-
• It requires disk management.
• It is more complex.
• In it protection & security is necessary.
• Its time between 10 to 50 milliseconds.

New Job is allocated to Job processing


job CPU for execution completed
Ready Running

Allocated time slice is


over
Job must wait for
I/O Completed I/O completion

Blocked

The process state diagram for a time sharing system


Multiprogramming
• Multiprogramming is the name given to
the one after another execution of two or
more different and independent programs
by the same computer system.

• In multiprogramming, placing two or more


user’s programs in main memory and
executing them concurrently.
• The operating speed of CPU is much faster
than that of I/O operation.

• In multiprogramming system, various users


share the time of CPU.

• When one user program waiting for I/O


transfer, there is another user program which
is ready to make use of the CPU time.
Main Memory

Program1

Program2
O/P data
Program3

Execution in progress Program4

Program5

Secondary Disk storage CPU

The operation of Multiprogramming


Advantages of Multiprogramming

• High CPU utilization


• It appears that many programs are allotted
CPU most simultaneously.
Disadvantage
• Jobs may have different sizes therefore,
memory management is needed to
accommodate them in memory.
Real Time System
• There are many application that require an
immediate response from computer.

• Application should be required that


processing should be perform within given
time limit.
• A real time system is one in which the
correctness of the computation not only
depends upon the logical correctness of
the computation.

• If the timing constraint of the system are


not met, system failure is said to have
occurred.
• Many real time system are embedded in
specialized devices such as ordinary
home application.
Real time system are two types:

1. Hard Real time system


2. Soft Real time system
Multiprocessing O.S.

• A computer system which contains one CPU is


called Uniprocessor system.

• A computer system which contains two or more


CPUs is called a multiprocessor system.

• These type of O.S. have multiple processor.


• The multiprocessor computers are mainly
of two types:

1. Shared memory type


2. Distributed memory type
Shared Memory-
• The system is referred to as shared
memory type.
• The shared portion of the main memory is
called Global Memory.
• The global memory holds programs and
data that are to be shared among the
processor.
• It contains less number of CPUs.
Distributed memory
• In the distributed memory type
multiprocessor computer, each processor
has a large local main memory.

• A distributed memory system may have no


global memory or little global memory.

• A distributed memory computer is also


called message passing computer.
Advantage of multiprocessing :
• It provide facilities more efficient utilization
of all the other devices of the computer
system.

• It gives us a facility of a built in backup.


Disadvantage of multiprocessor:
• A main memory is bigger sizes is required.

• It is very expensive.
Batch O.S.
• Batch O.S. is based on the idea of
automatic job to job transition facility
provided by almost all O.S.

• In batch mode, each user prepares his


program off line and submits it to the
computer center.
• Prepare programs transferred by Punched
Card.

• When batch of programs have been collected.


the operator loads this batch of programs into
the computer at one time.

• Where they are executed one after another.


• Batch processing is also known as serial,
sequential, stacked job processing.

Disadvantage –
• The time required to accumulate (collected) data into
batches, in some instances, destroys much of the
value of the data.

• Batch processing makes each job wait in line at each


step. and often increases its turnaround time.
• Resource utilization is not optimum.

• Strict job sequencing is required.


Classification of O.S.
• Single user O.S.
• Multi user O.S.
Compiler
• A program which translate a high level
language program into a machine
language program is called a compiler.

• A compiler is more intelligent than an


assembler. It check all kinds of limit , error
etc.
• Its program execution time is more and occupies a
larger part of the memory.

• It has low speed.

• It translate all program at a time.

• A compiler is faster than an interpreter.


Interpreter
• An interpreter is a program which translate
statement of a high level program into machine
code.

• It translates one statement of the program at a


time.

• It reads one statement of a high level language


program , translate it into machine code and
executes it.
Assembler
• A program which translates an assembly language
program into a machine language program is called an
assembler.

• An assembler which runs on a computer for which it


produce object code it called a self assembler.

• A cross assembler is an assembler that runs on a


computer other than that for which it produce machine
code.
• Assembler are two types
1. One pass assembler
2. Two pass assembler
Algorithm
• Algorithm is a sequence of statements or
instruction for solving.
• A precise statement of the procedure
required for solving a problem is called an
Algorithm.
• An algorithm represents the logic of the
processing to be performed.
• It is step by step description of how to
arrive of the solution of the given problem.
In order to quality as an algorithm a sequence
of instructions must be process the following
characteristics:-
1. Each and every instruction should be clear.
2. One or more instruction should not be
repeated infinitely.
3. After performing the instructions, that is, after
the algorithm terminates, the desired results
must be obtained.
Q.1 write a algorithm to find out addition of
two no.
c= a+b
Step1: Start
Step2: Input number a & b
Step3: use formula c= a+b
Step4: print the result c
Step5: Stop
Q.2 write a algorithm find entered no. is even or
odd.
A/2 = 0 or 1
Step1: Start
Step2: Input a number A
Step3: divide A by 2
Step4: find remainder
Step5: if remainder is 1 then A is odd
Step6: if remainder is 0 then A is even
Step7: Stop
Flow Chart
• Flow chart is a pictorial representation that uses
predefined symbols to describe logic of
computer program.

• The Algorithm is expressed in a pictorial form


called a flow chart.

• A flow chart shows the order of operation.

• It also shows the relationship between the


section of the program.
Flow Chart Symbols

Start or End

Input or Output

Processing
Decision / Condition

Connector

Flow Lines
1. Start /Stop
• It is used to indicate the beginning ,
ending in the program logic.

• It is the first and last symbol in the


program.
2. Input / Output
• It is used to denote any function of input /output
device in the program.

• The input can be supplied by the input device.


The output can be received by the output
device in the flow chart with an input/output
symbol.
3. Process
• It is used to represent arithmetic and data
movement instructions.
4. Decision
• The condition should be indicate with in
decision box.
5. Flow Lines
• Flow lines indicate the flow of operation.

• Flow lines should not cross each other.

• The normal flow of flow chart from top to


bottom & left to right.
6. Connector
• If the flow lines cross each other we can
use connector.
Addition of two numbers:-

Start

Input a , b

C= a+b

Print c

Stop

You might also like