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

CS2201 OS Paper Set 2

This document outlines the End Term Examination for the B.Tech - CSE program, focusing on Operating Systems. It includes various sections with questions on topics such as process scheduling, inter-process communication, memory protection, file access methods, and disk scheduling algorithms. The exam consists of multiple-choice questions and problem-solving tasks, requiring knowledge of concepts like the Banker's algorithm and page replacement strategies.

Uploaded by

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

CS2201 OS Paper Set 2

This document outlines the End Term Examination for the B.Tech - CSE program, focusing on Operating Systems. It includes various sections with questions on topics such as process scheduling, inter-process communication, memory protection, file access methods, and disk scheduling algorithms. The exam consists of multiple-choice questions and problem-solving tasks, requiring knowledge of concepts like the Banker's algorithm and page replacement strategies.

Uploaded by

megav369
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
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 How does aging solve the starvation problem in priority based scheduling system? 2 CO-3
Q A2 What are the different IPC mechanisms? 2 CO-4
Q A3 How do base register and limit register help in protecting against illegal memory access? 2 CO-5
Q A4 What is the use of the ready queue in scheduling. 2 CO-3
Q A5 How does a context switch work, and why is it essential? 2 CO-1
SECTION B
The diagram below is a simplified state transition diagram for a process in a generic operating
system.
Q B1

8 CO-1

For each of the following, describe the transitions taken by the process and state whether it is
necessary for the process scheduler to run:
(i) The running process is interrupted by a timer. The timer interrupt service
routine determines that the time slice given to the process has not yet expired.
(ii) As in (i) but the time slice given to the process has expired.
(iii) A running process makes a system call which can be serviced immediately by
the kernel.
(iv) A running process makes a system call which requires an I/O operation to be
initiated.
Q B2 (a) Differentiate file Access methods sequential, direct and indexed sequential access
method (ISAM). 4+2 CO-6
(b) What is a File? List the various File Attributes.
On a paging system with a page table containing 64 entries of 11 bits (including valid/invalid
Q B3 bit) each, and a page size of 512 bytes,

a) How many bits in the logical address specify the page number and offset within the
page? 8
b) How many bits are in a logical address and what is the size of logical address space? CO-5
c) How many bits in the physical address specify the page frame number and offset within
the frame?
d) How many bits are in a physical address and what is the size of physical address space?

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:

Allocation Matrix Max Matrix Available


Matrix
A B C D A B C D A B C D
P0 0 1 1 0 0 2 1 0 1 5 2 0
P1 1 2 3 1 1 6 5 2
Q B4 P2 1 3 6 5 2 3 6 6 8 CO-4
P3 0 6 3 2 0 6 5 2
P4 0 0 1 4 0 6 5 6

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 P1 arrives for additional resources of (0,2,1,0). Can the
Banker’s algorithm grant the request immediately?

SECTION-C
Consider the following set of processes, with the length of the CPU burst given in
milliseconds:

Q C1
10 CO-3
I. Find out turnaround time for each process using the non-pre-emptive Priority Scheduling
(a smaller priority number implies a higher priority)?
II. Find out turnaround time for each process using Pre-emptive Priority Scheduling (a
smaller priority number implies a higher priority)?
III. Find out turnaround time for each process using non-pre-emptive Shortest Job First Time?
IV. Find out turnaround time for each processes using Pre-emptive Shortest Job First Time
(or Shortest-Remaining-Time-First)?
Consider the following page reference string:
1,2,3,4,2,1,5,6,2,1,2,3,7,6,3,2,1,2,3,6
Indicate page faults and calculate total number of page faults for FIFO, LRU and Optimal page
Q C2 10 CO-5
replacement algorithms. Calculate page fault with page frames 4. Remember initially all the
frames are empty.

SECTION-D
Q D1 (a) Consider three concurrently executing threads in the same process using two
semaphores s1 and s2. Assume s1 has been initialized to 1, while s2 has been
initialized to 0. What are the possible values of the global variable x, initialized to 0,
after all three threads have terminated? (P represents Wait () and V represent Signal ())
CO-4
/* thread A */
P(&s2);
P(&s1); x = x*2;
V(&s1);
/* thread B */
P(&s1);
x = x*x;
V(&s1);
/* thread C */
P(&s1);
x = x+3;
V(&s2);
V(&s1); 5+5
(b) What could the output of the concurrent execution of process A and process B be?
(State all possible outputs).
int x=0;
int y=0; // “initialization”
Process A Process B

while(x==0) {do-nothing}; printf(“b”);


printf(“a”); x=1;
y=1; while(y==0) {do-nothing};
CO-2
y=0; printf(“c”);
printf(“d”);
y=1;

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