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 27 additions and 16 deletions
Showing only changes of commit fa6dac2108 - Show all commits

View File

@@ -1,4 +1,5 @@
#include "userprog/syscall.h" #include "userprog/syscall.h"
#include "devices/shutdown.h"
#include <stdio.h> #include <stdio.h>
#include <syscall-nr.h> #include <syscall-nr.h>
#include "threads/interrupt.h" #include "threads/interrupt.h"
@@ -11,6 +12,9 @@ static void syscall_handler (struct intr_frame *);
in size. */ in size. */
typedef uintptr_t syscall_function (uintptr_t, uintptr_t, uintptr_t); typedef uintptr_t syscall_function (uintptr_t, uintptr_t, uintptr_t);
/* System Call Functions */
static void halt (void);
void void
syscall_init (void) syscall_init (void)
{ {
@@ -23,3 +27,9 @@ syscall_handler (struct intr_frame *f UNUSED)
printf ("system call!\n"); printf ("system call!\n");
thread_exit (); thread_exit ();
} }
static void
halt (void)
{
shutdown_power_off ();
}