Read memory map tags from multiboot

This commit is contained in:
2017-12-19 22:51:11 +01:00
parent 0b3648de7c
commit 80cc165957
4 changed files with 113 additions and 14 deletions

View File

@@ -6,13 +6,6 @@
#include <cpu.h>
#include <interrupts.h>
registers *divbyzero(registers *r)
{
debug_error("Divide by zero error!\n");
debug_print_registers(r);
for(;;);
}
void kmain(uint64_t multiboot_magic, void *multiboot_data)
{
serial_init(PORT_COM1);
@@ -26,13 +19,10 @@ void kmain(uint64_t multiboot_magic, void *multiboot_data)
cpu_init();
// Force and catch a divide by zero exception
// ISR 0
bind_interrupt(0, divbyzero);
int a = 5, b = 0;
int c = a/b;
debug("a: %d b:%d c:%d\n", a,b,c);
uintptr_t start, end;
uint32_t type, i=0;
while(!multiboot_get_memory_area(i++, &start, &end, &type))
debug_printf("Mem %d 0x%x-0x%x\n", type, start, end);
debug_ok("Boot \"Complete\"\n");