Add a page fault handler

This commit is contained in:
Drew Galbraith 2023-05-18 10:43:45 -07:00
parent 0b7e667368
commit 747c2a4e17
2 changed files with 5 additions and 0 deletions

View File

@ -44,9 +44,13 @@ extern "C" void interrupt_divide_by_zero(void* frame) { panic("DIV0"); }
extern "C" void isr_protection_fault();
extern "C" void interrupt_protection_fault(void* frame) { panic("GP"); }
extern "C" void isr_page_fault();
extern "C" void interrupt_page_fault(void* frame) { panic("PF"); }
void InitIdt() {
gIdt[0] = CreateDescriptor(isr_divide_by_zero);
gIdt[13] = CreateDescriptor(isr_protection_fault);
gIdt[14] = CreateDescriptor(isr_page_fault);
InterruptDescriptorTablePointer idtp{
.size = sizeof(gIdt),
.base = reinterpret_cast<uint64_t>(gIdt),

View File

@ -54,3 +54,4 @@ isr_\name:
isr_handler divide_by_zero
isr_handler protection_fault,1
isr_handler page_fault,1