Anda di halaman 1dari 2

Deadlock, Systems

Questions 1:

Memory

Management,

Input/Output,
10 Marks

File

A computer system has 4 processes (p1,p2,p3,p4) and 3 resource types with amount: R1 = 9, R2 = 3, R3 = 6 Assume that at time t0 the following snapshot of the system has been taken:

Use the Bankers algorithm to determine: a) Is the current system safe? If so, give a safe sequence. Showing your working step by step. b) Suppose P2 is requesting Q = (2,0,1). Should this request be granted? If so, give a safe sequence. You must show your working.

Question2:

5 Marks

For each of the following decimal virtual addresses, compute the virtual page number and offset for a 4-KB page and for an 8 KB page: 10500, 58000, 76000. Show all your working steps.

Question3:

5 Marks

If FIFO page replacement is used with four page frames and eight pages, how many page faults will occur with the reference string 7876258157 if the four frames are initially empty? Now repeat this problem for LRU. Show all your working steps.

Question 4:

10 Marks

A computer provides each process with 65,536 bytes of address space divided into pages of 4096 bytes. A particular program has a text size of 40,464 bytes, a data size of 14,186 bytes, and a stack size of 12,570 bytes. Will this program fit in the address space? If the page size were 512 bytes, would it fit? Remember that a page may not contain parts of two different segments.

Question 5:

10 Marks

A floppy disk is interleaved, as in the following Figure (b). It has eight sectors of 512 bytes per track, and a rotation rate of 150 rpm. How long does it take to read all the sectors of a track in order, assuming the arm is already correctly positioned, and 1/2 rotation is needed to get sector 0 under the head? What is the data rate? Now repeat the problem for a non-interleaved disk with the same characteristics. How much does the data rate degrade due to interleaving?

Question 6:

10 Marks

One way to use contiguous allocation of the disk and not suffer from holes is to compact the disk every time a file is removed. Since all files are contiguous, copying a file requires a seek and rotational delay to read the file, followed by the transfer at full speed. Writing the file back requires the same work. Assuming a seek time of 9 msec, a rotational delay of 4 msec, a transfer rate of 5 MB/sec, and an average file size of 16 KB, how long does it take to read a file into main memory then write it back to the disk at a new location? Using these numbers, how long would it take to compact half of a 16-GB disk?

Anda mungkin juga menyukai