X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fthreads%2Finit.c;h=b4b1057eb750fd290d7a02adbc752c073db7a210;hb=6070611faac84bdf95c4405b3970c6928202f26b;hp=741f0e42e4339b8824f16646aae237de0f365dc0;hpb=5f1b986185717577aac1922544cb3a7b1a56b632;p=pintos-anon diff --git a/src/threads/init.c b/src/threads/init.c index 741f0e4..b4b1057 100644 --- a/src/threads/init.c +++ b/src/threads/init.c @@ -105,6 +105,7 @@ main (void) /* Start thread scheduler and enable interrupts. */ thread_start (); serial_init_queue (); + timer_calibrate (); #ifdef FILESYS /* Initialize filesystem. */ @@ -122,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. */ @@ -189,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. */