X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fthreads%2Finit.c;h=855afa0340fcb66788aa03a00cc70666b17bbbae;hb=58d6d5184b1eca54fd6f1d30587a30f39fe72466;hp=0d9c69984603eaaa6a69bf4fac58c4af9e54ce54;hpb=de6fa5350d2ddf2d36bab80236cf09d8127cde6b;p=pintos-anon diff --git a/src/threads/init.c b/src/threads/init.c index 0d9c699..855afa0 100644 --- a/src/threads/init.c +++ b/src/threads/init.c @@ -112,8 +112,13 @@ main (void) /* Run a user program. */ if (initial_program != NULL) { + tid_t tid; printf ("\nExecuting '%s':\n", initial_program); - process_execute (initial_program); + tid = process_execute (initial_program); +#ifdef THREAD_JOIN_IMPLEMENTED + if (tid != TID_ERROR) + thread_join (tid); +#endif } #else test (); @@ -278,6 +283,8 @@ power_off (void) #endif printf ("Powering off...\n"); + serial_flush (); + for (p = s; *p != '\0'; p++) outb (0x8900, *p); for (;;);