Move problem 1-2 (join) into project 2 as the "wait" system call.
[pintos-anon] / src / threads / init.c
index cf7a896222a5e2370b8f03827fda4fbaf9c8d4c1..f6a01dc67080688e44d3f45759c73745dcc75331 100644 (file)
@@ -120,13 +120,8 @@ main (void)
   /* 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. */
@@ -194,7 +189,7 @@ paging_init (void)
      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)));
+  asm volatile ("mov %%cr3, %0" :: "r" (vtop (base_page_dir)));
 }
 
 /* Parses the command line. */