lec10-caches-tlbsx4

lec10-caches-tlbsx4 - Page 1 CS162 Operating Systems and...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Page 1 CS162 Operating Systems and Systems Programming Lecture 10 Caches and TLBs February 22, 2011 Anthony D. Joseph and Ion Stoica http://inst.eecs.berkeley.edu/~cs162 Lec 10.2 2/22 Anthony D. Joseph and Ion Stoica CS162 ©UCB Fall 2012 • Segmentation: • Paging • Note: paging is equivalent to segmentation when a segment maps onto a page! – The offset of the ¡rst address in a page is 0 Recap: Segmentation vs. Paging Offset Seg # Virtual Address Base0 Limit0 V Base1 Limit1 V Base2 Limit2 V Base3 Limit3 N Base2 Limit2 V + Physical Address offset Offset Virtual Page # Virtual Address page #0 page #2 page #3 V,R page #1 V,R V,R,W V,R,W page #2 V,R Physical Address Offset Physical Page # Lec 10.3 2/22 Anthony D. Joseph and Ion Stoica CS162 ©UCB Fall 2012 Recap: Address Segmentation 1111 1111 heap code data Virtual memory view Physical memory view data heap 00 00 0000 01 00 0000 (0x40) 10 00 0000 (0x80) 11 00 0000 (0xC0) seg # offset code 0000 0000 0001 0000 (0x10) 0101 0000 (0x50) 0111 0000 (0x70) 1110 0000 (0xE0) Seg # base limit 11 1011 0000 1 0000 10 0111 0000 1 1000 01 0101 0000 10 0000 00 0001 0000 10 0000 stack 11 11 0000 (0xF0) stack 1011 0000 + 11 0000--------------- 1110 0000 Lec 10.4 2/22 Anthony D. Joseph and Ion Stoica CS162 ©UCB Fall 2012 Recap: Address Segmentation 1111 1111 stack heap code data Virtual memory view Physical memory view data heap stack 00 00 0000 01 00 0000 10 00 0000 11 00 0000 11 10 0000 seg # offset code 0000 0000 0001 0000 0101 0000 0111 0000 1110 0000 Seg # base limit 11 1011 0000 1 0000 10 0111 0000 1 1000 01 0101 0000 10 0000 00 0001 0000 10 0000 What happens if stack grows to 1110 0000? Page 2 Lec 10.5 2/22 Anthony D. Joseph and Ion Stoica CS162 ©UCB Fall 2012 Recap: Address Segmentation 1111 1111 stack heap code data Virtual memory view Physical memory view data heap stack 00 00 0000 01 00 0000 10 00 0000 11 00 0000 11 10 0000 seg # offset code 0000 0000 0001 0000 0101 0000 0111 0000 1110 0000 Seg # base limit 11 1011 0000 1 0000 10 0111 0000 1 1000 01 0101 0000 10 0000 00 0001 0000 10 0000 No room to grow!! Buffer over¡ow error or resize segment and move segments around to make room Lec 10.6 2/22 Anthony D. Joseph and Ion Stoica CS162 ©UCB Fall 2012 Recap: Paging 1111 1 111 stack heap code data Virtual memory view 0000 0 000 0100 0 000 1000 0 000 1100 0 000 1111 0 000 page # offset Physical memory view data code heap stack 0000 0000 0001 0000 0101 000 0111 000 1110 0000 11111 11101 11110 11100 11101 null 11100 null 11011 null 11010 null 11001 null 11000 null 10111 null 10110 null 10101 null 10100 null 10011 null 10010 10000 10001 01111 10000 01110 01111 null 01110 null 01101 null 01100 null 01011 01101 01010 01100 01001 01011 01000 01010 00111 null 00110 null 00101 null 00100 null 00011 00101 00010 00100 00001 00011 00000 00010 Page Table 1 1 1 1 1 1 1 Lec 10.7 2/22 Anthony D. Joseph and Ion Stoica CS162 ©UCB Fall 2012 Recap: Paging 1111 1111 stack heap code data Virtual memory view 0000 0 000 0100 0...
View Full Document

{[ snackBarMessage ]}

Page1 / 12

lec10-caches-tlbsx4 - Page 1 CS162 Operating Systems and...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online