![]() ![]() CPU caches Address Translation Translation Lookaside Buffer (TLB) Reduce these additional accesses -> Speed up! 0x20 0x3ff Page Table Entry Addr PT 0x48 0x10000 0x49 0x11000 0x4a 0x50000 Mem access #3 (required) PDE Mem access #2Īccess example movl 0x, %eax 3 memory access per each memory access – SLOW! 2 additional accesses due to page table lookup mov instruction – takes 1 cycle memory access – takes ~200 cycles… 200 (access the address) + 1 (mov) * 2 (page table…) = 601 cycles. Page number (20-bits) 0x10000 Offset (12-bits) 0x000 Page Directory Entry Addr PT. Vritual Page number (20-bits) 0x12345 Offset (12-bits) 0圆78 Page Table Lookup Access example movl 0x, %eax (load 4-byte data from the address 0x to %eax) Memory access sequence Virtual page number: top 20bits, PGNUM = (0x > 12) = 0x12345 Page Directory Index: top 10 bits, PDX = ( PGNUM > 10 )& 0x3ff = 0x48 Page Table Index: next 10 bits, PTX = PGNUM & 0x3ff = 0x345 Page Table Entry: PTE = CR3 – 2 memory dereferences Physical address = Physical Page Number + OFFSET = (PTE & 0xfffff000) + (0x & 0xfff) eax = PHY_ADDR – 1 memory dereferences (required) Physical Page number (20-bits) 0x10000 Offset (12-bits) 0圆78ģ1 12 Virtual Physical 0x 0x10000 0x 0x11000 0x804a000 0x50000 0x Page number (20-bits) 0x08048 Offset (12-bits) 0x000 Mem access #1 CR3 Directory Index (10-bits) 0x20 Table index (10-bits) 0x48 31 22 12 Phy. Directory Index (10-bits) 0x48 Table index (10-bits) 0x345 Lower 10 bits 31 22 12 Upper 10 bitsĥ Page Table Lookup Access example Memory access sequence ![]() Translation Segmentation Access GDT Base,Limit Translate to Linear Addr Paging CR3 – points to page directory Higher 20 bits of the address Page number Highest 10 bits: Page Directory Index (PDX) CR3 = pgdir, pgdir Next 10 bits: Page Table Index (PTX) pgdir = pgtbl Pgtlb = PTE Page table Entry Highest 20 bits: Physical Page Number Lower 12 bits: Offset CR3 = PTE! This is the Virtual-physical Translation layer…ģ1 12 Virtual Physical 0x 0x10000 0x 0x11000 0x804a000 0x50000 0x Page number (20-bits) 0x08048 Offset (12-bits) 0x000 CR3 Directory Index (10-bits) 0x20 Table index (10-bits) 0x48 31 22 12 Phy. 1 CS 444/544 Operating Systems II Virtual Memory TranslationĢ Recap: CR3 NOT This is the Segmentation a virtual to physical
0 Comments
Leave a Reply. |