diff --git a/src/userprog/syscall.c b/src/userprog/syscall.c index e04ff992b09515a2a7c41ae8bf0228383741483d..1e17a78d53f1c7f8925bf8c95d734755905ba0f6 100644 --- a/src/userprog/syscall.c +++ b/src/userprog/syscall.c @@ -11,7 +11,24 @@ syscall_init (void) { intr_register_int (0x30, 3, INTR_ON, syscall_handler, "syscall"); } +/* from lib/syscall-nr.h +system calls numbers are + SYS_HALT, 0 + SYS_EXIT, 1 + SYS_EXEC, 2 + SYS_WAIT, 3 + SYS_CREATE, 4 + SYS_REMOVE, 5 + SYS_OPEN, 6 + SYS_FILESIZE, 7 + SYS_READ, 8 + SYS_WRITE, 9 + SYS_SEEK, 10 + SYS_TELL, 11 + SYS_CLOSE, 12 +these are used for the case instead of number +*/ static void syscall_handler (struct intr_frame *f UNUSED) @@ -24,5 +41,27 @@ syscall_handler (struct intr_frame *f UNUSED) shutdown_power_off(); break; } + /* + // each team member should select on syscall. + // develop one from the cw document + + + case SYS_EXIT:{ + //to be developed + break; + } + case SYS_EXEC:{ + //to be developed + break; + } + case SYS_WAIT:{ + //to be developed + break; + } + case SYS_WAIT:{ + //to be developed + break; + } + */ thread_exit (); }