fix: 0x0x in panic

This commit is contained in:
Karina
2025-12-22 00:47:49 +04:00
parent 2c998b53e5
commit a83bd40a86
2 changed files with 7 additions and 5 deletions
+2
View File
@@ -38,5 +38,7 @@ void kmain(Bootinfo* info) {
kfetch();
__asm__("ud2"); // panic :(
while (1) { __asm__("hlt"); }
}
+5 -5
View File
@@ -54,11 +54,11 @@ __attribute__((noreturn)) void panic(Registers *regs) {
kprintf("\t\t\tKERNEL PANIC :( \n");
kprintf("\t\t-------------------------\n");
kprintf("\t\tCPU EXCEPTION: %d (%s)\n", regs->int_no, exception_messages[regs->int_no]);
kprintf("\t\tError Code: 0x%x\n", regs->err_code);
kprintf("\t\tInstruction Pointer (RIP): 0x%x\n", regs->rip);
kprintf("\t\tCode Segment (CS): 0x%x\n", regs->cs);
kprintf("\t\tFlags (RFLAGS): 0x%x\n", regs->rflags);
kprintf("\t\tStack Pointer (RSP): 0x%x\n", regs->rsp);
kprintf("\t\tError Code: %x\n", regs->err_code);
kprintf("\t\tInstruction Pointer (RIP): %x\n", regs->rip);
kprintf("\t\tCode Segment (CS): %x\n", regs->cs);
kprintf("\t\tFlags (RFLAGS): %x\n", regs->rflags);
kprintf("\t\tStack Pointer (RSP): %x\n", regs->rsp);
kprintf("\t\t-------------------------\n");
kprintf("\t\t\tSystem halted.\n");