aboutsummaryrefslogtreecommitdiff
path: root/i686/isr.c
diff options
context:
space:
mode:
Diffstat (limited to 'i686/isr.c')
-rw-r--r--i686/isr.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/i686/isr.c b/i686/isr.c
new file mode 100644
index 0000000..4f6729b
--- /dev/null
+++ b/i686/isr.c
@@ -0,0 +1,42 @@
+/*
+ * Interrupt Service Routines
+ */
+
+#include "idt.h"
+#include "sys/control.h"
+#include <stdio.h>
+
+__attribute__((interrupt)) void
+abort_handler(struct interrupt_frame *frame)
+{
+ printf("### system abort ###\n");
+ printf("# ip: %x cs=%x\n", frame->ip, frame->cs);
+ printf("# sp: %x ss=%x\n", frame->sp, frame->ss);
+ printf("# flags: %x\n", frame->flags);
+ abort();
+}
+
+__attribute__((interrupt)) void
+syscall_handler(struct interrupt_frame *)
+{
+ printf("syscall\n");
+ abort();
+}
+
+extern void pic_clear(unsigned char irq);
+
+__attribute__((interrupt)) void
+irq0x00(struct interrupt_frame *)
+{
+ // printf("irq0x00\n");
+ pic_clear(0x00);
+}
+
+extern void ps2_keyboard_irq_handler();
+__attribute__((interrupt)) void
+irq0x01(struct interrupt_frame *)
+{
+ // printf("irq0x01\n");
+ ps2_keyboard_irq_handler();
+ pic_clear(0x00);
+}