projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a little demo/test code for the `threads' project.
[pintos-anon]
/
src
/
threads
/
init.c
diff --git
a/src/threads/init.c
b/src/threads/init.c
index 2684d17d5023621594e89bc35a2e647da20178a1..589a23efc5b0ec779068052dcbbaaa136f036200 100644
(file)
--- a/
src/threads/init.c
+++ b/
src/threads/init.c
@@
-18,6
+18,7
@@
#include "threads/mmu.h"
#include "threads/paging.h"
#include "threads/palloc.h"
#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"
#include "threads/thread.h"
#ifdef USERPROG
#include "userprog/exception.h"
@@
-55,10
+56,10
@@
main (void)
/* Needed by printf(), so initialize them very early. */
ram_init ();
vga_init ();
/* Needed by printf(), so initialize them very early. */
ram_init ();
vga_init ();
- serial_init
(1
);
+ serial_init
_poll (
);
/* Greet user. */
/* Greet user. */
- printf ("
Booting cnachos86
with %'d kB RAM...\n", ram_pages * 4);
+ printf ("
Pintos booting
with %'d kB RAM...\n", ram_pages * 4);
/* Parse command line. */
argv_init ();
/* Parse command line. */
argv_init ();
@@
-87,7
+88,7
@@
main (void)
/* Start thread scheduler and enable interrupts. */
thread_start ();
/* Start thread scheduler and enable interrupts. */
thread_start ();
- serial_init
(2
);
+ serial_init
_queue (
);
#ifdef FILESYS
/* Initialize filesystem. */
#ifdef FILESYS
/* Initialize filesystem. */
@@
-98,9
+99,6
@@
main (void)
printf ("Boot complete.\n");
printf ("Boot complete.\n");
- for (;;)
- putchar (serial_getc ());
-
#ifdef USERPROG
/* Run a user program. */
if (initial_program != NULL)
#ifdef USERPROG
/* Run a user program. */
if (initial_program != NULL)
@@
-108,6
+106,8
@@
main (void)
printf ("\nExecuting '%s':\n", initial_program);
thread_execute (initial_program);
}
printf ("\nExecuting '%s':\n", initial_program);
thread_execute (initial_program);
}
+#else
+ test ();
#endif
/* Terminate this thread. */
#endif
/* Terminate this thread. */