0% found this document useful (0 votes)
4 views23 pages

5 - OS Lecture

Uploaded by

saad.ahm.salama
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views23 pages

5 - OS Lecture

Uploaded by

saad.ahm.salama
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

OPERATING SYSTEM

There are two types of software:


System Software;
Application Software.
Introduction ..
• System software:
– makes efficient use of the computing resources;
– provides a uniform base for different
applications;
– operate, control and extend the processing
capabilities of computers.
• The Operating System comes under the System
Software category
• Application software:
– helps the user to do his/her work.
Introduction ..
• Who will access the
computer hardware directly
if the user is denied such
permission?
• The Operating system
provides so many facilities
with which a user
comfortably uses their
computers
OS functions ..
• Operating System hides the complexity of the
hardware .
• The Operating System manages the resource.
• The Operating System manages the complex
system in an efficient way.
• It provides special routines called device
drivers .
Goals ..
• The primary goal of the Operating
System was mainly to optimize
resources.
• The secondary goal was to make the
computer environment, user-friendly.
• Now providing the user-friendly
environment is the main aim of the
operating system.
Goals ..
• The Operating System acts as the manager of
resources:
– CPU time,
– memory space,
– file storage,
– I/O devices.
• Operating System allocates resources in such a
manner so as to achieve the maximum best
possible result.
OS definitions ..
• There are several definitions for
Operating System.
– Operating System is one program running at
all times on the computer.
– The another, is that an Operating System is
an interface between the user and
hardware.
Features ..
• Any Operating system should be easy to use.
• The Operating System should allow developing
application programs easier.
• That is, the Operating System should run in
almost all hardware platforms.
• The new version of the Operating System
should not confuse the people who used the
earlier version
• it should run software that ran successfully in
earlier versions.
Features ..
• The Operating System should provide data
security.
• The Operating System should provide data
confidentiality.
• The Operating System should work in a network
as well as distributed environment.
• The Operating System should make system
administration more efficient
• The Operating system should provide the help
facility.
Major Features of the Operating System
..
• Single user Operating System : At a time, only
one user can operate the system. MS Disk
Operating System is an example of single user
Operating System.
• Multi-user Operating System : More than one
user can operate the same system
simultaneously. The multi-user Operating
System is based on the concept of time-sharing.
Unix is an example of multi-user Operating
System.
The Desirable characters of OS..
• The desirable characters of the Operating System are:
1. User Interface
2. Memory management
3. Process management
4. File management
5. Networking Capabilities management
6. Security Management
7. Fault tolerance
8. Application Base
9. Distributed Operating System.
Process management ..
• The allocation of processors by process
management is also known as the CPU
Scheduling.
• The objectives of the CPU Scheduling should be
to maximize
1. The CPU utilization.
2. The number of jobs done in a unit time
(throughput) and to minimize the time taken.
Process management ..
• Several algorithms are used to allocate the
job to the processor.
1) FIFO.
2) SJF
3) Round Robin.
4) Based on Priority.
Not-Running Process in a Queue
FIFO. .
• The process (A process is basically a
program in execution) that enters the
queue first is executed first by the CPU,
then the next and then the next and so on.
• The processes are executed in the order in
which they enter the queue.
Example (FIFO)
Job # 1 2 3 4 55
Arrival time 0 2 4 6 88
Finish time
Service time 33 96 13
4 18
5 20
2
Response time 3 7 9 12 12
Service time 3 6 4 5 2
Wait time
Average 0 time1= (3+7+9+12+12)/5
response 5 7 =108.6
Throughput = 5/20 = 1/4
Ave (RespTime/ServTime) = (1+7/6+9/4+12/5+12/2)/5 = 2.564

