Daffodil International University
Department of Computer Science and Engineering
Faculty of Science & Information Technology
Final Assessment, spring 2021 @ DIU Blended Learning Center
Course Code: CSE323 (Day), Course Title: Operating Systems
Level: 3 Term: 2 Section: C, D and E
Instructor: Most. Hasna Hena Modality: Open Book Assessment
Date: Thursday 15 April, 2021 Time: 11:00-04:00pm
Five hours (5:00) to support online open/case study based assessment Marks: 40.0
Analyze and answer specific sections based on your own thinking and work.
Do not share as this will be treated as plagiarism by Blended Learning Center
Answer all of the questions.
1 a. “If the resource allocation graph contains cycle/cycles, then the system may or 4.0
may not be in a deadlocked state.” Is this statement true? Explain your answer with a
proper example.
b. Suppose a system uses Bankers algorithm to avoid deadlock. Consider there are six 8.0
processes in the system. They need four types of resources: P, Q, R, and S. They have
some resources and need more resources to complete their task. The system has 4
instances of resource P, 2 instances of resource Q, 1 instance of resource R and 4
instances of resource S initially available. In the Allocation and Max matrix the value for
P, Q, R and S of process P5 will be the last four digits of your own DIU ID.
For example, if a student has ID 171-15-12345, then the value for P=2, Q=3, R=4 and
S=5 of process P5 for Allocation and Max Matrix.
Now see the following snapshot and give the answer of the following questions.
Process Allocation Proce Maximum
es sses
P Q R S P Q R S
P0 2 1 1 2 P0 3 3 2 2
P1 1 3 0 2 P1 5 4 1 3
P2 2 3 1 0 P2 6 3 4 4
P3 2 0 2 0 P3 2 0 2 1
P4 1 1 1 1 P4 3 2 2 3
P5 P5
I. Find out the content of the Need of each process.
II. Find out the safe sequence for the above scenario.
III. Find out the total number of instances of the resource type P, Q, R and S.
IV. Suppose two requests from two processes come. One request from process P3
for (0, 0, 1 and 1) resources and another request from P4 for (1, 1, 1 and 1)
resources. Can these requests be granted immediately ensuring the system is
safe? If yes, show the safe sequence. If no, explain it.
2 a. Suppose 1MB memory is partitioned into some fixed sized blocks each block having a 5.0
size of 128KB. The list of request orders is: 50k, 150k, 90k, 130k, 70k, 80k, 120k, 180k,
and 60k. Do you think it is possible for an operating system to serve all the requests by
implementing the memory allocation algorithms? Justify your answer.
b. What will be the dynamic memory allocation in the worst fit manner using the following 6.0
information?
Block B101 B102 B103 B104 B105
Size 105K 80K 208K 50K 160K
Processes Size Turnaround
P1 65K 2
P2 170K 3
P3 200K 2
P4 90K 2
P5 35K X+1
P6 100K X+2
Here X = Your ID%2
3 a. A system uses 3 page frames for storing process pages in main memory is available. It 8.0
uses the Least Recently Used (LRU) page replacement policy. What is the miss ratio and
hit ratio that will occur while processing the page reference string given below:
4, 7, 6, 1, 7, 6, 1, 2, 7, 2, 6, 7, J1, J2, J3
Where J1, J2 and J3 are the last three digits of your ID. For example, if a student has
ID 171-15-12345, then J1=3, J2=4 and J3=5
Now, Also compare it with the optimal page replacement algorithm.
b. Explain Belady's anomaly using the given string: 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5 4.0
c. Suppose a disk drive has 2000 tracks (0-1999) and the disk queue having I/O requests in 5.0
the following order as follows:
100, 250, 1500, 750, 950, 200, 1450, 850, 150,1850, 550, 1100, 1720, 90, 310, 280,
350, 480, 1375, 1530, 1780, 1890, 1410, 270, 170
Current position of the Read Write head is 400 and assume that previous request was the
last three digits of your id [Sample: Id 172-15-12345; previous request 345].
Which algorithm/algorithms will perform better for the systems that place a heavy load
on the disk? Explain your answer. Now calculate the seek distance for your chosen
algorithm.
Best of Luck ☺