# Introductory to Operating Systems COP 4600 Homework #2 solution

\$30.00

Original Work ?
Category:

## Description

5/5 - (1 vote)

Q1.(4 points) A system has a total of 8 resources of a particular type. There are 4 processes running with their maximum resources needs and current allocation of resources as shown below

Process                Max need                  Current allocation

P1                                3                                     1

P2                                2                                     1

P3                                5                                     2

P4                                6                                     2

1. Specify all the safe sequence from the state shown above

1. If P4 were to request 1 resource, should the request be granted? (Yes or No)

If yes –then indicate a safe sequence from the resulting state:

If No –then indicate the sequence of steps that would lead to a deadlock

Q2.(3 points) Assume that the following section of main memory is used to store the page table for 3 different processes. The page-table base register values for process P1 is 1080, for P2 is 1085, and for P3 is 1090. Assume that the contests of memory below correspond to frame numbers. Also assume that frame size is 4096.

 contents 3 5 8 4 7 2 0 15 11 18 6 20 24 9 10 13 30 38 40 1 Memory addresses 1 0 7 6 1 0 7 7 1 0 7 8 1 0 7 9 1 0 8 0 1 0 8 1 1 0 8 2 1 0 8 3 1 0 8 4 1 0 8 5 1 0 8 6 1 0 8 7 1 0 8 8 1 0 8 9 1 0 9 0 1 0 9 1 1 0 9 2 1 0 9 3 1 0 9 4 1 0 9 5

To which physical memory address would the logical address (1, 1200) correspond to if generated by P1?

To which physical memory address would the logical address (3, 800) correspond to if generated by P2?

Assume that each process has 5 pages. To which process does the following physical address belong and which logical address corresponds to each physical address:

Q3. (3 points) A paging system is experiencing a page fault rate of 1 in 1 million page references. When a page fault occurs, 30% of the time an empty frame is not available and frame replacement is needed. Assume that it takes 10 milliseconds to service a page fault needing no frame replacement.  When frame replacement is needed, 40% of time the frame has been modified and it takes 20 milliseconds to service the page fault, in contrast it takes 12 milliseconds when the frame to be replaced has not been modified. It takes 100 nanoseconds to reference a physical memory location and we can neglect the time that it takes to access the page table.

Calculate the effective memory access time for this system under these conditions. Clearly indicate intermediate steps.