Mon, 3 October 2016, 00:40
My students, For those of you who were at the review session earlier today, you recall a student asked me how to find the SBR on problem 3 of the Spring 2015 Exam, and I was reluctant to take the time to work through the problem, fearing it would chew up most of the review session. On sober reflection, I wish I had since it is not an easy concept and probably worth spending a lot more time on it than we did. In light of this, I asked Siavash who will handle the review session tomorrow to work out the entire problem if the class wants it. Whether he does is up to you! In the meantime, I promised to lay out carefully for the student asking the question how to get the SBR. ...which I have done. I decided to share this with the rest of you, including some additional stuff which I hope will prove helpful in solving other problems of this kind. So, here goes: First, some general stuff that I think is useful to keep in mind as you work through the entries in any table you may be asked to complete. To obtain the value for A, I need to make three physical accesses. (The same is true for obtaining B and C.) The first access is to System PHYSICAL space to get the PTE of the page of System space containing the VA of the PTE of the page containing A. The second is to get the PTE of the page containing A. The third is to get the value for A. From the program, we know we have three user virtual addresses. From the table we know A is x5400 and C is x7618. Thus A is on page x54 and C is on page x76. Note that if the TLB were as shown (requiring seven accesses) it does not contain entries for page x54 or page x76. But since only seven accesses to memory would be needed, B must be on a page that would be a hit in the TLB shown. Note that the three entries in the TLB indicate pages mapped to frames x01, x06, and x04 in physical memory. Note further that the physical address of B is x0646. Therefore, the virtual address of B is x2346. B is on page x23 of user space. The virtual address of the PTE for page x23 is given: it is x80C2. We know that this address is formed by adding the PBR to the offset (2 times x23). Therefore PBR + x46 = x80C2. Therefore, PBR = x807C. Next, we note that the VA of A is x5400, which means A is on page x54. The PTE for A is at address PBR + (2 times x54), i.e., x807C + xA8 = x8124. This is on virtual page 1 of system space. We know the physical address of the PTE of page 1 of system space is x1AA8. Therefore, the PA of the PTE of page 0 of system space is x1AA6, which is the SBR. Good luck on the exam. Yale Patt