Paging - Softdot Education

wackybabiesSoftware and s/w Development

Dec 14, 2013 (3 years and 7 months ago)

147 views


SoftDot Hi

Tech Educational & Training Institute

(A unit of De Unique Educational Society
)

__________________________________________________

SoftD
ot Hi

Tech

Educational & Training Institute


South

Extensi
on



PitamPura


Preet Vihar


Janakpuri




New Delhi



New Delhi

New Delhi


New Delhi

1

UNIT
-
1

Operating System Overview


DEFINITION


Operating system acts as interface between the user and the computer hardware. They
sit between the user and the hardware of the computer providing an operational
environment to the users and application progra
ms. For a user, therefore, a computer
is nothing but the operating system running on it. It is an extended machine.


User does not interact with the hardware of a computer directly but through the
services offered by OS. This is because the language that u
sers employ is different
from that of the hardware where as users prefer to use natural language or near
natural language for interaction, the hardware uses machine language. Os takes
instruction in the form of commands from the user and translates into ma
chine
understandable instructions, gets these instructions executed by CPU and translates
the result back into user understandable form.




OS is a
resource
allocate



Manages all resources



Decides between conflicting requests for efficient and fair resource u
se


OS is a
control program



Controls execution of programs to prevent errors and improper use of the computer


COMPUTER SYSTEM SATRT

UP




Bootstrap program

is loaded at power
-
up or reboot.



Typically stored in ROM or EPROM, generally known as
fir
mware.



Initialized all aspects of system



Loads operating system kernel and starts execution










COMPUTER SYSTEM ORGANIZATION


SoftDot Hi

Tech Educational & Training Institute

(A unit of De Unique Educational Society
)

__________________________________________________

SoftD
ot Hi

Tech

Educational & Training Institute


South

Extensi
on



PitamPura


Preet Vihar


Janakpuri




New Delhi



New Delhi

New Delhi


New Delhi

2




One or more CPUs, device controllers connect through common bus providing
access to shared memory.



Concurrent execution of C
PUs and devices competing for memory cycles.



I/O devices and the CPU can execute concurrently.



Each device controller is in charge of a particular device type.



Each device controller has a local buffer.



CPU moves data from/to main memory to/from local buff
ers.



I/O is from the device to local buffer of controller.



Device controller informs CPU that it has finished its operation by causing an
interrupt
.




Fig

Computer System Organization



COMPUTER SYSTEM STRUCTURE



Computer system can be divided into four c
omponents



Hardware : provides basic computing resources



CPU, memory, I/O devices




Operating system:



Controls and coordinates use of hardware among various applications and users






SoftDot Hi

Tech Educational & Training Institute

(A unit of De Unique Educational Society
)

__________________________________________________

SoftD
ot Hi

Tech

Educational & Training Institute


South

Extensi
on



PitamPura


Preet Vihar


Janakpuri




New Delhi



New Delhi

New Delhi


New Delhi

3

Operating system goals




Execute user programs and make solving user proble
ms easier.



Make the computer system convenient to use.



Application programs :

o

It define the ways in which the system resources are used to solve the
computing problems of the users

o

Word processors, compilers, web browsers, database systems, video
games



Us
ers: People, machines, other computers



F
F
o
o
u
u
r
r


C
C
o
o
m
m
p
p
o
o
n
n
e
e
n
n
t
t
s
s


o
o
f
f


a
a


C
C
o
o
m
m
p
p
u
u
t
t
e
e
r
r


S
S
y
y
s
s
t
t
e
e
m
m








Fig

Extended machine view of operating system



O
O
P
P
E
E
R
R
A
A
T
T
I
I
N
N
G
G


S
S
Y
Y
S
S
T
T
E
E
M
M


C
C
L
L
A
A
S
S
S
S
I
I
F
F
I
I
C
C
A
A
T
T
I
I
O
O
N
N








A
A
l
l
l
l


o
o
p
p
e
e
r
r
a
a
t
t
i
i
n
n
g
g


s
s
y
y
s
s
t
t
e
e
m
m


c
c
o
o
n
n
t
t
a
a
i
i
n
n


t
t
h
h
e
e


s
s
a
a
m
m
e
e


c
c
o
o
m
m
p
p
o
o
n
n
e
e
n
n
t
t
s
s


w
w
h
h
o
o
s
s
e
e


f
f
u
u
n
n
c
c
t
t
i
i
o
o
n
n
a
a
l
l
i
i
t
t
i
i
e
e
s
s


a
a
r
r
e
e


a
a
l
l
m
m
o
o
s
s
t
t


t
t
h
h
e
e


s
s
a
a
m
m
e
e
.
.


F
F
o
o
r
r


i
i
n
n
s
s
t
t
a
a
n
n
c
c
e
e
,
,


a
a
l
l
l
l


t
t
h
h
e
e


o
o
p
p
e
e
r
r
a
a
t
t
i
i
n
n
g
g


s
s
y
y
s
s
t
t
e
e
m
m
s
s


p
p
e
e
r
r
f
f
o
o
r
r
m
m


t
t
h
h
e
e


f
f
u
u
n
n
c
c
t
t
i
i
o
o
n
n
s
s


o
o
f
f


s
s
t
t
o
o
r
r
a
a
g
g
e
e


m
m
a
a
n
n
a
a
g
g
e
e
m
m
e
e
n
n
t
t
,
,


p
p
r
r
o
o
c
c
e
e
s
s
s
s


m
m
a
a
n
n
a
a
g
g
e
e
m
m
e
e
n
n
t
t
,
,


p
p
r
r
o
o
t
t
e
e
c
c
t
t
i
i
o
o
n
n


o
o
f
f


u
u
s
s
e
e
r
r
s
s


f
f
r
r
o
o
m
m


o
o
n
n
e
e
-
-
a
a
n
n
o
o
t
t
h
h
e
e
r
r
,
,


e
e
t
t
c
c
.
.






O
O
p
p
e
e
r
r
a
a
t
t
i
i
n
n
g
g


s
s
y
y
s
s
t
t
e
e
m
m


i
i
n
n


g
g
e
e
n
n
e
e
r
r
a
a
l
l
,
,


p
p
e
e
r
r
f
f
o
o
r
r
m
m
s
s


s
s
i
i
m
m
i
i
l
l
a
a
r
r


f
f
u
u
n
n
c
c
t
t
i
i
o
o
n
n
s
s


b
b
u
u
t
t


m
m
a
a
y
y


h
h
a
a
v
v
e
e



SoftDot Hi

