Professional Documents
Culture Documents
Note: Objective part is compulory. Attempt any three questions fromsubjective part.
Q.1. Write short answers of the following in 2-3 lines cach. (2*12
v. What is interrupt?
x. What is thrashing?
·LRU replacement
FIFO replacement
· Optimal replacement
University of Sargodha
BS 5th Term Examination 2019
Sublect: Computer Science Paper: Operatine System (CMP:3621)
Q.NO.1-Answer the following questions in 2-3 lines having 2 marks each [12x2=24]
1. What is multiprogramming
9. What is Semaphores
11.What is spooling?
Subjective Part
Q No.2 Compare the memory organization schemes of contiguous memory allocation,pure segmentation, and pure paging with respect to the following
issues:
a. External fragmentation
b.Internal fragmentation
Q.No.4 a) what is semaphore How semaphore works for synchronizations of the processes?
3.7.6,3.2.1.2.3,6. How many page faults would occur Optimal and Least Recently Used Page Replacoment algorithms with (a) Five frames (b) Six frames.
Remember that are frames are initially empty.
Q.No.6. Consider the following set of processes, with the length of the CPU burst given in milliseconds:
Vist
http://tshahab.blogspol.com
for more
The Process are assumed to arrive in te order P1, P2. p3. p4. p5 all at time 0.
a) Draw four Gantt charts that illustrate the execution of these processes using the following scheduling algorithms: FCFS, SJF, non-preemptive priority (a
smaller priority number implies a higher priority),and RR (quantum= 1).
University of Sargodha
Write short answers of the following in 2-3 lines cach on your answer sheet. (16*2)
Suppose there is an organization which hired a person for dividing tasks among other persons.Which multiprocessing onvironment
does this organization depict?
Mention at least 4 Syalem Calls when you enter a command that coples a file from one path to another.
Why SIF can't be used in real-time environment when you don'1 have execution history of the programs?Write names of all
preemptive and non-preemptive scheduting policies.
Suppose that we have free segments with sizes: 6,17.25.14, and 19. Placc a program with size 13kB in the free segment using first-
fit,best-fit and worst fit?
3. a)Explain when a Deadlock can and when it cannot occur in the below scenario when two processes(PO,P1)are competing for
semsphore S=1 and Q-1. (8)
n
Pa
vast(S): vait(q);
va1t(Q). wait():
migmal(s): algmal(Q):
m1[ml(Q); e1gal(0):
b.How Peterson's solution prescrvesJ properties for critical section problem k.e.Mfuul erchalam,Progress and Bounded-
Waiting? (8)
dlfocut
dnallable
ion
Neol
ABC ABC
ABC
b
e
l
o 010 743 230
w
:
P
。
P
1
302 020
302P 600
P
211 011
,
P 4
4 002 31
Apply Banker's algorithm and argue with reasoning whether requests should be granted or not.
i. Can request for (0,2,0) by Po be granted? (6)b)Compare the memory organization schemes
of Contiguous Memory Allocation,Segmentation,and
(3)
iv. What are total number of pages in Main Memory? (3)
V. How many pages required to lond this process in Main Memary? (3)
vil. IfOS takes 5 pages, how many others pages left for user processes? (2)
1)Consider the following page reference using three frames that are initially empty. Find the page faults sing Optimal
algorithm,where the page reference sequence.7.0.1.2.0.3.0,4.2,3,0,3,2,1,2,0,1,7,0.1? (6)
)Apply LRU on dataset provided in Question 6 part a and compare the resuls. (10)
Note: Objective part is compulsary.Attempt any three questions from subjective part.
Q.1. Write short answers of the following in 2-3 lines cach on your answer shect. (12*2)
i. What is the difference between a Page and a Frame?
ii.Which one of the following scheduling algorithm could result in starvation? FCFS, SJF.Round Robin.
iil. What does it mean to Preempt a process?
x. What advantage is there in having different time-quantum, sizes at different evels of a multilevel queuing
system?
xi.What is the differences between deadlock avoidance,prevention and detection?
xii. FIFA and LRU both use previous information in page replacement policy.How is the ane different from another then?
P1 0 8
P2 0 4
P3 2
P4 10 1
Calculate following by applying SJF algorithm and also draw Gantt charts for each.
Need dvailabl
:Allocatio
ABC ABC
n ABC
P1 302 020
P2 302 600
P3 211 011
Pa 002 431
Apply Banker's algorithm and argue with reasoning whether requests should be granted or not.
Q.5. a)Consider thefollowing page reference using three frames that are initially cmpty.Find the page faults using Optimal
algorithm,where the page reference sequence:
7,0,1,2,0,3,0,4,2,3,0,3,2,1,2,0,1,7,0,17 (5)(7)
b) Apply LRU on datase' pruvided in Question 5 part a,and compare the results.
rShahab.blogspot.com [6]
Q.6. Compare the memory organization schemes of contiguous memory allocation,segmentation,and paging with respect to
the following issues:
b. Internal fragmentation
rShahab.blogspot.com [6]