Add more info about segfault

This commit is contained in:
Mathieu Maret 2018-11-16 15:00:31 +01:00
parent 085857a900
commit 27293c805c

View File

@ -11,6 +11,11 @@ __attribute__((interrupt)) void print_handler(struct interrupt_frame *frame, ulo
(void)error_code; (void)error_code;
} }
// c.f. https://wiki.osdev.org/Paging#Handling
// error_code bit0: Present ?
// bit1: Trying to write ?
// bit2: User page try to access?
__attribute__((interrupt)) void pagefault_handler(struct interrupt_frame *frame, ulong error_code){ __attribute__((interrupt)) void pagefault_handler(struct interrupt_frame *frame, ulong error_code){
printStringDetails("PAGE FAULT", RED, BLACK, 0, VGA_HEIGHT - 1); printStringDetails("PAGE FAULT", RED, BLACK, 0, VGA_HEIGHT - 1);
printIntDetails(error_code, RED, BLACK, 11, VGA_HEIGHT - 1); printIntDetails(error_code, RED, BLACK, 11, VGA_HEIGHT - 1);