Professional Documents
Culture Documents
Conprehensive Exam Question Paper CS F372
Conprehensive Exam Question Paper CS F372
NAME: IDNO:
MARKS OBTAINED
RECHECK REQUEST: PART A PART B TOTAL
2M case a.
3M case b.
B. A 64 bit system with Virtual Memory support has 42 bits address bus width. The system has
2 GB RAM with 16 KB frame size. The system follows hierarchical paging. One entry in inner
most page table is 8 bytes long and the entry size doubles in each level from inner most to outer
most.
a. Divide the logical address so that all page tables fit in frame boundary.
b. How many frames are required in MM, if you what to store the largest possible program and
all its page tables in the MM? (Mention frames required for each component)
c. If the process is of 16 GB size, how many frames are required in MM to hold program and
all its page tables in MM? (Mention frames required for each component)
2M a
4M b
4M c
Page 1
Question #2: Memory Management [15 Marks]
A. Consider the following definition of memory allocation strategies. Best fit: The allocator
places a process in the smallest block of unallocated memory in which it will fit. Good fit:
The allocator maintains the list of holes in increasing order of memory size and places a
process in the smallest block of unallocated memory in which it will fit. Suppose the OS
currently has a list of unallocated blocks (holes) of 6KB, 14KB, 19KB, 11KB, and 13KB
blocks. a. Find the appropriate block of memory for a 12KB process according to Best fit and
Good fit allocation strategies. b. Find the time complexity of both the algorithms if N are the
total number of holes.
Best fit Good fit
4M Block
4M Time complexity
B. Consider a process having eight virtual pages on disk is assigned a fixed allocation of four
page frames in main memory. Apply LRU page replacement policy for the following page
requests and calculate the number of page faults. Assume that the frames are initially empty.
1 0 2 2 1 7 6 7 0 1 2 0 3 0 4 5 1 5 2 4 5.
7M
4M A W= X= Y= Z=
6M B Safe sequence =
Page 2
NAME: IDNO:
B 2 9 2B5
C 4 6 CPU bound
D 8 8 1D4
10M
Page 3
PART B [60 Marks]
Q5. A. A barbershop consists of awaiting room with n chairs and a barber room with one barber
chair. If there are no customers to be served, the barber goes to sleep. If a customer enters the
barbershop and all chairs are occupied, then the customer leaves the shop. If the barber is busy
but chairs are available, then the customer sits in one of the free chairs. If the barber is asleep, the
customer wakes up the barber. Consider this as an instance of the Producer-Consumer problem.
Identify the producer(s), the consumer(s) and the contents and maximum size of the bounded
queue. Write the pseudocode to coordinate the barber and the customers.
B. Consider a typical disk that rotates at 15000 rotations per minute (RPM) and has a transfer
rate of 50 × 106 bytes/sec. If the average seek time of the disk is twice the average rotational
delay and the controller’s transfer time is 10 times the disk transfer time, the average time (in
milliseconds) to read or write a 512 byte sector of the disk is _____________. Explain your
answer. [12+8=20]
Q6. A. Given the following queue -- 95, 180, 34, 119, 11, 123, 62, 64 with the Read-write head
initially at the track 50 and the tail track being at 199. Give the time required to service the given
requests using each of the following algorithms.
(a) FCFS scheduling (b) SSTF scheduling (c) SCAN scheduling (d) C-SCAN scheduling,
(f) C-LOOK scheduling,
B. Show how to implement the wait() and signal() semaphore operations in multiprocessor
environments using the TestAndSet() instruction. The solution should exhibit minimal busy
waiting. [10+10=20]
Q7. A. Write a the pseudocode for a monitor that implements an alarm clock that enables a
calling program to delay itself for a specified number of time units (ticks). You may assume the
existence of a real hardware clock that invokes a procedure tick in your monitor at regular
intervals.
B. Servers can be designed to limit the number of open connections. For example, a server may
wish to have only N socket connections at any point in time. As soon as N connections are made,
the server will not accept another incoming connection until an existing connection is released.
Explain how semaphores can be used by a server to limit the number of concurrent connections.
C. Deadlock is defined as two or more processes are waiting indefinitely for an event that can be
caused by only one of the waiting processes. Give example of deadlock for 2 processes sharing
some common semaphore. [10+5+5=20]
Page 4