X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fthreads%2Finit.c;h=cf7a896222a5e2370b8f03827fda4fbaf9c8d4c1;hb=e6e58461d3040e76e501a9dc9d4b38c5c825dc9c;hp=1135ae7ccecc79ad1593671c7e3bbd906c31caa1;hpb=2fb834e1f01b669851eee9e7a5598bc12df1e5ff;p=pintos-anon diff --git a/src/threads/init.c b/src/threads/init.c index 1135ae7..cf7a896 100644 --- a/src/threads/init.c +++ b/src/threads/init.c @@ -190,6 +190,10 @@ paging_init (void) pt[pte_idx] = pte_create_kernel (vaddr, true); } + /* Store the physical address of the page directory into CR3 + aka PDBR (page directory base register). This activates our + new page tables immediately. See [IA32-v2a] "MOV--Move + to/from Control Registers" and [IA32-v3] 3.7.5. */ asm volatile ("movl %0,%%cr3" :: "r" (vtop (base_page_dir))); }