Redo makefiles.
[pintos-anon] / src / threads / interrupt.c
index 8173ec11dcc44767c7cd5d02158651e48433eab4..4c7ec9e41e19c5a09428d1601b8eb2b325d07581 100644 (file)
@@ -2,12 +2,12 @@
 #include <inttypes.h>
 #include <stdint.h>
 #include "intr-stubs.h"
-#include "debug.h"
 #include "io.h"
-#include "lib.h"
 #include "mmu.h"
 #include "thread.h"
-#include "timer.h"
+#include "devices/timer.h"
+#include "lib/debug.h"
+#include "lib/lib.h"
 
 /* Number of x86 interrupts. */
 #define INTR_CNT 256
@@ -91,6 +91,10 @@ intr_init (void)
   /* Initialize interrupt controller. */
   pic_init ();
 
+  /* Initialize IDT. */
+  for (i = 0; i < INTR_CNT; i++)
+    idt[i] = make_trap_gate (intr_stubs[i], 0);
+
   /* Load IDT register. */
   idtr_operand = make_idtr_operand (sizeof idt - 1, idt);
   asm volatile ("lidt %0" :: "m" (idtr_operand));