diff options
Diffstat (limited to 'src/userprog')
| -rw-r--r-- | src/userprog/syscall.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/userprog/syscall.c b/src/userprog/syscall.c index e15555e..49e61e8 100644 --- a/src/userprog/syscall.c +++ b/src/userprog/syscall.c @@ -1,6 +1,7 @@ #include "userprog/syscall.h" #include <stdio.h> #include <syscall-nr.h> +#include "threads/init.h" #include "threads/interrupt.h" #include "threads/thread.h" @@ -17,6 +18,10 @@ syscall_handler (struct intr_frame *f UNUSED) { int syscall_number = *((int *)f->esp); switch (syscall_number) { + case 0: + // halt + power_off (); + break; case 9: // printf printf ("printf: %s", *((char **)(f->esp+8))); |
