X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fthreads%2Finit.c;h=b4b1057eb750fd290d7a02adbc752c073db7a210;hb=715ca79351a7f4cd3bed471e1cae934f24b5ed09;hp=1135ae7ccecc79ad1593671c7e3bbd906c31caa1;hpb=a40483c415f3b61066ddcc4890c0aedfca723f26;p=pintos-anon diff --git a/src/threads/init.c b/src/threads/init.c index 1135ae7..b4b1057 100644 --- a/src/threads/init.c +++ b/src/threads/init.c @@ -123,10 +123,8 @@ main (void) tid_t tid; printf ("\nExecuting '%s':\n", initial_program); tid = process_execute (initial_program); -#ifdef THREAD_JOIN_IMPLEMENTED if (tid != TID_ERROR) thread_join (tid); -#endif } #else /* Run the compiled-in test function. */ @@ -190,7 +188,11 @@ paging_init (void) pt[pte_idx] = pte_create_kernel (vaddr, true); } - asm volatile ("movl %0,%%cr3" :: "r" (vtop (base_page_dir))); + /* 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 ("mov %%cr3, %0" :: "r" (vtop (base_page_dir))); } /* Parses the command line. */