Tech Educational & Training Institute

(A unit of De Unique Educational Society
)

__________________________________________________

SoftD
ot Hi

Tech

Educational & Training Institute


South

Extensi
on



PitamPura


Preet Vihar


Janakpuri




New Delhi



New Delhi

New Delhi


New Delhi

4

d
d
i
i
s
s
t
t
i
i
n
n
g
g
u
u
i
i
s
s
h
h
i
i
n
n
g
g


f
f
e
e
a
a
t
t
u
u
r
r
e
e
s
s
.
.


T
T
h
h
e
e
r
r
e
e
f
f
o
o
r
r
e
e
,
,


t
t
h
h
e
e
y
y


c
c
a
a
n
n


b
b
e
e


c
c
l
l
a
a
s
s
s
s
i
i
f
f
i
i
e
e
d
d


i
i
n
n
t
t
o
o


d
d
i
i
f
f
f
f
e
e
r
r
e
e
n
n
t
t


c
c
a
a
t
t
e
e
g
g
o
o
r
r
i
i
e
e
s
s


o
o
n
n


d
d
i
i
f
f
f
f
e
e
r
r
e
e
n
n
t
t


b
b
a
a
s
s
e
e
s
s
.
.








D
D
i
i
f
f
f
f
e
e
r
r
e
e
n
n
t
t


t
t
y
y
p
p
e
e
s
s


o
o
f
f


o
o
p
p
e
e
r
r
a
a
t
t
i
i
n
n
g
g


s
s
y
y
s
s
t
t
e
e
m
m








S
S
i
i
n
n
g
g
l
l
e
e


u
u
s
s
e
e
r
r
-
-


S
S
i
i
n
n
g
g
l
l
e
e


P
P
r
r
o
o
c
c
e
e
s
s
s
s
i
i
n
n
g
g


S
S
y
y
s
s
t
t
e
e
m
m
:
:
-
-






I
I
t
t


h
h
a
a
s
s


a
a


s
s
i
i
n
n
g
g
l
l
e
e


p
p
r
r
o
o
c
c
e
e
s
s
s
s
o
o
r
r
,
,


r
r
u
u
n
n
s
s


a
a


s
s
i
i
n
n
g
g
l
l
e
e


p
p
r
r
o
o
g
g
r
r
a
a
m
m


a
a
n
n
d
d


i
i
n
n
t
t
e
e
r
r
a
a
c
c
t
t
s
s


w
w
i
i
t
t
h
h


a
a


s
s
i
i
n
n
g
g
l
l
e
e


u
u
s
s
e
e
r
r


a
a
t
t


a
a


t
t
i
i
m
m
e
e
.
.


T
T
h
h
e
e


O
O
S
S


f
f
o
o
r
r


t
t
h
h
i
i
s
s


s
s
y
y
s
s
t
t
e
e
m
m


i
i
s
s


v
v
e
e
r
r
y
y


s
s
i
i
m
m
p
p
l
l
e
e


t
t
o
o


d
d
e
e
s
s
i
i
g
g
n
n


a
a
n
n
d
d


i
i
m
m
p
p
l
l
e
e
m
m
e
e
n
n
t
t
.
.


E
E
x
x
a
a
m
m
p
p
l
l
e
e
:
:


-
-


M
M
S
S
-
-
D
D
O
O
S
S






O
O
n
n
l
l
y
y


o
o
n
n
e
e


p
p
r
r
o
o
g
g
r
r
a
a
m
m


r
r
e
e
s
s
i
i
d
d
e
e
s
s


i
i
n
n


c
c
o
o
m
m
p
p
u
u
t
t
e
e
r
r


m
m
e
e
m
m
o
o
r
r
y
y


a
a
n
n
d
d


i
i
t
t


r
r
e
e
m
m
a
a
i
i
n
n
s
s


t
t
h
h
a
a
t
t


t
t
i
i
l
l
l
l


i
i
t
t


i
i
s
s


e
e
x
x
e
e
c
c
u
u
t
t
e
e
d
d
.
.


I
I
t
t


i
i
s
s


a
a
l
l
s
s
o
o


c
c
a
a
l
l
l
l
e
e
d
d


u
u
n
n
i
i
-
-
p
p
r
r
o
o
g
g
r
r
a
a
m
m


O
O
S
S
.
.


I
I
n
n


t
t
h
h
i
i
s
s


O
O
S
S
,
,


t
t
h
h
e
e


w
w
h
h
o
o
l
l
e
e
,
,


m
m
e
e
m
m
o
o
r
r
y
y


s
s
p
p
a
a
c
c
e
e


i
i
s
s


a
a
l
l
l
l
o
o
c
c
a
a
t
t
e
e
d
d


t
t
o
o


o
o
n
n
e
e


p
p
r
r
o
o
g
g
r
r
a
a
m
m


t
t
o
o


m
m
e
e
m
m
o
o
r
r
y
y


m
m
a
a
n
n
a
a
g
g
e
e
m
m
e
e
n
n
t
t


s
s


n
n
o
o
t
t


v
v
e
e
r
r
y
y


d
d
i
i
f
f
f
f
i
i
c
c
u
u
l
l
t
t


t
t
a
a
s
s
k
k


t
t
o
o


d
d
o
o
.
.


T
T
h
h
e
e


C
C
P
P
U
U


h
h
a
a
s
s


t
t
o
o


e
e
x
x
e
e
c
c
u
u
t
t
e
e


o
o
n
n
l
l
y
y


1
1


p
p
r
r
o
o
g
g
r
r
a
a
m
m


a
a
t
t


a
a


t
t
i
i
m
m
e
e
,
,


s
s
o
o


t
t
h
h
a
a
t
t


C
C
P
P
U
U


m
m
a
a
n
n
a
a
g
g
e
e
m
m
e
e
n
n
t
t


a
a
l
l
s
s
o
o


d
d
o
o
e
e
s
s


n
n
o
o
t
t


h
h
a
a
v
v
e
e


a
a
n
n
y
y


p
p
r
r
o
o
b
b
l
l
e
e
m
m
.
.






I
I
n
n


a
a


s
s
i
i
n
n
g
g
l
l
e
e


u
u
s
s
e
e
r
r


O
O
S
S
,
,


a
a


s
s
i
i
n
n
g
g
l
l
e
e


u
u
s
s
e
e
r
r


c
c
a
a
n
n


a
a
c
c
c
c
e
e
s
s
s
s


t
t
h
h
e
e


c
c
o
o
m
m
p
p
u
u
t
t
e
e
r
r


