Add support for some basic system calls and args handling correctly. #29

Merged
sb3923 merged 49 commits from system-calls into master 2024-11-07 19:36:30 +00:00
5 changed files with 347 additions and 7 deletions
Showing only changes of commit 39018419cd - Show all commits

View File

@@ -217,6 +217,8 @@ process_exit (void)
struct thread *cur = thread_current (); struct thread *cur = thread_current ();
uint32_t *pd; uint32_t *pd;
printf ("%s: exit(%d)\n", cur->name, cur->exit_status);
/* Destroy the current process's page directory and switch back /* Destroy the current process's page directory and switch back
to the kernel-only page directory. */ to the kernel-only page directory. */
pd = cur->pagedir; pd = cur->pagedir;

View File

@@ -105,7 +105,6 @@ syscall_exit (int status)
{ {
/* Sets exit_status of the thread to status. thread_exit () will call /* Sets exit_status of the thread to status. thread_exit () will call
process_exit () if user programs are allowed. */ process_exit () if user programs are allowed. */
printf ("%s: exit(%d)\n", thread_current()->name, status);
thread_current ()->exit_status = status; thread_current ()->exit_status = status;
thread_exit (); thread_exit ();
} }