projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update docs.
[pintos-anon]
/
src
/
threads
/
init.c
diff --git
a/src/threads/init.c
b/src/threads/init.c
index 155ccae6adf1f2b50d2450bb6739a6b183c28498..1afa8653dc6c828f8ab79ad3c500ce69eaee5cc0 100644
(file)
--- a/
src/threads/init.c
+++ b/
src/threads/init.c
@@
-21,6
+21,7
@@
#include "threads/test.h"
#include "threads/thread.h"
#ifdef USERPROG
#include "threads/test.h"
#include "threads/thread.h"
#ifdef USERPROG
+#include "userprog/process.h"
#include "userprog/exception.h"
#include "userprog/gdt.h"
#include "userprog/syscall.h"
#include "userprog/exception.h"
#include "userprog/gdt.h"
#include "userprog/syscall.h"
@@
-111,8
+112,13
@@
main (void)
/* Run a user program. */
if (initial_program != NULL)
{
/* Run a user program. */
if (initial_program != NULL)
{
+ tid_t tid;
printf ("\nExecuting '%s':\n", initial_program);
printf ("\nExecuting '%s':\n", initial_program);
- thread_execute (initial_program);
+ tid = process_execute (initial_program);
+#ifdef THREAD_JOIN_IMPLEMENTED
+ if (tid != TID_ERROR)
+ thread_join (tid);
+#endif
}
#else
test ();
}
#else
test ();
@@
-157,7
+163,7
@@
paging_init (void)
uint32_t *pd, *pt;
size_t page;
uint32_t *pd, *pt;
size_t page;
- pd = base_page_dir = palloc_get (PAL_ASSERT | PAL_ZERO);
+ pd = base_page_dir = palloc_get
_page
(PAL_ASSERT | PAL_ZERO);
pt = NULL;
for (page = 0; page < ram_pages; page++)
{
pt = NULL;
for (page = 0; page < ram_pages; page++)
{
@@
-168,7
+174,7
@@
paging_init (void)
if (pd[pde_idx] == 0)
{
if (pd[pde_idx] == 0)
{
- pt = palloc_get (PAL_ASSERT | PAL_ZERO);
+ pt = palloc_get
_page
(PAL_ASSERT | PAL_ZERO);
pd[pde_idx] = pde_create (pt);
}
pd[pde_idx] = pde_create (pt);
}
@@
-277,6
+283,8
@@
power_off (void)
#endif
printf ("Powering off...\n");
#endif
printf ("Powering off...\n");
+ serial_flush ();
+
for (p = s; *p != '\0'; p++)
outb (0x8900, *p);
for (;;);
for (p = s; *p != '\0'; p++)
outb (0x8900, *p);
for (;;);