a
a
t
t


a
a


p
p
a
a
r
r
t
t
i
i
c
c
u
u
l
l
a
a
r
r


t
t
i
i
m
m
e
e
.
.


T
T
h
h
e
e


c
c
o
o
m
m
p
p
u
u
t
t
e
e
r
r


w
w
h
h
i
i
c
c
h
h


a
a
r
r
e
e


b
b
a
a
s
s
e
e
d
d


o
o
n
n


t
t
h
h
i
i
s
s


O
O
S
S


h
h
a
a
v
v
e
e


a
a


s
s
i
i
n
n
g
g
l
l
e
e


p
p
r
r
o
o
c
c
e
e
s
s
s
s
o
o
r
r


a
a
n
n
d
d


a
a
b
b
l
l
e
e


t
t
o
o


e
e
x
x
e
e
c
c
u
u
t
t
e
e


o
o
n
n
l
l
y
y


a
a


s
s
i
i
n
n
g
g
l
l
e
e


p
p
r
r
o
o
g
g
r
r
a
a
m
m


a
a
t
t


a
a


p
p
a
a
r
r
t
t
i
i
c
c
u
u
l
l
a
a
r
r


t
t
i
i
m
m
e
e
.
.


T
T
h
h
i
i
s
s


s
s
y
y
s
s
t
t
e
e
m
m


p
p
r
r
o
o
v
v
i
i
d
d
e
e
s
s


a
a
l
l
l
l


t
t
h
h
e
e


r
r
e
e
s
s
o
o
u
u
r
r
c
c
e
e
s
s


t
t
o
o


t
t
h
h
e
e


u
u
s
s
e
e
r
r
s
s


a
a
l
l
l
l


t
t
h
h
e
e


t
t
i
i
m
m
e
e
.
.


T
T
h
h
e
e


s
s
i
i
n
n
g
g
l
l
e
e


u
u
s
s
e
e
r
r


O
O
S
S


i
i
n
n
t
t
o
o


f
f
o
o
l
l
l
l
o
o
w
w
i
i
n
n
g
g


c
c
a
a
t
t
e
e
g
g
o
o
r
r
i
i
e
e
s
s
:
:


-
-




S
S
i
i
n
n
g
g
l
l
e
e


u
u
s
s
e
e
r
r
,
,


s
s
i
i
n
n
g
g
l
l
e
e


t
t
a
a
s
s
k
k
i
i
n
n
g
g
:
:






I
I
n
n


a
a


s
s
i
i
n
n
g
g
l
l
e
e


u
u
s
s
e
e
r
r
,
,


s
s
i
i
n
n
g
g
l
l
e
e


t
t
a
a
s
s
k
k
i
i
n
n
g
g


O
O
S
S
,
,


T
T
h
h
e
e
r
r
e
e


i
i
s
s


a
a


s
s
i
i
n
n
g
g
l
l
e
e


u
u
s
s
e
e
r
r


t
t
o
o


e
e
x
x
e
e
c
c
u
u
t
t
e
e


a
a


p
p
r
r
o
o
g
g
r
r
a
a
m
m


a
a
t
t


a
a


p
p
a
a
r
r
t
t
i
i
c
c
u
u
l
l
a
a
r
r


s
s
y
y
s
s
t
t
e
e
m
m
.
.








E
E
x
x
a
a
m
m
p
p
l
l
e
e




=
=
j
j
p
p
-
-
a
a
l
l
p
p
=
=
=
=
S
S
i
i
n
n
g
g
l
l
e
e


u
u
s
s
e
e
r
r
,
,


m
m
u
u
l
l
t
t
i
i
t
t
a
a
s
s
k
k
i
i
n
n
g
g


O
O
S
S
:
:






I
I
n
n


s
s
i
i
n
n
g
g
l
l
e
e


u
u
s
s
e
e
r
r
,
,


m
m
u
u
l
l
t
t
i
i
t
t
a
a
s
s
k
k
i
i
n
n
g
g


O
O
S
S


a
a


s
s
i
i
n
n
g
g
l
l
e
e


u
u
s
s
e
e
r
r


c
c
a
a
n
n


e
e
x
x
e
e
c
c
u
u
t
t
e
e


m
m
u
u
l
l
t
t
i
i
p
p
l
l
e
e


p
p
r
r
o
o
g
g
r
r
a
a
m
m
s
s
.
.






E
E
x
x
a
a
m
m
p
p
l
l
e
e




=
=
A
A
=
=
u
u
s
s
e
e
r
r
=
=
c
c
a
a
n
n
=
=
p
p
r
r
o
o
g
g
r
r
a
a
m
m
=
=
d
d
i
i
f
f
f
f
e
e
r
r
e
e
n
n
t
t
=
=
p
p
r
r
o
o
g
g
r
r
a
a
m
m
s
s
=
=
s
s
u
u
c
c
h
h
=
=
a
a
s
s
=
=
m
m
a
a
k
k
i
i
n
n
g
g
=
=
c
c
a
a
l
l
c
c
u
u
l
l
a
a
t
t
i
i
o
o
n
n
s
s
=
=
i
i
n
n
=
=
e
e
x
x
c
c
e
e
l
l
=
=
s
s
h
h
e
e
e
e
t
t
I
I
=
=
p
p
r
r
i
i
n
n
t
t
i
i
n
n
g
g
=
=
a
a
=
=
w
w
o
o
r
r
d
d
=
=
d
d
o
o
c
c
u
u
m
m
e
e
n
n
t
t
=
=
C
C
=
=
d
d
o
o
w
w
n
n
l
l
o
o
a
a
d
d
i
i
n
n
g
g
=
=
i
i
n
n
t
t
o
o
=
=
t
t
h
h
e
e
=
=
f
f
i
i
l
l
e
e
=
=
f
f
r
r
o
o
m
m
=
=
i
i
n
n
t
t
e
e
r
r
n
n
e
e
t
t
=
=
a
a
t
t
=
=
t
t
h
h
e
e
=
=
s
s
a
a
m
m
e
e
=
=
t
t
i
i
m
m
e
e
K
K
=
=
=
=
=
=
啓䕒
=
䅰灬楣A瑩潮⁐牯rra浳
=
佰l牡瑩ng⁓y獴

=
䡡牤ra牥
=

SoftDot Hi

Tech Educational & Training Institute

(A unit of De Unique Educational Society
)

__________________________________________________

SoftD
ot Hi

Tech

Educational & Training Institute


South

Extensi
on



PitamPura


Preet Vihar


