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
2 changed files with 93 additions and 19 deletions
Showing only changes of commit 5e2342fad7 - Show all commits

View File

@@ -50,10 +50,10 @@ syscall_handler (struct intr_frame *f)
{ {
/* First, read the system call number from the stack. */ /* First, read the system call number from the stack. */
validate_user_pointer (f->esp, 1); validate_user_pointer (f->esp, 1);
int syscall_number = *(int *) f->esp; unsigned syscall_number = *(int *) f->esp;
/* Ensures the number corresponds to a system call that can be handled. */ /* Ensures the number corresponds to a system call that can be handled. */
if (syscall_number < 0 || syscall_number >= LOOKUP_SIZE) if (syscall_number >= LOOKUP_SIZE)
thread_exit (); thread_exit ();
syscall_arguments syscall = syscall_lookup[syscall_number]; syscall_arguments syscall = syscall_lookup[syscall_number];