From: Ben Pfaff Date: Sat, 11 Sep 2004 23:35:30 +0000 (+0000) Subject: Update initialization order. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8febc54c8a684bdd9da5aae21dfe76785f87676;p=pintos-anon Update initialization order. --- diff --git a/src/threads/init.c b/src/threads/init.c index 589a23e..4859d42 100644 --- a/src/threads/init.c +++ b/src/threads/init.c @@ -1,4 +1,5 @@ #include "threads/init.h" +#include #include #include #include @@ -53,10 +54,12 @@ 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 ("Pintos booting with %'d kB RAM...\n", ram_pages * 4); @@ -65,7 +68,6 @@ main (void) argv_init (); /* Initialize memory system, segments, paging. */ - thread_init (); palloc_init (); paging_init (); #ifdef USERPROG @@ -74,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. */