Janakpuri




New Delhi



New Delhi

New Delhi


New Delhi

5







A
A
d
d
v
v
a
a
n
n
t
t
a
a
g
g
e
e
s
s


o
o
f
f


s
s
i
i
n
n
g
g
l
l
e
e


u
u
s
s
e
e
r
r


O
O
S
S
:
:
-
-


o
o


T
T
h
h
e
e


C
C
P
P
U
U


h
h
a
a
s
s


t
t
o
o


h
h
a
a
n
n
d
d
l
l
e
e


o
o
n
n
l
l
y
y


o
o
n
n
e
e


a
a
p
p
p
p
l
l
i
i
c
c
a
a
t
t
i
i
o
o
n
n


p
p
r
r
o
o
g
g
r
r
a
a
m
m


a
a
t
t


a
a


t
t
i
i
m
m
e
e


s
s
o
o


t
t
h
h
a
a
t
t


p
p
r
r
o
o
c
c
e
e
s
s
s
s


m
m
a
a
n
n
a
a
g
g
e
e
m
m
e
e
n
n
t
t


i
i
s
s


e
e
a
a
s
s
y
y


i
i
n
n


t
t
h
h
i
i
s
s


e
e
n
n
v
v
i
i
r
r
o
o
n
n
m
m
e
e
n
n
t
t
.
.


o
o


D
D
u
u
e
e


t
t
o
o


t
t
h
h
e
e


l
l
i
i
m
m
i
i
t
t
e
e
d
d


n
n
u
u
m
m
b
b
e
e
r
r


o
o
f
f


p
p
r
r
o
o
g
g
r
r
a
a
m
m
s
s


a
a
l
l
l
l
o
o
c
c
a
a
t
t
i
i
o
o
n
n


o
o
f
f


m
m
e
e
m
m
o
o
r
r
y
y


t
t
o
o


t
t
h
h
e
e


p
p
r
r
o
o
c
c
e
e
s
s
s
s


&
&


a
a
l
l
l
l
o
o
c
c
a
a
t
t
i
i
o
o
n
n


o
o
f
f


r
r
e
e
s
s
o
o
u
u
r
r
c
c
e
e
s
s


t
t
o
o


t
t
h
h
e
e


p
p
r
r
o
o
c
c
e
e
s
s
s
s


b
b
e
e
c
c
o
o
m
m
e
e
s
s


a
a
n
n
y
y


e
e
a
a
s
s
y
y


t
t
a
a
s
s
k
k


t
t
o
o


h
h
a
a
n
n
d
d
l
l
e
e
.
.








D
D
i
i
s
s
a
a
d
d
v
v
a
a
n
n
t
t
a
a
g
g
e
e
s
s


o
o
f
f


s
s
i
i
n
n
g
g
l
l
e
e


u
u
s
s
e
e
r
r


O
O
S
S
:
:
-
-


o
o


A
A
s
s


t
t
h
h
e
e


O
O
S
S


i
i
s
s


h
h
a
a
n
n
d
d
l
l
i
i
n
n
g
g


o
o
n
n
e
e


a
a
p
p
p
p
l
l
i
i
c
c
a
a
t
t
i
i
o
o
n
n


a
a
t
t


a
a


t
t
i
i
m
m
e
e


m
m
o
o
s
s
t
t


o
o
f
f


t
t
h
h
e
e


C
C
P
P
U
U


t
t
i
i
m
m
e
e


i
i
s
s


w
w
a
a
s
s
t
t
e
e
d
d
,
,


b
b
e
e
c
c
a
a
u
u
s
s
e
e


i
i
t
t


h
h
a
a
s
s


t
t
o
o


s
s
i
i
t
t


i
i
d
d
l
l
e
e


m
m
o
o
s
s
t
t


o
o
f
f


t
t
h
h
e
e


t
t
i
i
m
m
e
e


w
w
h
h
i
i
l
l
e
e


e
e
x
x
e
e
c
c
u
u
t
t
i
i
n
n
g
g


a
a


s
s
i
i
n
n
g
g
l
l
e
e


p
p
r
r
o
o
g
g
r
r
a
a
m
m
.
.


o
o


R
R
e
e
s
s
o
o
u
u
r
r
c
c
e
e
s
s


l
l
i
i
k
k
e
e


m
m
e
e
m
m
o
o
r
r
y
y
,
,


C
C
P
P
U
U


a
a
r
r
e
e


n
n
o
o
t
t


u
u
t
t
i
i
l
l
i
i
z
z
e
e
d
d


a
a
t
t


t
t
h
h
e
e


m
m
a
a
x
x
i
i
m
m
u
u
m
m
.
.






B
B
a
a
t
t
c
c
h
h


P
P
r
r
o
o
c
c
e
e
s
s
s
s
i
i
n
n
g
g


S
S
y
y
s
s
t
t
e
e
m
m
s
s








T
T
h
h
e
e


m
m
a
a
i
i
n
n


f
f
u
u
n
n
c
c
t
t
i
i
o
o
n
n


o
o
f
f


a
a


b
b
a
a
t
t
c
c
h
h


p
p
r
r
o
o
c
c
e
e
s
s
s
s
i
i
n
n
g
g


s
s
y
y
s
s
t
t
e
e
m
m


i
i
s
s


t
t
o
o


a
a
u
u
t
t
o
o
m
m
a
a
t
t
i
i
c
c
a
a
l
l
l
l
y
y


k
k
e
e
e
e
p
p


e
e
x
x
e
e
c
c
u
u
t
t
i
i
n
n
g
g


o
o
n
n
e
e


j
j
o
o
b
b


t
t
o
o


t
t
h
h
e
e


n
n
e
e
x
x
t
t


i
i
n
n


b
b
a
a
t
t
c
c
h
h
.
.


T
T
h
h
e
e


m
m
a
a
i
i
n
n


i
i
d
d
e
e
a
a


b
b
e
e
h
h
i
i
n
n
d
d


t
t
h
h
a
a
t
t


b
b
a
a
t
t
c
c
h
h


p
p
r
r
o
o
c
c
e
e
s
s
s
s
i
i
n
n
g
g


s
s
y
y
s
s
t
t
e
e
m
m


i
i
s
s


t
t
o
o


r
r
e
e
d
d
u
u
c
c
e
e


t
t
h
h
e
e


i
i
n
n
t
t
e
e
r
r
f
f
a
a
c
c
e
e


o
o
f
f


t
t
h
h
e
e


o
o
p
p
e
e
r
r
a
a
t
t
o
o
r
r


