Quick and dirty IDT setup

This commit is contained in:
thomas committed 2018-03-20 14:11:21 +01:00
1 parent 25ef5f4688
commit cbcc67fc31
6 files changed
+219 -2

No files matched your search

+11
View File
@@ -4,6 +4,8 @@
#include <debug.h>
#include <multiboot.h>
void interrupt_init();
void kmain(uint64_t multiboot_magic, void *multiboot_data)
{
serial_init(PORT_COM1);
@@ -14,6 +16,15 @@ void kmain(uint64_t multiboot_magic, void *multiboot_data)
debug_info("Kernel was loaded with command line \"%s\", by <%s>\n", kernel_boot_data.commandline, kernel_boot_data.bootloader);
interrupt_init();
// Force a divide by zero exception
// ISR 0
int a = 5, b = 0;
int c = a/b;
debug("a: %d b:%d c:%d\n", a,b,c);
debug_ok("Boot \"Complete\"\n");
PANIC("Reached end of kernel main function\n");