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 86 additions and 19 deletions
Showing only changes of commit e718159ed8 - Show all commits

View File

@@ -34,7 +34,7 @@ static const syscall_arguments syscall_lookup[] = {
/* The number of syscall functions (i.e, number of elements) within the
syscall_lookup table. */
static const int lookup_size
static const int LOOKUP_SIZE
= sizeof (syscall_lookup) / sizeof (syscall_arguments);
void
@@ -51,7 +51,7 @@ syscall_handler (struct intr_frame *f)
int syscall_number = *(int *) f->esp;
/* Ensures the number corresponds to a system call that can be handled. */
if (syscall_number < 0 || syscall_number >= lookup_size)
if (syscall_number < 0 || syscall_number >= LOOKUP_SIZE)
thread_exit ();
syscall_arguments syscall = syscall_lookup[syscall_number];