Add temporary fixes to process_wait and setup stack, w/ E

This commit is contained in:
sBubshait
2024-11-05 23:28:17 +00:00
parent 02fff62ca2
commit 5aac37d167

View File

@@ -14,6 +14,7 @@
#include "threads/flags.h" #include "threads/flags.h"
#include "threads/init.h" #include "threads/init.h"
#include "threads/interrupt.h" #include "threads/interrupt.h"
#include "threads/synch.h"
#include "threads/palloc.h" #include "threads/palloc.h"
#include "threads/thread.h" #include "threads/thread.h"
#include "threads/vaddr.h" #include "threads/vaddr.h"
@@ -88,7 +89,8 @@ start_process (void *file_name_)
int int
process_wait (tid_t child_tid UNUSED) process_wait (tid_t child_tid UNUSED)
{ {
return -1; for (;;)
barrier ();
} }
/* Free the current process's resources. */ /* Free the current process's resources. */
@@ -451,7 +453,7 @@ setup_stack (void **esp)
{ {
success = install_page (((uint8_t *) PHYS_BASE) - PGSIZE, kpage, true); success = install_page (((uint8_t *) PHYS_BASE) - PGSIZE, kpage, true);
if (success) if (success)
*esp = PHYS_BASE; *esp = PHYS_BASE - 12;
else else
palloc_free_page (kpage); palloc_free_page (kpage);
} }