X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fthreads%2Finit.c;h=9ab04476741e4f4580afc15ed454e71e34a237e6;hb=b6b1e6db07a20a0b3025c2ae62a58e80c1af841b;hp=35ce92a2e255c7b68865931877dba832c9ff048a;hpb=b2a1e970fa78d8b4c31239ff2ac9ef2b4bab09a7;p=pintos-anon diff --git a/src/threads/init.c b/src/threads/init.c index 35ce92a..9ab0447 100644 --- a/src/threads/init.c +++ b/src/threads/init.c @@ -1,4 +1,5 @@ #include "threads/init.h" +#include #include #include #include @@ -18,6 +19,7 @@ #include "threads/mmu.h" #include "threads/paging.h" #include "threads/palloc.h" +#include "threads/test.h" #include "threads/thread.h" #ifdef USERPROG #include "userprog/exception.h" @@ -52,19 +54,20 @@ int main (void) NO_RETURN; int main (void) { - /* Needed by printf(), so initialize them very early. */ + /* Initialize everything needed for printf() first. */ ram_init (); + thread_init (); vga_init (); serial_init_poll (); + console_init (); /* Greet user. */ - printf ("Booting cnachos86 with %'d kB RAM...\n", ram_pages * 4); + printf ("Pintos booting with %'d kB RAM...\n", ram_pages * (PGSIZE / 1024)); /* Parse command line. */ argv_init (); /* Initialize memory system, segments, paging. */ - thread_init (); palloc_init (); paging_init (); #ifdef USERPROG @@ -73,7 +76,7 @@ main (void) #endif malloc_init (); - /* Set random seed if not already done. */ + /* Set random seed if argv_init() didn't. */ random_init (0); /* Initialize interrupt handlers. */ @@ -105,6 +108,8 @@ main (void) printf ("\nExecuting '%s':\n", initial_program); thread_execute (initial_program); } +#else + test (); #endif /* Terminate this thread. */