heading to laptop
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
#include "syscall.h"
|
||||
#include "common.h"
|
||||
#include "gdt.h"
|
||||
#include "scheduler.h"
|
||||
#include "process.h"
|
||||
|
||||
#include <drivers/pic/pic.h>
|
||||
#include <drivers/ps2/ps2.h>
|
||||
@@ -114,8 +116,10 @@ void common_interrupt_handler(intr_regs_t *args) {
|
||||
case 12:
|
||||
case 13:
|
||||
case 15:
|
||||
case 16:
|
||||
case 16: {
|
||||
process_t* task = current_task();
|
||||
kprintf("\n--- CPU Exception ---\n");
|
||||
kprintf("Current Task PID: %d\n", task->pid);
|
||||
kprintf("Error: [%d] %s\n", args->int_no, err_messages[args->int_no]);
|
||||
kprintf("Error Code: 0x%x\n", args->error_code);
|
||||
kprintf("Instruction Pointer: 0x%x\n", args->eip);
|
||||
@@ -127,12 +131,16 @@ void common_interrupt_handler(intr_regs_t *args) {
|
||||
kprintf("Current cr3: 0x%x\n", fetch_cr3());
|
||||
kprintf("tss.esp0: 0x%x\n", tss.esp0);
|
||||
kprintf("instruction: 0x%x\n", *(uint32_t*)args->eip);
|
||||
asm volatile("hlt");
|
||||
kpanic();
|
||||
break;
|
||||
}
|
||||
case 14:{
|
||||
disable_interrupts();
|
||||
uint32_t faulting_address;
|
||||
process_t* task = current_task();
|
||||
asm volatile("mov %%cr2, %0" : "=r"(faulting_address));
|
||||
kprintf("\n--- PAGE FAULT ---\n");
|
||||
kprintf("Current Task PID: %d\n", task->pid);
|
||||
kprintf("Faulted Virtual Address: 0x%x\n", faulting_address);
|
||||
kprintf("Error Code: 0x%x\n", args->error_code);
|
||||
kprintf("Instruction Pointer: 0x%x\n", args->eip);
|
||||
@@ -154,7 +162,7 @@ void common_interrupt_handler(intr_regs_t *args) {
|
||||
(args->error_code & 0x01) ? "Protection Violation" : "Page Not Present",
|
||||
(args->error_code & 0x02) ? "Write" : "Read",
|
||||
(args->error_code & 0x04) ? "User" : "Supervisor");
|
||||
asm volatile("hlt");
|
||||
kpanic();
|
||||
break;
|
||||
}
|
||||
case 32: {
|
||||
|
||||
Reference in New Issue
Block a user