• A system has 32-bit virtual addresses, 512 MB of physical memory and 1 MB page
ID: 3708860 • Letter: #
Question
• A system has 32-bit virtual addresses, 512 MB of physical memory and 1 MB pages. The operating system has the following page table for a process (only the first eight entries are shown). Assume that all physical memory is allocated and in use. VPN (binary) | Valid Bit | PPN (binary) or Disk Address 0000 0000 0000 0 1010 0011 0000 0000 0001 sector 94... 0000 0000 0010 0 1110 0000 0000 0000 0011 sector 326... 0000 0000 0100 sector 38.... 0000 0000 0101 0 0011 1100 0000 0000 0110 0 1001 0111 0000 0000 0111 sector 27... The following virtual memory addresses are accessed (read from) in the order presented. Show the physical addresses each one corresponds to. There will be no changes to the page table, i.e., no page faults for the given addresses. OOOOH - 0000 0000 0110 0000 0000 0000 0000 0000 - 0000 0000 0000 0010 0011 0100 0101 0110 - 0000 0000 0101 1010 0000 1111 0000 1010 - 0000 0000 0010 0110 1010 0010 1100 1010 – List at least one virtual memory address access that will result in a page fault. Explain why accessing that address results in a page fault, and what happens on the page fault. Show the effects of the page fault in the page table. |Explanation / Answer
page size = 1MB = 220 B
Therefore 20 bits will be there for page offset.
Remaining bits i.e 12 bits will be for page number.
Main memory size = 512 MB = 229 B
Therefore 29 bits physical address
1) 0000 0000 0110 0000 0000 0000 0000 0000
page number = 0000 0000 0110
corresponding frame number from page table = 0 1001 0111
Therefore physical address = 0 1001 0111 0000 0000 0000 0000 0000
2) 0000 0000 0000 0010 0011 0100 0101 0110
page number = 0000 0000 0000
corresponding frame number from page table = 0 1010 0011
Therefore physical address = 0 1010 0011 0010 0011 0100 0101 0110
3) 0000 0000 0101 1010 0000 1111 0000 1010
page number = 0000 0000 0101
corresponding frame number from page table = 0 0011 1100
Therefore physical address = 0 0011 1100 1010 0000 1111 0000 1010
4) 0000 0000 0010 0110 1010 0010 1100 1010
page number = 0000 0000 0010
corresponding frame number from page table = 0 1110 0000
Therefore physical address = 0 1110 0000 0110 1010 0010 1100 1010
Virtual memory address which will result in page fault is:
0000 0000 0001 0110 1010 0010 1100 1010
This will be page fault because her page number = 0000 0000 0001
In this page number in the page table the valid bit is zero and the corresponding page is not in any frame of the physical memory so it is page fault.
Now because of this the corresponding page will be brought from disk to a particular frame in the physical memory and the page table will be updated to that frame number for this corresponding page and valid bit will be made 1.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.