projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update comments.
[pintos-anon]
/
src
/
threads
/
init.c
diff --git
a/src/threads/init.c
b/src/threads/init.c
index 1025172727e1682bc0a350c9dc52630986fa621f..1afa8653dc6c828f8ab79ad3c500ce69eaee5cc0 100644
(file)
--- a/
src/threads/init.c
+++ b/
src/threads/init.c
@@
-21,7
+21,7
@@
#include "threads/test.h"
#include "threads/thread.h"
#ifdef USERPROG
#include "threads/test.h"
#include "threads/thread.h"
#ifdef USERPROG
-#include "userprog/
addrspace
.h"
+#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"
@@
-112,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);
- addrspace_execute (initial_program);
+ tid = process_execute (initial_program);
+#ifdef THREAD_JOIN_IMPLEMENTED
+ if (tid != TID_ERROR)
+ thread_join (tid);
+#endif
}
#else
test ();
}
#else
test ();
@@
-158,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++)
{
@@
-169,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);
}
@@
-278,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 (;;);