You are on page 1of 4

Daffodil International University

Department of Software Engineering


Faculty of Science & Information Technology
Final Examination, Fall 2020 @ DIU Blended Learning Center
Course Code: SE232, Course Title: Operating System and System Programming
Level: L2 Term: T3 Section: A, B, C
Instructor: DMR Modality: Open Book Exam
th
Date: 24 December, 2020 (Thursday) Time: 02:00PM-05:00PM
Marks: 40
Exam Instructions:

 Students need to go through the Problems shown in this exam paper.

 Analyze and answer specific section based on your own thinking and work.

 Do not share as this will be treated as plagiarism by Blended Learning Center(BLC).

 Exam Duration is 3Hours.

 If you face problem to upload the file(s) in the BLC please email me the answer script within
the 4:45 PM time. Email: mostafijur.unimap@gmail.com. State your ID & Name in the email
subject. Later submission will deduct 10 Marks.

 Make sure each page got Page number and Student ID in the Answer Script.

 Pages are needed to arrange in ascending order in the Answer Script.

 Rough page(s) are needed to add at the end of answer script with page number(s).

 File size should not more than 9.90MB

 Combine Pdf file allowed to upload in the BLC also.

 Individual picture file also allowed to submit in the BLC.

Copyright Department of Software Engineering, Daffodil International University

Page 1 of 4
QUESTION 1: (Level 2-Understanding)
Differentiate the principle of Counting and Binary Semaphore to solve a concurrency problem.
Marks 2

QUESTION 2: (Level 3 & 4 – Application & Analysis)


Figure-1 shows a Critical Section (CS) with Six concurrent processes P1, P2, P3, P4 P5 and P6.
The processes are allowed to access the CS with Mutual Exclusion Mechanism. Blocked Queue
is used to keep track the process(es) willing to get access the CS but it is lock. The Ready Queue
keeps track the processes wakeup from the Blocked Queue when CS is free by the process(es).
Analyze and Illustrate the updated Semaphore value from the Figure-1 where the Maximum
number of CS entry is 6, number of processes taken entry into CS is 4 and number of exit
processes from CS is 3.

Figure-1 Critical Section


Marks 4

QUESTION 3: (Level 6-Creativity)


Write the Concurrent Statements for the precedence Graph in Figure 2.

Figure-2: Precedence Graph

Marks 4

Copyright Department of Software Engineering, Daffodil International University

Page 2 of 4
QUESTION 4: (Level 2-Understanding)
Differentiate between Deadlock Avoidance, Deadlock Prevention and Deadlock Detection
briefly.
Marks 2

QUESTION 5: (Level 6-Creativity)


Consider a system consists of four resources R1(consists 2-instances), R2(consists 3-instances),
R3(consists 4-instances), and R4(consists 2-instances) and three processes P1, P2, and P3.
Following are the statement for the resource allocation. Draw the Resource Allocation Graph.
Observe the concurrent processes may cause deadlock or not.

Resource Allocation Statements:


i) P1 Requests R1(1-instance)
ii) P1 Requests R3(1-instance)
iii) P1 Hold R2(1-instance)
iv) P2 Hold R1(1-instance)
v) P2 Hold R3(2-instances)
vi) P3 Requests R1(1-instance)
vii) P3 Requests R2(1-instance)
viii) P3 Requests R3(1-instance)
ix) P3 Requests R4(1-instance)
x) P3 Hold R2(1-instances)
xi) P3 Hold R4(1-instances)
Marks 5

QUESTION 6: (Level 4-Analysis)


Suppose we use the Banker’s Algorithm to avoid deadlock. Consider a system in Table-1, that
has 5 processes P1, P2, P3, P4, P5 and 4-types of resources A(consists 6-instances), B(consists 3-
instances), C(consists 4-instances), and D(consists 2-instances). The AVAILABLE Matrix
denotes the instances available for allocation. The ALLOCATION Matrix denotes the instances
that have been allocated to the processes. The NEED Matrix denotes the instances that may still
be needed by the processes to complete the tasks. The MAX ALLOCATION Matrix denotes the
maximum number of instances allocation permitted to the processes. Suppose at a certain state
the ALLOCATION, NEED matrices are shown below:

Table 1: Resources and their allocation Information


Process ALOCATION NEED TOTAL Resources
A B C D A B C D A B C D
P1 2 0 1 0 1 1 0 1 6 3 4 2
P2 0 1 0 1 0 1 1 1
P3 1 0 1 0 2 0 1 0
P4 1 1 0 0 1 2 1 0
P5 1 0 1 0 1 1 0 0

Copyright Department of Software Engineering, Daffodil International University

Page 3 of 4
a) Find the AVAILABLE Matrix. Marks 1

b) Is the system in a safe state? Why? Marks 5

c) If P4 makes a request of (0,1,0,0), should the system grant the request? If not, what
should the system do? You must show your steps clearly to prove that your answer is
correct.
Marks 4

QUESTION 7: (Level 3-Application)


Consider for the dynamic memory partitioning, the adjacent memory partitions are 150K, 500K,
200K, 300K and 550K. If the processes requiring memories 210K, 450K, 135K and 425K arrive
in this order, Demonstrate the allocations for the First-fit and Best-fit algorithm.
Marks 4
QUESTION 8: (Level 3- Application)
Suppose a 64 MB block of memory is allocated using the buddy system. Demonstrate the
results of the following sequence of requests and releases using figure. Request A:12 MB;
Request B: 8 MB; Request C:32 KB; Release A; Request D:14 KB; Release B; Release A;
Release C.
Marks 3

QUESTION 9: (Level 3- Application)


Consider the following sequence of page references: 1, 2, 3, 4, 1, 2, 3, 4, 3, 2, 5, 2, 3, 9, 8, 3.
Apply the LRU and OPT page replacement algorithms (using three frames) to trace the page
references. Find the total number of page faults.
Marks 4

QUESTION 10: (Level 3- Application)


Suppose that a disk drive has 3000 tracks, numbered 0 to 2999. The drive is currently serving a
request at track 2055. The queue of pending requests, in FIFO order, is:

2060, 2050, 1097, 2338, 554, 1128, 216, 1723, 2475, 881

Starting from the current head position, illustrate the total distance that the disk arm moves to
satisfy all the pending requests for each of the SSTF disk-scheduling algorithms?
Marks 2

OOoo--End--ooOO

Copyright Department of Software Engineering, Daffodil International University

Page 4 of 4

You might also like