Presentation is loading. Please wait.

Presentation is loading. Please wait.

03/24/2004CSCI 315 Operating Systems Design1 Memory Management and Virtual Memory (Problem session)

Similar presentations


Presentation on theme: "03/24/2004CSCI 315 Operating Systems Design1 Memory Management and Virtual Memory (Problem session)"— Presentation transcript:

1 03/24/2004CSCI 315 Operating Systems Design1 Memory Management and Virtual Memory (Problem session)

2 03/24/2004CSCI 315 Operating Systems Design2 Problem 1 Given five memory partitions of 100KB, 500KB, 200KB, 300KB, and 600KB (in this order), how would each of the first-fit, best-fit, and worst-fit algorithms place processes of 212KB, 417KB, 112KB, and 426KB (in this order)? Which algorithm makes the most efficient use of memory?

3 03/24/2004CSCI 315 Operating Systems Design3 Problem 2 Explain the address translation scheme in this figure. What do the fields p and d in a logical address represent? What do f and d represent in a physical address?

4 03/24/2004CSCI 315 Operating Systems Design4 Problem 3 What is the function of a TLB (translation lookaside buffer) in the translation of logical to physical address? How big should the TLB be?

5 03/24/2004CSCI 315 Operating Systems Design5 Problem 4 Consider a logical address on a 32-bit machine with 4K page size. –How many bits are used for page number? –How many entries does the page table have? –Does the whole page table fit within 4K? –How many bits are used for page offset? Explain how a hierarchical paging scheme with logical addresses structure as in the picture below would work. How many bits of the logical address should be reserved for the page offset d? (Assume 32-bit address and page size 4K.) page number page offset p1p1 p2p2 d

6 03/24/2004CSCI 315 Operating Systems Design6 Problem 5 Consider a paging scheme with the page table stored in memory. –If a direct memory reference takes 80 ns, how long does a paged memory reference take in the best case? –If we add a TLB, and 75% of all page-table references are found in the TLB, what is the effective access time? (Assume that finding a page- table entry in the TLB takes 10ns, if the entry is there, and 100ns, if the entry is not there.)

7 03/24/2004CSCI 315 Operating Systems Design7 Problem 6 i free frame operating system 1 6 3 2 4 5 physical memory disk page table Explain the sequence of operations in a virtual memory system that starts with (1), a reference to a page that is not currently in physical memory. running process

8 03/24/2004CSCI 315 Operating Systems Design8 Problem 7 Which of the following programming techniques and structures are “good” for a demand paged environment? Which are “bad”? Explain your answers. a.Stack b.Hashed symbol table c.Sequential search d.Binary search e.Pure code (that is, no data) f.Linear array (vector) operations


Download ppt "03/24/2004CSCI 315 Operating Systems Design1 Memory Management and Virtual Memory (Problem session)"

Similar presentations


Ads by Google