os problems

29
Problems based-on Topics in Memory Management

Upload: surya-pratap-desai

Post on 12-Nov-2014

45 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Os Problems

Problems based-on

Topics in Memory Management

Page 2: Os Problems

Problem 1

Page 3: Os Problems

Solution 1

Page 4: Os Problems

Problem 2

0,430

Solution 2

Page 5: Os Problems

Problem 3

Page 6: Os Problems

Solution 3

Page 7: Os Problems

Problem 4

Solution 4

Page 8: Os Problems

Problem 5

c. Simple paging (assume page size of 2K)

Page 9: Os Problems

Solution 5(c)

Page 10: Os Problems

Problem 6

Solution 6

Page 11: Os Problems

Problem 7

12 bits

Solution 7

Page 12: Os Problems

Problem 8

Solution 8

Page 13: Os Problems

Problem 9

Solution 9

Page 14: Os Problems

Problem 10

Page 15: Os Problems

Solution 10

memory

Page 16: Os Problems

Problem 11

Page 17: Os Problems

Solution 11

Page 18: Os Problems

Problem 12

Page 19: Os Problems

Solution 12

Page 20: Os Problems

Problem 13

Page 21: Os Problems

Solution 13(a) OPT replacement

(b) FIFO replacement

(c) LRU replacement

Page 22: Os Problems

Solution 13 …cont’d(d)

Page 23: Os Problems

Problem 14

Show frame allocation for each of the following replacement policies.

g. With a memory access time of 50 ns what is the EAT in each of the above cases?

f. What are number of frames allocated to the process with a window size of 4, and compute the number of page faults while using the working set model policy.

Page 24: Os Problems

Solution 14Solution to sections (a), (b), (c), and (d) can be carried out as shown in Solution 13. Solution for section (f) is given below.

EAT = 7/13(50ns + 50ns) + 6/13(50ns + Disk swap + 50ns + 50ns)

Page 25: Os Problems

Problem 15

Page 26: Os Problems

Solution 15

Page 27: Os Problems

Solution 15 …cont’d

Page 28: Os Problems

Problem 16For a paging system for which PTE size is 32 bytes, page size 1K, and considering a process of size 5MB, compare the page table sizes in terms of number of PTEs, memory needed for the page tables, EAT and TAT using the following paging schemes.• Two level• Three levelAssume memory access time to be 20ns and disk access

time to be 10ms.Assume that the process pages are referenced such that

each of its page is referenced only once. However, the order of reference is not known.

Page 29: Os Problems

Problem 17 and 18• Considering an TLB of 512 bytes, physical memory of

1MB, PTE of 32 bytes, page size 1K, and a process size of 750K, compute memory needed for the page tables, EAT and TAT for a four-level paging scheme. Assume memory access time to be 10ns and disk access time to be 10ms. Assume that only half of the process pages are referenced twice arbitrarily.

• Compare the performance using the above memory characteristics for page sizes of 2K and 4K respectively and a process of size 500K.