#include "aplos.h" void setup_paging(struct boot_info *info) { print(u8"Setting up paging. All usable physical memory is mapped starting at %p\n", info->physbase); uint64_t cr3 = get_cr3(); print(u8"CR3: %p\n", cr3); } bool page_fault_handler(uint32_t code) { int write = code&0x2; uint64_t addr = get_cr2(); print(u8"Page fault trying to %s %p\n", write ? u8"write to" : u8"read from", addr); return false; /* We didn't actually handle it */ }