Quick and dirty IDT setup

This commit is contained in:
2017-12-06 16:53:12 +01:00
parent 25ef5f4688
commit cbcc67fc31
6 changed files with 219 additions and 2 deletions

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");