0% found this document useful (0 votes)
22 views3 pages

Revision Questions

The document contains a series of questions related to operating systems, focusing on process scheduling, resource allocation, and memory management. It includes tasks such as drawing Gantt charts, calculating average waiting times, implementing the Banker Algorithm, and allocating memory using different strategies. Additionally, it addresses page replacement algorithms and their impact on page faults.

Uploaded by

iloveulol428
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)
22 views3 pages

Revision Questions

The document contains a series of questions related to operating systems, focusing on process scheduling, resource allocation, and memory management. It includes tasks such as drawing Gantt charts, calculating average waiting times, implementing the Banker Algorithm, and allocating memory using different strategies. Additionally, it addresses page replacement algorithms and their impact on page faults.

Uploaded by

iloveulol428
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/ 3

QUESTIONS

CSN4224 – OPERATING SYSTEM


Question 1

Consider the following set of processes (lowest value is the higher priority), with the length of the CPU-burst time
given in milliseconds:

Process Burst time Arrival time Priority


P1 6 0 2
P2 2 2 4
P3 5 3 1
P4 7 4 3
P5 9 1 5

1. Draw the Gantt charts illustrating the execution of these processes using Preemptive Priority and Round
Robin (quantum=2) scheduling.
2. Based on your answer above, calculate the average waiting time for both scheduling.

Question 2

Consider the following set of processes (highest value is the higher priority), with the length of the CPU-burst
time given in milliseconds:

Process Burst time Arrival time Priority


P1 3 0 2
P2 2 2 4
P3 5 5 1
P4 6 4 3
P5 9 3 5

1. Draw the Gantt charts illustrating the execution of these processes using Preemptive Shortest Job First and
Round Robin (quantum=2) scheduling.
2. Based on your answer above, calculate the average waiting time for both scheduling.

Question 3

Consider the following snapshots of a system:

By implementing Banker Algorithm, solve the following questions.


a. Identify the content of the matrix need.
b. What are the total resources (A, B, C, D) in this PC?
c. Illustrate the sequence of execution that will not result in any deadlock. Show the number of resources
available (E, F, G) after the completion of the process with your answer in b. Show the final <P ?, P?, P?, P?,
P?> satisfies the safety criteria.
d. If a new priority request is made by process P1 for (0, 2, 1, 0) resources, can the request be granted
immediately? Can the new system be in a safe state? Justify your answer.
Question 4

Consider the following snapshots of a system:

By implementing Banker Algorithm, solve the following questions.


a. Identify the content of the matrix need.
b. What are the total resources (A, B, C, D) in this PC?
c. Illustrate the sequence of execution that will not result in any deadlock. Show the number of resources
available (E, F, G) after the completion of the process with your answer in b. Show the final <P ?, P?, P?, P?,
P?> satisfies the safety criteria.
d. If a new priority request is made by process P2 for (0, 1, 0, 1) resources, can the request be granted
immediately? Can the new system be in a safe state? Justify your answer.

Question 5

Given the following fixed memory blocks and process sizes, allocate memory using first fit, best fit, and worst
fit strategies.

H U U H H U H U U H H
0K 45K 75K 110K 165K 200K 280K 350K 405K 415K 490K 600K
* U – Used | H - Hole

The following process requests were received in order:

Process Numbers Size in Kilobytes


1 57K
2 50K
3 31K
4 109K
5 72k

Show how the memory request above is allocated using each of the allocation schemes below (one process per
element):

i. First Fit (FF)


ii. Best Fit (BF)
iii. Worst Fit (WF)
Question 6

Given the following dynamic memory blocks and process sizes, allocate memory using first fit, best fit, and
worst fit strategies.

H U U H H U H U U H H
0K 45K 75K 110K 165K 200K 280K 350K 405K 415K 490K 600K
* U – Used | H - Hole

The following process requests were received in order:

Process Numbers Size in Kilobytes


1 40K
2 20K
3 25K
4 57K
5 100K

Show how the memory request above is allocated using each of the allocation schemes below (one process per
element):

i. First Fit (FF)


ii. Best Fit (BF)
iii. Worst Fit (WF)

Question 7

Given the reference string: 7, 0, 1, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2.

Assume the availability of FOUR (4) frames and all the frames are initially empty. How many page faults would
occur for the following page replacement algorithms. Identify the final pages in the frames.

i. First In First Out (FIFO)


ii. Optimal
iii. Least Recently Used (LRU)

Question 8

Given the reference string: 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5.

Assume the availability of THREE (3) frames and all the frames are initially empty. How many page faults would
occur for the following page replacement algorithms. Identify the final pages in the frames.

i. First In First Out (FIFO)


ii. Optimal
iii. Least Recently Used (LRU)

You might also like