d
d
u
u
r
r
i
i
n
n
g
g


t
t
h
h
e
e


p
p
r
r
o
o
c
c
e
e
s
s
s
s
o
o
r
r


o
o
r
r


e
e
x
x
e
e
c
c
u
u
t
t
i
i
o
o
n
n


o
o
f
f


j
j
o
o
b
b
s
s


b
b
y
y


c
c
o
o
m
m
p
p
u
u
t
t
e
e
r
r


s
s
y
y
s
s
t
t
e
e
m
m
.
.


A
A
l
l
l
l


f
f
u
u
n
n
c
c
t
t
i
i
o
o
n
n
e
e
d
d


o
o
f
f


b
b
a
a
t
t
c
c
h
h


p
p
r
r
o
o
c
c
e
e
s
s
s
s
i
i
n
n
g
g


s
s
y
y
s
s
t
t
e
e
m
m


a
a
r
r
e
e


c
c
a
a
r
r
r
r
i
i
e
e
d
d


o
o
u
u
t
t


b
b
y
y


p
p
r
r
o
o
g
g
r
r
a
a
m
m


i
i
s
s


k
k
n
n
o
o
w
w
n
n


a
a
s
s


b
b
a
a
t
t
c
c
h
h


m
m
o
o
n
n
i
i
t
t
o
o
r
r
.
.






T
T
h
h
e
e


b
b
a
a
t
t
c
c
h
h


m
m
o
o
n
n
i
i
t
t
o
o
r
r


i
i
s
s


a
a


p
p
e
e
r
r
m
m
a
a
n
n
e
e
n
n
t
t


p
p
r
r
o
o
g
g
r
r
a
a
m
m


t
t
h
h
a
a
t
t


r
r
e
e
s
s
i
i
d
d
e
e
s
s


i
i
n
n


t
t
h
h
e
e


m
m
a
a
i
i
n
n


m
m
e
e
m
m
o
o
r
r
y
y
.
.


I
I
n
n


o
o
t
t
h
h
e
e
r
r


w
w
o
o
r
r
d
d
s
s
,
,


a
a


b
b
a
a
t
t
c
c
h
h


m
m
o
o
n
n
i
i
t
t
o
o
r
r


i
i
s
s


r
r
e
e
s
s
p
p
o
o
n
n
s
s
i
i
b
b
l
l
e
e


f
f
o
o
r
r


c
c
o
o
n
n
t
t
r
r
o
o
l
l
l
l
i
i
n
n
g
g


t
t
h
h
e
e


e
e
n
n
v
v
i
i
r
r
o
o
n
n
m
m
e
e
n
n
t
t


o
o
f
f


t
t
h
h
e
e


s
s
y
y
s
s
t
t
e
e
m
m


f
f
o
o
r
r


s
s
m
m
o
o
o
o
t
t
h
h


e
e
x
x
e
e
c
c
u
u
t
t
i
i
o
o
n
n


o
o
f
f


t
t
h
h
e
e


p
p
r
r
o
o
c
c
e
e
s
s
s
s
.
.


I
I
n
n


b
b
a
a
t
t
c
c
h
h


p
p
r
r
o
o
c
c
e
e
s
s
s
s
i
i
n
n
g
g


s
s
y
y
s
s
t
t
e
e
m
m
,
,


t
t
u
u
r
r
n
n


a
a
r
r
o
o
u
u
n
n
d
d


t
t
i
i
m
m
e
e


i
i
s
s


u
u
s
s
e
e


t
t
o
o


d
d
e
e
f
f
i
i
n
n
e
e


t
t
h
h
e
e


t
t
o
o
t
t
a
a
l
l


t
t
i
i
m
m
e
e


t
t
a
a
k
k
e
e
n
n


b
b
y
y


a
a


j
j
o
o
b
b


i
i
n
n


t
t
h
h
e
e


e
e
x
x
e
e
c
c
u
u
t
t
i
i
o
o
n
n
.
.


T
T
h
h
i
i
s
s


t
t
i
i
m
m
e
e


i
i
n
n
c
c
l
l
u
u
d
d
e
e
s
s


b
b
a
a
t
t
c
c
h
h


f
f
o
o
r
r
m
m
a
a
t
t
i
i
o
o
n
n
,
,


t
t
i
i
m
m
e
e


t
t
a
a
k
k
e
e
n
n


t
t
o
o


p
p
r
r
i
i
n
n
t
t


r
r
e
e
s
s
u
u
l
l
t
t


7
7
t
t
h
h
e
e


t
t
i
i
m
m
e
e


r
r
e
e
q
q
u
u
i
i
r
r
e
e
d
d


t
t
o
o


p
p
h
h
y
y
s
s
i
i
c
c
a
a
l
l
l
l
y
y


s
s
o
o
r
r
t
t


t
t
h
h
e
e


p
p
r
r
i
i
n
n
t
t
e
e
d
d


o
o
u
u
t
t
p
p
u
u
t
t
s
s


t
t
h
h
a
a
t
t


b
b
e
e
l
l
o
o
n
n
g
g
s
s


t
t
o
o


a
a


d
d
i
i
f
f
f
f
e
e
r
r
e
e
n
n
t
t


j
j
o
o
b
b
s
s
.
.


A
A
n
n
o
o
t
t
h
h
e
e
r
r


i
i
m
m
p
p
o
o
r
r
t
t
a
a
n
n
t
t


t
t
e
e
r
r
m
m
s
s


u
u
s
s
e
e
d
d


i
i
n
n


b
b
a
a
t
t
c
c
h
h


p
p
r
r
o
o
c
c
e
e
s
s
s
s
i
i
n
n
g
g


s
s
y
y
s
s
t
t
e
e
m
m


i
i
s
s


j
j
o
o
b
b


s
s
c
c
h
h
e
e
d
d
u
u
l
l
i
i
n
n
g
g
.
.


I
I
t
t


i
i
s
s


a
a


p
p
r
r
o
o
c
c
e
e
s
s
s
s


o
o
f
f


s
s
e
e
q
q
u
u
e
e
n
n
c
c
i
i
n
n
g
g


j
j
o
o
b
b
s
s


t
t
o
o


t
t
h
h
a
a
t
t
.
.






O
O
p
p
e
e
r
r
a
a
t
t
i
i
n
n
g
g


S
S
y
y
s
s
t
t
e
e
m
m


S
S
t
t
r
r
u
u
c
c
t
t
u
u
r
r
e
e






Multiprogramming

needed for efficiency
.