FIFO
SJF (Shortest Job First)
• This algorithm is based on the size of the
job.
• Take two jobs A and B.
A = 5 kilo bytes
B = 8 kilo bytes
• First the job A will be assigned processor
time after which B gets its turn.
Example (Shortest Job First)
Job # 1 2 3 4 55
Arrival time 0 2 4 6 88
Finish time
Service time 33 96 15
4 20
5 11
2
Response time 3 7 11 14 3
Service time 3 6 4 5 2
Wait time
Average response 0 time Job Job 57finishes9
1= 2(3+7+11+14+3)/5
finishes =17.6
Job 2Job 3Job
enters
enters 4JobJobs
enters Jobs
3, 4, 3,
5 enters 5 in4 in queue
queue
Throughput = 5/20
But to
But has has
Jobs
= 1/4
toJobs
finish Job
finish
3,Job Job
3,51
4 both4, 32all
5the isshortest
is queued thequeue
in shortest
Ave (RespTime/ServTime) = (1+7/6+11/4+14/5+3/2)/5 = 1.844

SJF
Round Robin . .
• Jobs are assigned processor time in a
circular method.
• For example take three jobs A, B, C. First
the job A is assigned to CPU then job B and
after B job C and then again A,B and C and
so on.
Example (Round Robin)
Job # 1 2 3 4 55
Arrival time 0 2 4 6 88
Finish time
Service time 43 18
6 17
4 20
5 15
2
Response time 4 16 13 14 7
Service time 3 6 4 5 2
WaitJ1
time
Assume
time
J2J3
time 1quantum
J2 enters
quantum
J2 J2J5
enters,
J4
time 10
enters,
enters,
time before
expires
J1
expires
J3 finishes
J2
time
expires
expires
then
J5
time
J4
time9J2
then
J1
expires
J3
time time
J4
expires
time time
expires
J5
time 9expires
expires
expires
finishes
expires 5
expires,
Average response
Queue:
Queue:
Queue: J1 J2,
Queue:
Queue:
J1
Queue:time
J1Queue:
Queue:
J1,
Queue:
J2,
J2
J3, =(J2
Queue:
J3
J2, (4+16+13+14+7)/5
J3,
Queue:
J2J4,
Queue:
J4,
was
J3,J2,
Queue:
J2,
J3 J5,
Queue:
J5,
J2
Queue:
J5,
inJ4, J4
Queue:
J4,
queue)
J3,
J4,
J3,
J2,
J3,
J2,
J3
J5,
J2,
J5,
J2
J4,
J5,
J4,
J5 =
J4,
J3,
J4
J3,10.8
J3
J2J2
J1J1 Switch
starts to Switch
continues
Switch J2Switch
Switch
Switch
to J1Switch
to to
J2Switch
to to
J3Switch
to J3Switch
J2Switch
J4Switch
to to
J2Switch
to
J5Switch
to
J4to
J3to
J2to
J5J4

Round
Robin
T=1
Example (Round Robin)
Job # 1 2 3 4 55
Arrival time 0 2 4 6 88
Finish time
Service time 53 17
6 13
4 20
5 15
2
Response time 5 15 9 14 7
Service time 3 6 4 5 2
Wait time
J2 enters,
J3J1 2then
finishes
enters,
J4 J3J5 J1
enters
time9time
enters
then
J2 time
expires
J2 5 finishes
expires
J4 time
time
expires
J3 expires
expires9 finishes
J5 finishes
J2 5 expires
J4 time
Average response
Queue:
Queue: J1 Queue:
J2,
Queue: time
J1
Queue:J3,
Queue:
J1, =J2,
Queue:
J2 (5+15+9+14+7)/5
Queue:
J3,
J2,J2J4, J3,
Queue:
J4J4,
J4, J5
Queue:
J3
J3,
J3,
Queue:
J5,
J5,
J5,
Queue:
J2
J2,
J2,
J2, =J410 J4
Queue:
J4
J4
J4
Switch
J1 starts Switch
toJ3
J2Switch
Switch toJ2
to continues
J3toSwitch
continues
J1SwitchJ2toSwitch
J4toSwitch
J3toSwitch
J5toJ4
J2to
Continues
J4

Round
Robin
T=2
Based on Priority. .
• In this method each job is assigned a
Priority.
• The higher Priority job is awarded favorable
treatment.
• Take two jobs A and B. Let the priority of A
be 5 and priority B be 7. Job B is assigned to
the processor before job A.
Distributed Operating System . .

• Distributed Operating System ensures that


the entire network behaves as a single
computer.
• Getting access to the remote resources is
similar to access to local resources. The
user’s job is executed in an idle machine
and the result is communicated to the user
machine.

You might also like