From 05b9ca73793047e795e46a2ae13db02c34b8a7c3 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Mon, 6 Mar 2017 02:52:05 +0100 Subject: idt: add interruption handling The Interruption Descriptor Table (IDT) is implemented in idt.{c,h} as part of the core, but the setup and activation of the IDT and the registration of specific interruption request handlers is part of arch.{c,h}. The request handlers are implemented in idt.s and delegate to kernel_handle_interrupt. --- core/kernel.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'core/kernel.c') diff --git a/core/kernel.c b/core/kernel.c index c159aef..098db12 100644 --- a/core/kernel.c +++ b/core/kernel.c @@ -12,24 +12,33 @@ * more details. */ +#include #include #include #include #include - void ker_dbg(char *s) { term_print(s); term_print("\n"); } +uint32_t kernel_handle_interrupt(uint8_t no, uint32_t esp) +{ + return esp; +} + void kernel_main(uint32_t multiboot, unsigned int *magicno) { + term_clear(); + gdt_init(); + idt_init(); + + idt_activate(); - term_clear(); term_print("garmos 0.1.0\n\n"); - while(1); + while (1); } -- cgit v1.2.1