# User process code.
USERPROG_SRC = addrspace.c # Address spaces.
USERPROG_SRC += exception.c # User exception handler.
+USERPROG_SRC += syscall.c # System call handler.
USERPROG_SRC += gdt.c # GDT initialization.
USERPROG_SRC += tss.c # TSS management.
#include "vga.h"
#ifdef USERPROG
#include "exception.h"
+#include "syscall.h"
#include "gdt.h"
#include "tss.h"
#endif
kbd_init ();
#ifdef USERPROG
exception_init ();
+ syscall_init ();
#endif
/* Start thread scheduler and enable interrupts. */
--- /dev/null
+#include "syscall.h"
+#include "lib.h"
+#include "interrupt.h"
+#include "thread.h"
+
+static void syscall_handler (struct intr_frame *);
+
+void
+syscall_init (void)
+{
+ intr_register (0x30, 3, INTR_ON, syscall_handler, "syscall");
+}
+
+static void
+syscall_handler (struct intr_frame *f)
+{
+ printk ("system call!\n");
+ thread_exit ();
+}
--- /dev/null
+#ifndef HEADER_SYSCALL_H
+#define HEADER_SYSCALL_H 1
+
+void syscall_init (void);
+
+#endif /* syscall.h */