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

Open Book Component

The document contains 10 questions regarding operating systems concepts like disk scheduling algorithms, file organization in UNIX, multilevel feedback queue scheduling, thread synchronization using joins, page replacement algorithms, paging with multi-level page tables, reader-writer problem implementation, and deadlock detection using resource allocation graphs. The questions cover a wide range of topics testing the examinee's understanding of fundamental OS principles.

Uploaded by

Vishal Mittal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views3 pages

Open Book Component

The document contains 10 questions regarding operating systems concepts like disk scheduling algorithms, file organization in UNIX, multilevel feedback queue scheduling, thread synchronization using joins, page replacement algorithms, paging with multi-level page tables, reader-writer problem implementation, and deadlock detection using resource allocation graphs. The questions cover a wide range of topics testing the examinee's understanding of fundamental OS principles.

Uploaded by

Vishal Mittal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

BIRLA INSTITUTE OF TECHNOLOGY & SCIENCE, PILANI

Second Semester 2003-2004


Course Title : OPERATING SYSTEMS Course No CS C372 & IS C362
Component : Comprehensive Examination Open Book Component
Weightage : 30% Max Marks: 30 Date : 01-05-2004
Note: Attempt all the Questions. Start each answer from a fresh page.

Que #1 3 Marks
Disk requests come into the disk driver for cylinders 10,22,55,2,28,12,6,40 and 38
in that order. The disk drive has 60 cylinders numbered 0 to 59 and the current head
position is 26. A seek takes 6 millisecond / cylinder moved. How much seek time is
needed for
(A) FCFS (B) SSTF
(C) SCAN (D) C – SCAN
(E) LOOK (F) C – LOOK
Que #2 3 Marks
Consider the organization of a UNIX file as represented by the inode. Assume that
there are 12 direct block pointers and a singly, doubly, and triply indirect pointer in
each node. Further, assume that the system block size and disk sector size are both
8K. If the disk block pointer is 32 bits, with 8 bits to identify the physical disk and
24 bits to identify the physical block, then
(A) What is the maximum file size supported by this system?
(B) What is the maximum file system partition supported by this system?
(C) Assuming no information other than that the file inode is already in main
memory, how many disk accesses are required to access the byte in
position 13,423,956.
Que #3 4 Marks
A multilevel feedback queue algorithm works with the following condition
Number of queues 3 (Q1,Q2 and Q3)
Scheduling algorithm Q1  R R, Q2  preemptive priority
& Q3  FCFS
Method used to upgrade a process No upgrading among queues
Method to demote a process Q1After 2 units of time, Q2 When the Priority
becomes 0 (Priority of the process reduced by 1 for every 1 units of execution in CPU, if
2 processes have the same priority then the process came first to the queue), Q3The
Process who came first to the queue will get the first chance.
Method used to determine which queue a process will enter
P1, P3 are entering through Queue #2 (Q2)
P2 & P4 are entering through Queue #1 (Q1)

Process T.CPU burst CPU burst I/O burst Priority Arrival time
P1 14 7 6 6 0
P2 13 8 1 5 1
P3 10 4 3 4 4
P4 13 8 4 4 6
Calculate Average waiting time, average turn around time, and CPU utilization
Que #4 4 Marks

Consider the following test program for an implementation of join. When parent
thread calls join on a child thread the parent does the following
1. If the child is still running the parent blocks until the child finishes
2. If the child has finished the parent continues to execute without blocking.

int x=10;
pthread_t tid[25];

void main()
{ void *fun1(void *a)
int i,j=0; {
for(i=0;i<3;i++) x = x /2 ;
{ x=x – 3;
if(fork()) x=x*3;
{ }
x=x + 5;
pthread_setPriority(tid[i],x);
pthread_create(tid[i],NULL,fun1,0);
x = x+10; void *fun2(void *a)
} {
else x = x /4 ;
{ x=x + 2;
x = x – 5; x=x*3;
pthread_setPriority(tid[i],x); }
pthread_create(tid[i],NULL,fun2,1);
x=x - 20;
}
x=x + 10;
}
for(i=0;i<3;i++)
{
pthread_join(tid[i]);
}
printf(“%d\n”,x);
}

Assume that the scheduler run threads in non-preemptive Priority scheduling (the
more the priority number the higher the priority is). Main thread is having the priority
value 5.What will be the values of x (all copies of x) after execution?
Que #5 4 Marks
Consider the following page reference string
2,3,1,2,4,5,1,2,3,4,5,2,6,2,1,2,3,1,4,5,6
How many page faults would occur for the following page fault algorithms,
assuming 3 and 4 available frames. In the beginning the frames are empty.
(A) Optimal replacement
(B) LRU replacement
(C) FIFO replacement
(D) Second chance replacement

Que #6 3 Marks
Suppose we have a computer system with 44-bit virtual address, page size of 64K,
and 8 bytes per page table entry
(A) How many pages are in the virtual address space?
(B) Suppose we use 3 level paging and arrange for all inner page tables to fit
in exactly to a single page frame. How will the bits of the address be
divided up?
(C) Suppose we have a 4GB program such that the entire program and all
necessary page tables (using 3 level pages from above) are in memory.
How much memory, in Page frames, is used by the program, including its
page table?

Que #7 2 Marks
A computer with 32-bit address uses 3 level page tables. Virtual addresses are
split into 3-bit outer and 9 bit and 9 bit inner levels and an offset (inner page table are
designed to fit exactly in one frame).
(A) How large the pages are?
(B) How many are there in the address space?
(C) How long is one entry in page table?

Que #8 4 Marks
Implement Reader – Writer problem with writer dominance using
(A) Critical region
(B) Monitor

Que #9 1 Marks
Why is the name of a file usually not stored in the file descriptor?

Que #10 2 Marks


A system has three processes (P1,P2,P3) and three resources (R1,R2,R3). There
are two instances of R1 and R2 and one instance of R3. P1 holds a R1 and is requesting a
R2. P2 holds a R1 and a R2 is requesting an R3. P3 holds a R2 and R3 and is requesting a
R1. Draw the resource allocation graph for this situation. Does the deadlock situation
exist? Prove your answer.

You might also like