aboutsummaryrefslogtreecommitdiff
path: root/core/kernel.c
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2017-03-06 02:52:05 +0100
committerRobin Krahl <robin.krahl@ireas.org>2017-03-06 02:52:05 +0100
commit05b9ca73793047e795e46a2ae13db02c34b8a7c3 (patch)
tree5ab672db87c57cbe01662547e7733e71aa748743 /core/kernel.c
parent28301499381cb541eec4eb99f61e3d1a193c5a2d (diff)
downloadgarmos-05b9ca73793047e795e46a2ae13db02c34b8a7c3.tar.gz
garmos-05b9ca73793047e795e46a2ae13db02c34b8a7c3.tar.bz2
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.
Diffstat (limited to 'core/kernel.c')
-rw-r--r--core/kernel.c15
1 files changed, 12 insertions, 3 deletions
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 <garmos/idt.h>
#include <garmos/gdt.h>
#include <garmos/kernel.h>
#include <garmos/term.h>
#include <garmos/types.h>
-
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);
}