From 56a16b9ea5429cd4ca7e7ccdfbbe0a2df430f04c Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Tue, 13 Nov 2018 18:02:47 +0100 Subject: [PATCH] Add empty pagefault handler --- core/exception_handler.c | 7 +++++++ core/interrupt.h | 1 + core/main.c | 1 + 3 files changed, 9 insertions(+) diff --git a/core/exception_handler.c b/core/exception_handler.c index d130c13..64aeca0 100644 --- a/core/exception_handler.c +++ b/core/exception_handler.c @@ -10,3 +10,10 @@ __attribute__((interrupt)) void print_handler(struct interrupt_frame *frame, ulo (void)frame; (void)error_code; } + +__attribute__((interrupt)) void pagefault_handler(struct interrupt_frame *frame, ulong error_code){ + printStringDetails("PAGE FAULT", RED, BLACK, 0, VGA_HEIGHT - 1); + printIntDetails(error_code, RED, BLACK, 11, VGA_HEIGHT - 1); + (void)frame; + (void)error_code; +} diff --git a/core/interrupt.h b/core/interrupt.h index 9e90171..7bef8c9 100644 --- a/core/interrupt.h +++ b/core/interrupt.h @@ -5,6 +5,7 @@ struct interrupt_frame; //Exception void print_handler(struct interrupt_frame *frame, ulong error_code); +void pagefault_handler(struct interrupt_frame *frame, ulong error_code); //IRQ void keyboard_handler(struct interrupt_frame *frame); diff --git a/core/main.c b/core/main.c index eece175..026481e 100644 --- a/core/main.c +++ b/core/main.c @@ -73,6 +73,7 @@ void kmain(unsigned long magic, unsigned long addr) printf("Enabling HW interrupts\n"); exceptionSetRoutine(EXCEPTION_DOUBLE_FAULT, print_handler); + exceptionSetRoutine(EXCEPTION_PAGE_FAULT, pagefault_handler); // Enabling the HW interrupts asm volatile("sti\n");