/* Start thread scheduler and enable interrupts. */
thread_start ();
serial_init_queue ();
+ timer_calibrate ();
#ifdef FILESYS
/* Initialize filesystem. */
/* Run a user program. */
if (initial_program != NULL)
{
- 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
+ process_wait (process_execute (initial_program));
}
#else
/* Run the compiled-in test function. */
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. */
for (i = 0; i < argc; i++)
if (!strcmp (argv[i], "-rs"))
random_init (atoi (argv[++i]));
- else if (!strcmp (argv[i], "-d"))
- debug_enable (argv[++i]);
else if (!strcmp (argv[i], "-q"))
power_off_when_done = true;
#ifdef USERPROG
{
printf (
"Kernel options:\n"
- " -rs SEED Seed random seed to SEED.\n"
- " -d CLASS[,...] Enable the given classes of debug messages.\n"
+ " -rs SEED Set random seed to SEED.\n"
#ifdef USERPROG
" -ex 'PROG [ARG...]' Run PROG, passing the optional arguments.\n"
" -ul USER_MAX Limit user memory to USER_MAX pages.\n"