diff options
| author | Franklin Wei <frankhwei536@gmail.com> | 2015-03-01 14:20:47 -0500 |
|---|---|---|
| committer | Franklin Wei <frankhwei536@gmail.com> | 2015-03-01 14:20:47 -0500 |
| commit | c7252588ebb95f97631e9470778c69afa00c35b5 (patch) | |
| tree | 06d760878e18f6cddbe4305cddd4d5dfa74529f8 /kernel/isr.c | |
| parent | b8f54e63d2b8f8007c580adf2a6034c98a0f2eaa (diff) | |
| download | kappa-c7252588ebb95f97631e9470778c69afa00c35b5.zip kappa-c7252588ebb95f97631e9470778c69afa00c35b5.tar.gz kappa-c7252588ebb95f97631e9470778c69afa00c35b5.tar.bz2 kappa-c7252588ebb95f97631e9470778c69afa00c35b5.tar.xz | |
Huge restructure
Diffstat (limited to 'kernel/isr.c')
| -rw-r--r-- | kernel/isr.c | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/kernel/isr.c b/kernel/isr.c deleted file mode 100644 index e6887c6..0000000 --- a/kernel/isr.c +++ /dev/null @@ -1,60 +0,0 @@ -#include <stddef.h> -#include <stdio.h> -#include "isr.h" -#include "idt.h" -#include "panic.h" - -void (*int_callbacks[256])(struct regs_t*) = { NULL }; - -void set_interrupt_handler(uint8_t n, void (*callback)(struct regs_t*)) -{ - int_callbacks[n] = callback; -} - -void isr_handler(struct regs_t *regs) -{ - if(int_callbacks[regs->int_no]) - { - int_callbacks[regs->int_no](regs); - } - else - { - printf("WARNING: unhandled ISR 0x%x!\n", regs->int_no); - } -} - -void isr_init(void) -{ - idt_set_gate(0, (uint32_t)_isr0, 0x08, 0x8E); - idt_set_gate(1, (uint32_t)_isr1, 0x08, 0x8E); - idt_set_gate(2, (uint32_t)_isr2, 0x08, 0x8E); - idt_set_gate(3, (uint32_t)_isr3, 0x08, 0x8E); - idt_set_gate(4, (uint32_t)_isr4, 0x08, 0x8E); - idt_set_gate(5, (uint32_t)_isr5, 0x08, 0x8E); - idt_set_gate(6, (uint32_t)_isr6, 0x08, 0x8E); - idt_set_gate(7, (uint32_t)_isr7, 0x08, 0x8E); - idt_set_gate(8, (uint32_t)_isr8, 0x08, 0x8E); - idt_set_gate(9, (uint32_t)_isr9, 0x08, 0x8E); - idt_set_gate(10, (uint32_t)_isr10, 0x08, 0x8E); - idt_set_gate(11, (uint32_t)_isr11, 0x08, 0x8E); - idt_set_gate(12, (uint32_t)_isr12, 0x08, 0x8E); - idt_set_gate(13, (uint32_t)_isr13, 0x08, 0x8E); - idt_set_gate(14, (uint32_t)_isr14, 0x08, 0x8E); - idt_set_gate(15, (uint32_t)_isr15, 0x08, 0x8E); - idt_set_gate(16, (uint32_t)_isr16, 0x08, 0x8E); - idt_set_gate(17, (uint32_t)_isr17, 0x08, 0x8E); - idt_set_gate(18, (uint32_t)_isr18, 0x08, 0x8E); - idt_set_gate(19, (uint32_t)_isr19, 0x08, 0x8E); - idt_set_gate(20, (uint32_t)_isr20, 0x08, 0x8E); - idt_set_gate(21, (uint32_t)_isr21, 0x08, 0x8E); - idt_set_gate(22, (uint32_t)_isr22, 0x08, 0x8E); - idt_set_gate(23, (uint32_t)_isr23, 0x08, 0x8E); - idt_set_gate(24, (uint32_t)_isr24, 0x08, 0x8E); - idt_set_gate(25, (uint32_t)_isr25, 0x08, 0x8E); - idt_set_gate(26, (uint32_t)_isr26, 0x08, 0x8E); - idt_set_gate(27, (uint32_t)_isr27, 0x08, 0x8E); - idt_set_gate(28, (uint32_t)_isr28, 0x08, 0x8E); - idt_set_gate(29, (uint32_t)_isr29, 0x08, 0x8E); - idt_set_gate(30, (uint32_t)_isr30, 0x08, 0x8E); - idt_set_gate(31, (uint32_t)_isr31, 0x08, 0x8E); -} |