Single user cannot ke
ep CPU and I/O devices busy at all times
.



Multiprogramming organizes jobs (code and data) so CPU always has one to
execute
.



A subset of total jobs in system is kept in memory
.



One job selected and run via
job scheduling
.



When it has to wait (for I/O for ex
ample), OS switches to another job
.


SoftDot Hi

Tech Educational & Training Institute

(A unit of De Unique Educational Society
)

__________________________________________________

SoftD
ot Hi

Tech

Educational & Training Institute


South

Extensi
on



PitamPura


Preet Vihar


Janakpuri




New Delhi



New Delhi

New Delhi


New Delhi

6



Timesharing (multitasking)

is logical extension in which CPU switches jobs so
frequently that users can interact with each job while it is running, creating
interactive

computing
.



Response time

should be < 1 second
.



Each

user has at least o
ne program executing in memory
process
.



If several jobs

ready to run at the same time

CPU scheduling
.



If processes don’t fit in memory,
swapping

moves them in and out to run
.



Virtual memory

allows execution of processes not completely i
n memory
.



Operating System and System
C
alls






P
P
r
r
o
o
c
c
e
e
s
s
s
s


M
M
a
a
n
n
a
a
g
g
e
e
m
m
e
e
n
n
t
t
.
.




A process is a program in execution. It is a unit of work within the system. Program
is a
passive entity
, process is an
active entity
.



Process needs resources to accomplish its task
.



CPU, m
emory, I/O, files
.



Initialization data
.



Process termination requires reclaim of any reusable resources
.



Single
-
threaded process has one
program counter

specifying location of next
instruction to execute
.



Process executes instructions sequentially, one at a

time, until completion
.



Multi
-
threaded process has one program counter per thread
.



Typically system has many processes, some user, some operating system running
concurrently on one or more CPUs
.



Concurrency by multiplexing the CPUs among the processes / t
hreads
.


M
M
e
e
m
m
o
o
r
r
y
y


M
M
a
a
n
n
a
a
g
g
e
e
m
m
e
e
n
n
t
t





All data in memory before and after processing



All instructions in memory in order to execute



Memory management determines what is in memory when



Optimizing CPU utilization and computer response to users



Memory management activi
ties



Keeping track of which parts of memory are currently being used and by whom



Deciding which processes (or parts thereof) and data to move into and out of
memory



Allocating and
deal locating

memory space as needed




SoftDot Hi

Tech Educational & Training Institute

(A unit of De Unique Educational Society
)

__________________________________________________

SoftD
ot Hi

Tech

Educational & Training Institute


South

Extensi
on



PitamPura


Preet Vihar


Janakpuri




New Delhi



New Delhi

New Delhi


New Delhi

7



M
M
e
e
m
m
o
o
r
r
y
y


L
L
a
a
y
y
o
o
u
u
t
t


f
f
o
o
r
r


M
M
u
u
l
l
t
t
i
i
p
p
r
r
o
o
g
g
r
r
a
a
m
m
m
m
e
e
d
d


S
S
y
y
s
s
t
t
e
e
m
m






S
S
t
t
o
o
r
r
a
a
g
g
e
e


M
M
a
a
n
n
a
a
g
g
e
e
m
m
e
e
n
n
t
t





OS provides uniform, logical view of information storage
.



Abstracts physical properties to logical storage
unit
-

file
.



Each medium is controlled by device (i.e., disk drive, tape drive)
.



Varying properties include access speed,

capacity,
and data
-
transfer rate, access
method (sequential or random)
.



File
-
System management



Files usually organized into directories



Access control on most systems to determine who can access what
.



OS activities include
.



Creating and deleting files and

directories
.



Primiti
ves to manipulate files and directories.



Mapping files onto secondary storage
.



Backup files onto stable (non
-
volatile) storage media
.




S
S
Y
Y
S
S
T
T
E
E
M
M


C
C
A
A
L
L
L
L






Programming interface to the services provided by the OS
.



Typically written in a high
-
level language (C or C++)
.



Mostly accessed by programs via a high
-
level
Application Program Interface (API)

rather than direct system call use
.




Three most common APIs are Win32 API for Windows, POSIX API for POSIX
-

SoftDot Hi

Tech Educational & Training Institute

(A unit of De Unique Educational Society
)

__________________________________________________

SoftD
ot Hi

Tech

Educational & Training Institute


South

Extensi
on



PitamPura


Preet Vihar


Janakpuri




New Delhi



New Delhi

New Delhi


New Delhi

8

based systems (including virtually all v
ersions of UNIX, Linux, and Mac OS X),
and Java API for the Java virtual machine (JVM)
.



Why use APIs rather than system calls?

(Note that the system
-
call names used throughout this text are generic)





O
O
p
p
e
e
r
r
a
a
t
t
i
i
n
n
g
g


S
S
y
y
s
s
t
t
e
e
m
m


S
S
t
t
r
r
u
u
c
c
t
t
u
u
r
r
e
e
s
s






Operating System Services



User Operating System Interface



System Calls



Types of System Calls



System Programs



Operating System Design and Implementation



Operating System Structure



Virtual Machines



Operating System Generation



System Boot



O
O
B
B
J
J
E
E
C
C
T
T
I
I
V
V
E
E






To describe the services an opera
ting system provides to users, processes, and other
systems



To discuss the various ways of structuring an operating system



To explain how operating systems are installed and customized and how they boot





S
S
E
E
R
R
V
V
I
I
C
C
E
E
S
S


O
O
F
F


O
O
S
S





One set of operating
-
system serv
ices provides functions that are helpful to the user:



User interface

-

Almost all
Operating systems have a U
ser
I
nterface (UI)
.



Varies between Command
Line (CLI)
, Graphics User Interface (GUI) and

Batch
.




Program E
xecution

-

The system must be able to load

a program into memory and
to run that program, end execution, either normally or abnormally (indicating error)



I/O operations

-

A running program may require I/O, which may involve a file or
an I/O device.



File
-
system manipulation

-

The file system is

of

particular interest.
Obviously,

programs need to read and write files and directories, create and delete them, search
them, list file Information, permission management.


SoftDot Hi

Tech Educational & Training Institute

(A unit of De Unique Educational Society
)

__________________________________________________

SoftD
ot Hi

Tech

Educational & Training Institute


South

Extensi
on



PitamPura


Preet Vihar


Janakpuri




New Delhi



New Delhi

New Delhi


New Delhi

9




Communications



Processes may exchange information, on the same computer or
betwee
n computers over a network
. Co
mmunications

