#include #include #include #include #include #include #include #include static uint8_t stack[4096] = {0}; void stivale2_main(struct stivale2_struct *info); extern void asmpanic(); struct stivale2_header_tag_smp smp_request = { .tag = { .identifier = STIVALE2_HEADER_TAG_SMP_ID, .next = 0 }, .flags = 0 }; __attribute__((section(".stivale2hdr"), used)) struct stivale2_header header2 = { .entry_point = (uint64_t)stivale2_main, .stack = (uintptr_t)stack + sizeof(stack), .flags = 0, .tags = (uint64_t)&smp_request }; void stivale2_main(struct stivale2_struct *info) { parse_stivale2(info); // print_stivale2_memmap(info); uint64_t* cr3; __asm__ __volatile__ ( "movq %%cr3, %0\n\t" : "=r" (cr3) : /* no input */ : /* no clobbers */ ); printf("PAGE TABLE AT: %x\n", cr3); loadgdt(); print_gdt(); setup_ints(); kmain(); }