You are on page 1of 2

BIRLA INSTITUTE OF TECHNOLOGY AND SCIENCE, PILANI

K K BIRLA, GOA-CAMPUS
OPEN BOOK, Quiz -2
Subject Name: Operating Systems (CS F372), Time: 40 Minutes Max. Marks: 30

Name: ID. No:

Q1:A classical IPC problem takes place in a barber shop. The barber shop has one barber, one barber
chair, and n chairs for waiting customers, if any, to sit on. If there are no customers present, the barber sits
down in the barber chair and falls asleep, as illustrated in Fig. When a customer arrives, he has to wake up
the sleeping barber. If additional customers arrive while the barber is cutting a customer’s hair, they either
sit down (if there are empty chairs) or leave the shop (if all chairs are full). The problem is to program the
barber and the customers without getting into race conditions. Explain the Solution of Sleeping Barber
Problem using Semaphores.

Solutions:
Q2: Show how counting semaphores can be implemented using only binary semaphores. Explain Your
Answer.

Solution:

Q3: The system has 44 bit virtual address and 42 bit physical address. The frame size of MM is 8KB. The
system follows hierarchical paging. One entry in innermost page table is 8bytes long and the entry size
doubles in each level from innermost to outermost.
• A. Divide the virtual address so that all page tables fit in frame boundary.
• B. How many frames are required in MM, if you want to store the largest possible program and
all its page tables in the MM?
Solution:
Divide the virtual address so that all page tables fit in frame boundary.
Ans: 4 + 8 + 9 + 10 + 13 = 44
B. How many frames are required in MM, if you want to store the largest possible program and
all its page tables in the MM?
Ans: 1 + 24 + 212 + 221 + 231

You might also like