Dump the memory map from limine.

Also adds the ability to print formatted messages.
This commit is contained in:
Drew Galbraith 2023-05-18 01:16:53 -07:00
parent 9fc1aa15ef
commit b3f8cb9003
7 changed files with 644 additions and 15 deletions

View file

@ -1,17 +1,21 @@
#include <stdint.h>
#include "boot/boot_info.h"
#include "boot/limine.h"
#include "common/gdt.h"
#include "debug/debug.h"
#include "interrupt/interrupt.h"
extern "C" void zion() {
dbgln("Hello World!");
InitGdt();
dbgln("New GDT Loaded!");
InitIdt();
dbgln("IDT Loaded!");
uint64_t a = 11 / 0;
dbgln("Recovered");
const limine_memmap_response& resp = boot::GetMemoryMap();
dbgln("Base,Length,Type");
for (uint64_t i = 0; i < resp.entry_count; i++) {
const limine_memmap_entry& entry = *resp.entries[i];
dbgln("%m,%x,%u", entry.base, entry.length, entry.type);
}
while (1)
;