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 232 additions and 6 deletions
Showing only changes of commit dfa42b9d25 - Show all commits

View File

@@ -18,6 +18,7 @@
#include "threads/palloc.h"
#include "threads/thread.h"
#include "threads/vaddr.h"
#include "devices/timer.h"
static thread_func start_process NO_RETURN;
static bool load (const char *cmdline, void (**eip) (void), void **esp);
@@ -89,8 +90,12 @@ start_process (void *file_name_)
int
process_wait (tid_t child_tid UNUSED)
{
for (;;)
barrier ();
/* As a temporary wait, waiting will just put the thread to sleep for one
second (TIMER_FREQ = 100 ticks ~ 1 second). */
/* TODO: Implement process_wait () correctly. Remove the next line. */
timer_sleep (TIMER_FREQ);
return 0; /* TODO: Change this too */
}
/* Free the current process's resources. */