Homework 13

Virtual Memory

1. A machine has a 32-bit byte-addressable virtual address space. The page size is 4 KB. How many pages of virtual address space exist?

2. A virtual memory has a page size of 1024 words, eight virtual pages, and four physical page frames. The page table is as follows:

Virtual page Page frame
0 3
1 1
2 not in main memory
3 not in main memory
4 2
5 not in main memory
6 0
7 not in main memory

a. Make a list of all virtual addresses that will cause page faults.
b. What are the physical addresses for 0, 3728, 1023, 1024, 1025, 7800, and 4096?

3. A computer has 16 pages of virtual address space but only four page frames. Initially, the memory is empty. A program references the virtual pages in the order 0, 7, 2, 7, 5, 8, 9, 2, 4

a. Which references cause a page fault with LRU?
b. Which references cause a page fault with FIFO?

4. A program on the Core i7 references local segment 10 with offset 8000. The BASE field of LDT segment 10 contains 10000. Which page directory entry does the Core i7 use? What is the page number? What is the offset?

5. Compare internal fragmentation to external fragmentation. What can be done to alleviate each?

6. Supermarkets are constantly faced with a problem similar to page replacement in virtual memory systems. They have a fixed amount of shelf space to display an ever- increasing number of products. If an important new product comes along, say, 100% efficient dog food, some existing product must be dropped from the inventory to make room for it. The obvious replacement algorithms are LRU and FIFO. Which of these would you prefer?

*

Topic revision: r3 - 2014-11-27 - JimSkon
 
This site is powered by the TWiki collaboration platformCopyright &© by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback