X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fthreads%2Finit.c;h=35ce92a2e255c7b68865931877dba832c9ff048a;hb=b2a1e970fa78d8b4c31239ff2ac9ef2b4bab09a7;hp=b099d02dd33ccbb8fb88889b821cde91ab772ad5;hpb=828d300fd2039b686b69244c2bd6f8b87645086d;p=pintos-anon diff --git a/src/threads/init.c b/src/threads/init.c index b099d02..35ce92a 100644 --- a/src/threads/init.c +++ b/src/threads/init.c @@ -1,31 +1,34 @@ -#include "init.h" -#include -#include +#include "threads/init.h" +#include #include -#include "debug.h" -#include "interrupt.h" -#include "io.h" -#include "kbd.h" -#include "lib.h" -#include "loader.h" -#include "malloc.h" -#include "mmu.h" -#include "paging.h" -#include "palloc.h" -#include "random.h" -#include "serial.h" -#include "thread.h" -#include "timer.h" -#include "vga.h" +#include +#include +#include +#include +#include +#include +#include "devices/kbd.h" +#include "devices/serial.h" +#include "devices/timer.h" +#include "devices/vga.h" +#include "threads/interrupt.h" +#include "threads/io.h" +#include "threads/loader.h" +#include "threads/malloc.h" +#include "threads/mmu.h" +#include "threads/paging.h" +#include "threads/palloc.h" +#include "threads/thread.h" #ifdef USERPROG -#include "exception.h" -#include "gdt.h" -#include "tss.h" +#include "userprog/exception.h" +#include "userprog/gdt.h" +#include "userprog/syscall.h" +#include "userprog/tss.h" #endif #ifdef FILESYS -#include "filesys.h" -#include "disk.h" -#include "fsutil.h" +#include "devices/disk.h" +#include "filesys/filesys.h" +#include "filesys/fsutil.h" #endif /* Amount of physical memory, in 4 kB pages. */ @@ -49,13 +52,13 @@ int main (void) NO_RETURN; int main (void) { - /* Needed by printk(), so initialize them very early. */ + /* Needed by printf(), so initialize them very early. */ ram_init (); vga_init (); - serial_init (); + serial_init_poll (); /* Greet user. */ - printk ("Booting cnachos86 with %'d kB RAM...\n", ram_pages * 4); + printf ("Booting cnachos86 with %'d kB RAM...\n", ram_pages * 4); /* Parse command line. */ argv_init (); @@ -79,10 +82,12 @@ main (void) kbd_init (); #ifdef USERPROG exception_init (); + syscall_init (); #endif /* Start thread scheduler and enable interrupts. */ thread_start (); + serial_init_queue (); #ifdef FILESYS /* Initialize filesystem. */ @@ -91,13 +96,13 @@ main (void) fsutil_run (); #endif - printk ("Boot complete.\n"); - + printf ("Boot complete.\n"); + #ifdef USERPROG /* Run a user program. */ if (initial_program != NULL) { - printk ("\nExecuting '%s':\n", initial_program); + printf ("\nExecuting '%s':\n", initial_program); thread_execute (initial_program); } #endif @@ -171,7 +176,7 @@ argv_init (void) #endif else if (!strcmp (argv[i], "-u")) { - printk ( + printf ( "Kernel options:\n" " -rs SEED Seed random seed to SEED.\n" " -d CLASS[,...] Enable the given classes of debug messages.\n"