0% found this document useful (0 votes)
19 views

CS2201_OS_Paper_Set_1

This document outlines the End Term Examination for the B.Tech - CSE program in Operating Systems, scheduled for April 2024. It includes various sections with questions covering topics such as multiprogramming, memory allocation algorithms, the Banker's algorithm, and disk scheduling policies. The examination consists of multiple-choice questions, problem-solving tasks, and theoretical questions, all of which are compulsory and require a calculator.

Uploaded by

megav369
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

CS2201_OS_Paper_Set_1

This document outlines the End Term Examination for the B.Tech - CSE program in Operating Systems, scheduled for April 2024. It includes various sections with questions covering topics such as multiprogramming, memory allocation algorithms, the Banker's algorithm, and disk scheduling policies. The examination consists of multiple-choice questions, problem-solving tasks, and theoretical questions, all of which are compulsory and require a calculator.

Uploaded by

megav369
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Name:

Enrolment No:

End Term Examination, April 2024


Faculty of Engineering, School of Computer Science & Engineering
Department of Computer Science & Engineering
B.Tech - CSE
Course Code: CS2201 Course: Operating System Semester: IV
Time: 03 hrs. Max. Marks: 80
Instructions: All questions are compulsory.
Missing data, if any, may be assumed suitably.
Calculator is allowed
SECTION A
S.No. Marks CO
Q A1 Differentiate multiprogramming, multiprocessing and multitasking 2 CO-1
Q A2 What is a race condition? Give an example. 2 CO-4
Q A3 Write the definition of Acquire () and Release () which are used in the Mutex Lock. 2 CO-4
Q A4 What is a thread-join operation? 2 CO-2
A system contains three programs, and each requires three tape units for its operation.
Q A5 2 CO-4
What are the minimum number of tape units which the system does not have deadlocks?
SECTION B
Q B1 Consider a single processor system supporting two running processes, A and B, with the
following sequential execution patterns:
A: [CPU 8ms; IO 1ms; CPU 8ms; IO 1ms; CPU 8ms]
B: [CPU 2ms; IO 1ms; CPU 2ms; IO 1ms; CPU 2ms]
Assume that IO operations do not interfere with each other and are blocking, and that
scheduling, and context switch times are negligible.
(i) What is the total time required by the individual process to run to 6 CO-3
completion?
(ii) Assume the system runs a non-preemptive scheduler where processes are
scheduled in the order A followed by B, and that B takes priority over A
in the event of a tie. Give the combined execution pattern of the two
processes and determine the total elapsed time for the two processes to
run to completion.
Q B2 Consider six memory partitions of size 200 KB, 400 KB, 600 KB, 500 KB, 300 KB and
250 KB. These partitions need to be allocated to four processes of sizes 357 KB, 210
KB, 468 KB and 491 KB in that order.
Perform the allocation of processes using-
8 CO-5
1. First Fit Algorithm
2. Best Fit Algorithm
3. Worst Fit Algorithm
Consider the following system snapshot using data structures in the Banker’s algorithm,
with resources A, B, C and D, and process P0 to P4:

Max Allocation Need Available

A B C D A B C D A B C D A B C D
Q B3
P0 6 0 1 2 4 0 0 1 ? ? ? ? 3 2 1 1

P1 1 7 5 0 1 1 0 0 8
CO-4
P2 2 3 5 6 1 2 5 4

P3 1 6 5 3 0 6 3 3

P4 1 6 5 6 0 2 1 2

Using Banker’s algorithm, answer the following:


i) What are the contents of the Need matrix?
ii) Is the system in a safe state? If yes, obtain the safe sequence.
iii) If a request from process P4 arrives for additional resources of (1,2,0,0). Can
the Banker’s algorithm grant the request immediately?
(a) Differentiate file Access methods sequential, direct and indexed sequential
Q B4 access method (ISAM). 6+2 CO-6
(b) What is a File? List the various File Attributes.
SECTION-C
Consider the following page reference string:
1, 2, 3, 2, 5, 6, 3, 4, 6, 3
Q C1 Indicate page faults and calculate total number of page faults for FIFO, LRU and
10 CO-5
Optimal page replacement algorithms. Calculate page fault with page frames 3.
Remember initially all the frames are empty.

(a) A computer system has a 36-bit virtual address space with a page size of 8K, and
4 bytes per page table entry.
i) How many pages are in virtual address space?
ii) What is the maximum size of addressable physical memory.
(b) A translation look-aside buffer (TLB) is sometimes used to optimize paging
Q C2 5+5 CO-5
systems. A memory chip uses (single level) paging and has a memory access
time of 12 nanoseconds and a TLB search time of 2 nanoseconds. What hit ratio
(the probability that an item is in the TLB) must be achieved if we require an
average (paged) memory access time of 12 nanoseconds?
SECTION-D
Q D1 a) Predict the output of the following code segments and justify your answer:

i) void main() int a = 0;


{ int main () { CO-2
int i; fork ();
for(i=1;i<=4;i++) a++;
fork(); fork ();
printf(“Hello”); a++;
} if (fork () == 0) 3+4+3
{ =10
print (“Hello! \n”);
} else {
print(“Goodbye!\n”);
}
a++;
print(“a is %d\n”, a);
}
b) A system is having 3 user processes P1, P2 and P3 where P1 requires 2 units of CO-4
resource R, P2 requires 3 units of resource R, P3 requires 4 units of resource R. Obtain
the minimum number of units of R that ensures no deadlock.

Q D2 A disk has 200 tracks (numbered 0 through 199). At a given time, it was serving the
request of reading data from track 120, and at the previous request, service was for track
90, the pending request (in order of their arrival) are for track numbers.

30,70,115,130,110,80,20,25 10 CO-6
How many times will the head change its direction for the disk scheduling policy FCFS
and SSTF, SCAN and LOOK? Calculate the seek time. Draw an appropriate diagram to
explain.

You might also like