may be via shared memory or
through message passing (packets moved by the OS)
.



Error detection



OS needs to be constantly aware of possible errors
. It ma
y occur
in the CPU and memory hardware, in I/O devices, in
user program
.
For each type of
error, OS should take the appropriate action to ensure correct and consistent
computing
.



Debugging facilities can greatly enhance the user’s and programmer’s abilities to
efficiently use the system
.



Another set of OS function
s exists for ensuring the efficient operation of the system
itself via resource sharing



Resource allocation

-

When multiple users or multiple jobs running concurrently,
resources must be allocated to each of them



Many types of resources

-

Some (such as CP
U cycles, main memory, and file
storage) may have special allocation code, others (such as I/O devices) may have
general request and release code.



Accounting

-

To keep track of which users use how much and what kinds of


computer resources
.



Protecti
on and security

-

The owners of information stored in a multi
-
user or
networked computer system may want to control use of that information, concurrent
processes should not interfere with each other

p
rotection

involves ensuring that all
access to system re
sources is controlled
.
Security

of the system from outsiders
requires user authentication, extends to defending external I/O devices from invalid
access attempts
.
If a system is to be protected and secure, precautions must be
instituted throughout it. A ch
ain is only as strong as its weakest link.




S
S
Y
Y
S
S
T
T
E
E
M
M


C
C
A
A
L
L
L
L






Programming interface to the services provided by the OS
.



Typically written in a high
-
level language (C or C++)
.



Mostly accessed by programs via a high
-
level
Application Program Interface (API)

rath
er than direct system call use
.



Three most common APIs are Win32 API for Windows, POSIX API for POSIX
-
based systems (including virtually all versions of UNIX, Linux, and Mac OS X),
and Java API for the Java virtual machine (JVM)
.



Why use APIs rather than s
ystem calls?

(Note that the system
-
call names used throughout this text are generic)




SoftDot Hi

Tech Educational & Training Institute

(A unit of De Unique Educational Society
)

__________________________________________________

SoftD
ot Hi

Tech

Educational & Training Institute


South

Extensi
on



PitamPura


Preet Vihar


Janakpuri




New Delhi



New Delhi

New Delhi


New Delhi

10



TYPE OF SYSTEM CALL




Process control



File management



Device management



Information maintenance



Communications


SYS
T
EM PROGRAM




Provide a convenient environment for pro
gram development and execution



Some of them are simply user interfaces to system calls; others are considerably
more complex
.



File management

-

Create, delete, copy, rename, print, dump, list, and generally


Manipulate

files and directories
.



Status
information
.



Some ask the system for info
-

date, time, amount of available memory, disk space,
and number

of users
.



Others provide detailed performance, logging, and debugging information
.



Typically, these programs format and print the output to the termi
nal or other output
devices
.



Some systems
implement a

registry
-

used to store and retrieve configuration
information
.



S
S
Y
Y
S
S
T
T
E
E
M
M


B
B
O
O
O
O
T
T






Operating system must be made available to hardware so hardware can start it
.



Small piece of code


bootstrap loader
, loca
tes the kernel, loads it into memory, and
starts it
.



Sometimes two
-
step process where
boot block

at fixed location loads bootstrap
loader
.



When power initialized on system, execution starts at a fixed memory location
.



Firmware used to hold initial boot cod
e
.






SoftDot Hi

Tech Educational & Training Institute

(A unit of De Unique Educational Society
)

__________________________________________________

SoftD
ot Hi

Tech

Educational & Training Institute


South

Extensi
on



PitamPura


Preet Vihar


Janakpuri




New Delhi



New Delhi

New Delhi


New Delhi

11



UNIT


2

Operating System Function
s


Process Concept





An operating system executes a variety of programs:

o

Batch system


jobs

o

Time
-
shared systems


user programs or tasks



Textbook uses the terms
job

and
process

almost interchangeably



Process


a

program in execution; process execution must progress in sequential
fashion



A process includes:

o

program counter

o

stack

o

data section


Process in Memory





Process State



As a process executes, it changes
state

o

new: The process
is being created

o

running: Instructions are being executed

o

waiting: The process is waiting for some event to occur

o

ready: The process is waiting to be assigned to a processor

o

terminated: The process has finished execution




SoftDot Hi

Tech Educational & Training Institute

(A unit of De Unique Educational Society
)

__________________________________________________

SoftD
ot Hi

Tech

Educational & Training Institute


South

Extensi
on



PitamPura


Preet Vihar


Janakpuri




New Delhi



New Delhi

New Delhi


New Delhi

12





Diagram of Process State



Process Control Block (PCB)


Information associated with each process



Process state



Program counter



CPU registers



CPU scheduling information



Memory
-
management information



Accounting information



I/O status information



SoftDot Hi

Tech Educational & Training Institute

(A unit of De Unique Educational Society
)

__________________________________________________

SoftD
ot Hi

Tech

Educational & Training Institute


South

Extensi
on



PitamPura


Preet Vihar


Janakpuri




New Delhi



New Delhi

New Delhi


New Delhi

13






Process Control Block (PCB)


Process Scheduling Queues




Job queue



set of all processes in the system



Ready queue



set of all processes residing in main memory, ready and waiting to
execute



Device queues



set of processes waiting for an I/O device



Processes migrate among the various queues





Representation of Process Scheduling



SoftDot Hi

Tech Educational & Training Institute

(A unit of De Unique Educational Society
)

__________________________________________________

SoftD
ot Hi

Tech

Educational & Training Institute


South

Extensi
on



PitamPura


Preet Vihar


Janakpuri




New Delhi



New Delhi

New Delhi


New Delhi

14


Schedule
rs




Long
-
term scheduler

(or job scheduler)


selects which processes should be
brought into the ready queue



Short
-
term scheduler

(or CPU scheduler)


selects which process should be
executed next and allocates CPU




Short
-
term scheduler is invoked very fr
equently (milliseconds)


(must be fast)



Long
-
term scheduler is invoked very infrequently (seconds, minutes)


(may be
slow)



The long
-
term scheduler controls the
degree of multiprogramming





Processes can be described as either:



I/O
-
bound process



spends
more time doing I/O than computations, many short
CPU bursts



CPU
-
bound process



spends more time doing computations; few very long
CPU bursts
.


Process Creation




Parent process create children processes, which, in turn create other processes,
forming a tr
ee of processes



Resource sharing

o

Parent and children share all resources

o

Children share subset of parent’s resources

o

Parent and child share no resources



Execution

o

Parent and children execute concurrently

