Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

College of Computing and Informatics

OPERATING SYSTEMS

Assignment 1
DEADLINE: SATURDAY 16/02/2019 @ 23:59

[Total Mark for this Assignment is 6]

Student Details:
Name: Taher Alnemer ID: S170057274

CRN: 20830

Instructions:

This Assignment must be submitted on Blackboard (WORD format only) via the allocated
folder.
Email submission will not be accepted.
You are advised to make your work clear and well-presented, marks may be reduced for poor
presentation. This includes filling your information on the cover page.
You MUST show all your work, and text must not be converted into an image, unless specified
otherwise by the question.
Late submission will result in ZERO marks being awarded.
The work should be your own, copying from students or other resources will result in ZERO
marks.
Use Times New Roman font for all your answers.
Pg. 1 Question OneQuestion One

Learning
Outcome(s): Question One 1.5 Mark

For the following resource-allocation graph draw the corresponding wait-for graph and
LO 4: Recognize confirm if there exist a deadlock or not.
the impact of the
interaction
P1 R1 P2
between design
decisions and
operating system
features on the
performance and R2 R3 P3

robustness of the
programs

P4

Processes P1 and P3 acquiring resources R1 and R3 while process P2 and P4 is


waiting to acquire both resources. Also, P2 waiting P4 acquiring resource R3. So,
there is no deadlock because there is no circular.
Pg. 2 Question OneQuestion One

Learning 1 Mark
Outcome(s): Question Two
LO 2: Identify the More than one process can be executed by a single processor using multi-programing
or multi-tasking. How can this be achieved on a uniprocessor system?
services of
modern operating
systems and use
system calls.

There is only one processor in uniprocessor system, which can process at least one
process in the same time. So, to make it for concurrent processes we use context
switching in which more than one processes can be execute in the same time.

If we have two processes: First processor starts execution and then will start execution
for second processor for particular time after that start execution for first processer
which will continue alternatively and we think that they are running concurrently.

So, Execution more than one processes can achieve on uniprocessor system.
Pg. 3 Question OneQuestion One

Learning 2 Mark
Outcome(s): Question Three
LO 5: Assess the Following table contains five processes with their length of the CPU burst given in
milli seconds. (1 + 0.5 + 0.5 = 2 Marks)
performance of
the programs Processes Burst Time (ms)
through well P1 17
designed P2 8
measurements P3 12
using OS timings P4 5
features.
P5 9

Answer the following questions using Round-Robin scheduling algorithm with a time
quantum of 4 milli seconds and show all the calculations.
a) Draw a Gantt chart to show round-robin scheduling.
b) Calculate the waiting time for each process using round-robin scheduling.
c) Calculate the average waiting time.

P1 P2 P3 P4 P5 P1 P2 P3 P4 P5 P1 P3 P5 P1 P1
0 4 8 12 16 20 24 28 32 33 37 41 45 46 50 51

WT = Turn Around Time – Burst Time

P1 = 51 – 17 = 34 ms
P2 = 28 – 8 = 20 ms
P3 = 45 – 12 = 33 ms
P4 = 33 – 5 = 28 ms
P5 = 46 – 9 = 37 ms

Average WT = (34+20+33+28+37) / 5 = 30. 4 ms


Pg. 4 Question OneQuestion One

Learning 1.5 Mark


Outcome(s): Question Four
LO 1: Describe Describe the operating system's two modes of operation. Distinguish between system
the OS and application programs.
mechanism for
process  User mode:
management,  Mode where all user programs execute. It does not have access to
timing, memory, hardware and RAM.
I/O, file and  All programs run in kernel mode they would be able to overwrite each
concurrency other’s memory.
 If it needs to access any of these features it makes a call to the
management
underlying API.
 Each process started by windows except of system process runs in user
mode.

 Kernel mode:

 Mode where all kernel programs execute (different drivers). It has


access to every resource and underlying hardware.
 Any CPU instruction can be executed and every memory address can be
accessed.
 This mode is kept for drivers which work on the lowest level.

You might also like