diff options
Diffstat (limited to 'src/kernel/mem')
-rw-r--r-- | src/kernel/mem/paging.cpp | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/src/kernel/mem/paging.cpp b/src/kernel/mem/paging.cpp index 5c5a929..436c888 100644 --- a/src/kernel/mem/paging.cpp +++ b/src/kernel/mem/paging.cpp @@ -136,22 +136,16 @@ uint32_t paging_fault(registers *regs) { } if (seg == 0) { - node *n = current_thread->process->fd.at(0); - vt *vt = (n && n->as_vt() ? n->as_vt() : ke_vt); - - vt->writeStr("\n"); - vt->writeStr("[ke:"); vt->writeStr(__FILE__); vt->writeStr(":"); - vt->writeDec(__LINE__); vt->writeStr("] "); - vt->writeStr("Unhandled Page Fault"); - - *vt << "\n\tPID: " << (int)current_thread->process->pid; - *vt << "\n\tcr2: " << addr; - *vt << "\n\tflags: "; - if (regs->err_code & 0x1) *vt << "present "; - if (regs->err_code & 0x2) *vt << "write "; - if (regs->err_code & 0x4) *vt << "user "; - if (regs->err_code & 0x8) *vt << "rsvd "; - if (regs->err_code & 0x10) *vt << "opfetch "; + dbg_printf("[ke:%s:%d] Unhandled page fault\n", __FILE__, __LINE__); + + dbg_printf("\tPID: %d\n", current_thread->process->pid); + dbg_printf("\tcr2: %p\n", addr); + dbg_printf("\tflags:"); + if (regs->err_code & 0x1) dbg_printf(" present"); + if (regs->err_code & 0x2) dbg_printf(" write"); + if (regs->err_code & 0x4) dbg_printf(" user"); + if (regs->err_code & 0x8) dbg_printf(" rsvd"); + if (regs->err_code & 0x10) dbg_printf(" opfetch"); return 1; } return 0; |