o

Parent waits until children terminate




Address space



Child duplicate of parent



Child has a program loaded into it



UNIX examples



fork

system call creates new process



exec

system call used after a
fork

to replace the process’ memory
space with a new program



SoftDot Hi

Tech Educational & Training Institute

(A unit of De Unique Educational Society
)

__________________________________________________

SoftD
ot Hi

Tech

Educational & Training Institute


South

Extensi
on



PitamPura


Preet Vihar


Janakpuri




New Delhi



New Delhi

New Delhi


New Delhi

15





Process Creation




Cooperating Processes




Independent

process cannot affect or be affected by the execution of another
process



Cooperating

process can affect or be affected by the execution of another process



Advantages of process cooperation

o

Inf
ormation sharing

o

Computation speed
-
up

o

Modularity

o

Convenience


Context Switch




When CPU switches to another process, the system must save the state of the old
process and load the saved state for the new process



Context
-
switch time is overhead; the system
does no useful work while switching



Time dependent on hardware support


CPU Scheduling


Basic Concepts



Maximum CPU utilization obtained with multiprogramming



CPU

I/O Burst Cycle


Process execution consists of a
cycle

of CPU execution
and I/O wait



CPU burs
t distribution





SoftDot Hi

Tech Educational & Training Institute

(A unit of De Unique Educational Society
)

__________________________________________________

SoftD
ot Hi

Tech

Educational & Training Institute


South

Extensi
on



PitamPura


Preet Vihar


Janakpuri




New Delhi



New Delhi

New Delhi


New Delhi

16

CPU Scheduler




Selects from among the processes in memory that are ready to execute, and
allocates the CPU to one of them



CPU scheduling decisions may take place when a process:

1.

Switches from running to waiting state

2.
Switches from r
unning to ready state

3.

Switches from waiting to ready


4.

T
erminates



Scheduling under 1 and 4 is
non
-
preemptive



All other scheduling is
preemptive



Dispatcher




Dispatcher module gives control of the CPU to the process selected by the short
-
term sch
eduler; this involves:

o

switching context

o

switching to user mode

o

jumping to the proper location in the user program to restart that program



Dispatch latency



time it takes for the dispatcher to stop one process and start
another running



Scheduling Criter
ia




CPU utilization



keep the CPU as busy as possible



Throughput



No.

of processes that complete their execution per time unit



Turnaround time



amount of time to execute a particular process



Waiting time



amount of time a process has been waiting in th
e ready queue



Response time



amount of time it takes from when a request was submitted until
the first response is produced,
not

output (for time
-
sharing environment)


Optimization Criteria




Max CPU utilization



Max throughput



Min turnaround time



Min wai
ting time



Min response time


SoftDot Hi

Tech Educational & Training Institute

(A unit of De Unique Educational Society
)

__________________________________________________

SoftD
ot Hi

Tech

Educational & Training Institute


South

Extensi
on



PitamPura


Preet Vihar


Janakpuri




New Delhi



New Delhi

New Delhi


New Delhi

17


First
-
Come, First
-
Served (FCFS) Scheduling




Waiting time for
P1

= 0;
P2

= 24;
P3
= 27



Average waiting time: (0 + 24 + 27)/3 = 17


Shortest
-
Job
-
First (SJF) Scheduling




Associate with each process the length of its next CPU b
urst. Use these lengths to
schedule the process with the shortest time



Two schemes:

o

no preemptive


once CPU given to the process it cannot be preempted
until completes its CPU burst

o

Preemptive


if a new process arrives with CPU burst length less than
r
emaining time of current executing process, preempt. This scheme is
know

as the

Shortest
-
Remaining
-
Time
-
First (SRTF)



SJF is optimal


gives minimum average waiting time for a given set of processes


Example of Non
-
Preemptive SJF


Process

Arrival Time

Bur
st Time


P1


0.0


7


P2




2.0


4


P3


4.0


1




P4


5.0


4



SJF (non
-
preemptive)






Average waiting time = (0 + 6 + 3 + 7)/4 = 4






P
1

P
3

P
2

7

3

16

0

P
4

8

12


SoftDot Hi

Tech Educational & Training Institute

(A unit of De Unique Educational Society
)

__________________________________________________

SoftD
ot Hi

Tech

Educational & Training Institute


South

Extensi
on



PitamPura


Preet Vihar


Janakpuri




New Delhi



New Delhi

New Delhi


New Delhi

18


Example of Preemptive SJF


Process

Arrival Time

Burst Time

P1

0.0

7

P2




2.0



4

P3



4.0


1

P4



5.0


4



SJF (preemptive)





Average waiting time = (9 + 1 + 0 +2)/4 = 3


Priority Scheduling




A priority number (integer) is associated with each process



The CPU is allocated
to the process with the highest priority (smallest integer


highest priority)



Preemptive



no preemptive



SJF is a priority scheduling where priority is the predicted next CPU burst time



Problem


Starvation


low priority processes may never execute



Solutio
n


Aging


as time progresses increase the priority of the process


Round Robin (RR)



Each process gets a small unit of CPU time (
time quantum
), usually 10
-
100
milliseconds. After this time has elapsed, the process is preempted and added to
the end of the

ready queue.



If there are
n

processes in the ready queue and the time quantum is
q
, then each
process gets 1/
n

of the CPU time in chunks of at most
q

time units at once. No
process waits more than (
n
-
1)
q
time units.



Performance

o

q

large


FIFO

o

q
small


q

must be large with respect to context switch, otherwise
overhead is too high

P
1

P
3

P
2

4

2

11

0

P
4

5

7

P
2

P
1

16


SoftDot Hi

Tech Educational & Training Institute

(A unit of De Unique Educational Society
)

__________________________________________________

SoftD
ot Hi

Tech

Educational & Training Institute


South

Extensi
on



PitamPura


Preet Vihar


Janakpuri




New Delhi



New Delhi

New Delhi


New Delhi

19


Example of RR with Time Quantum = 20

Process

Burst Time

P1


53

P2



17

P3


68

P4



24


The
Gantt

chart

is




Typically, higher average turnaround than SJF, but better
response


Multilevel Queue




Ready

queue

is partitioned into separate queues:

foreground(interactive)background (batch)
.



Each queue has its own scheduling algorithm

o

foreground


RR

o

back
ground


FCFS



Scheduling must be done between the queues

o

Fixed priority scheduling; (i.e., serve all from foreground then from
background). Possibility of starvation.

o

Time slice


each queue gets a certain amount of CPU time which it can