X-Git-Url: http://git.dujemihanovic.xyz/%7B%7B%20%24style.RelPermalink%20%7D%7D?a=blobdiff_plain;f=kernel%2Fkernel.c;h=0aa8fc260ddfd604789fa6e2ff0050cb2f4a8970;hb=f9f5d56cc790530b8470b6a565cdd0205c656a89;hp=060051c25782f3317f426f0ea44362e420a98b80;hpb=8ca60f51b2566a2f839eb2b83633eab654a0d5ad;p=nameless-os.git diff --git a/kernel/kernel.c b/kernel/kernel.c index 060051c..0aa8fc2 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -11,13 +11,38 @@ extern void pf_handler(struct fault_frame *frame); static struct idt_descriptor idt[256] __attribute__((aligned(0x10))); static struct idtr idtr __attribute__((aligned(0x10))); +struct e820_map { + uint64_t base; + uint64_t length; + uint32_t type; + uint32_t attrib; +}; -void kmain(void) +void print_e820(struct e820_map *mmap, int mmap_size) +{ + kprint(" Base | Length | Type | Attrib |\n", 0); + kprint("------------------------------------------------------------\n", 0); + for (int i=0; i