From f9d352a64d125ac69c2d1a74fdbc75665c6d0b42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Thu, 4 Feb 2021 10:56:38 +0100 Subject: implement halt() --- src/userprog/syscall.c | 5 +++++ 1 file changed, 5 insertions(+) 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 #include +#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))); -- cgit v1.2.1