Paging . Read OSTEP chapter 18 and answer the following questions by editing hw7
ID: 3728132 • Letter: P
Question
Paging. Read OSTEP chapter 18 and answer the following questions by editing hw7.txt:
1) Suppose we have a 16 bit virtual address space with 64 pages. A virtual address then has _____ bits for the virtual page number and _____ bits for the offset.
2) In address translation with paging, how is the offset of the virtual address modified? a) according to the page table, b) it is zeroed, c) it is not changed.
3) True or false: Fragmentation can occur with paging if the page tables are frequently modified.
4) Suppose we have a 32 bit virtual address space with pages that are 4 KB in size. How many entries will there be in the page table?
5) Yes or no: Can permissions be assigned to different pages in a virtual address space, for example to prohibit writing to certain pages?
Reading: Translation Lookaside Buffer. Read Chapter 19 of the OSTEP text and answer the following two questions:
1) What’s purpose of line 11 in Figure 19.1? Is it to a) compute the physical frame number, b) calculate the page size, or c) find the address of a page table entry? _________
2) Suppose we had a picture just like Figure 19.2, but each page had 32 bytes instead of 16 bytes, while the size of array ‘a’ stayed the same (and still started on byte 4 of virtual page 6). What would the TLB hit rate then be? __________
3) Which is normally faster: a) finding the PFN for a VPN in the TLB, or b) finding the PFN for a VPN in the page table? _________
4) (Yes/No) Does every process have its own translation lookaside buffer? ________
5) What is the purpose of a translation lookaside buffer? a) to speed up virtual address translation in systems with paging, b) to allow page tables to be shared between processes, or c) to store page information that cannot fit into memory? __________
Explanation / Answer
ANSWERS:
answer for 1;
6bits,10 bits
beacuase for the pagenumber it would be twenty six(26)=64 ,hence it is six(6) bits for the virtual page number,
then for the case of offset it is 16-6
=10 bits
hence the answer is 10 bits for offset
answer for 2:
2)
a)OFFSET+SIZE ,according to the page table it is taken
b) it is zeroed
c) it is not changed
THE ABOVE WILL be see if it is beyond the acess area of not
3)since there are lot of swap in and SWAP OUT ,it is TRUE
4)
The Page size would be = 22 x 210 = . 212
Number of enteries will be = 232- 10
= 222 is the numer of enteries
There fore the required page size and number of entries are determined
5)
YES,it is true we can assign the permission to different pages in a virtual address space
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.