System call interface.
[pintos-anon] / src / userprog / syscall.c
diff --git a/src/userprog/syscall.c b/src/userprog/syscall.c
new file mode 100644 (file)
index 0000000..6084726
--- /dev/null
@@ -0,0 +1,19 @@
+#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 ();
+}