added origin program

This commit is contained in:
2026-06-16 18:44:31 -05:00
parent 0a51a5e8bc
commit 171cbd21bc
12 changed files with 262 additions and 28 deletions

View File

@@ -41,11 +41,24 @@ void common_interrupt_handler(struct registers *args) {
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
kprintf("CPU Error: %s", err_messages[args->int_no]);
break;
case 14:{
uint32_t faulting_address;
asm volatile("mov %%cr2, %0" : "=r"(faulting_address));
kprintf("\n--- PAGE FAULT ---\n");
kprintf("Faulting Virtual Address (CR2): 0x%x\n", faulting_address);
kprintf("Error Code: 0x%x\n", args->error_code);
kprintf("Instruction Pointer (EIP): 0x%x\n", args->eip);
kprintf("Caused by: %s, %s, running in %s mode\n",
(args->error_code & 0x01) ? "Page protection violation" : "Non-present page",
(args->error_code & 0x02) ? "Write operation" : "Read operation",
(args->error_code & 0x04) ? "User (Ring 3)" : "Supervisor (Ring 0)");
while(1);
break;
}
case 32:
// wake the PIT timer driver
send_eoi_master();