summaryrefslogtreecommitdiff
path: root/src/kernel/mem/paging.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/mem/paging.cpp')
-rw-r--r--src/kernel/mem/paging.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/kernel/mem/paging.cpp b/src/kernel/mem/paging.cpp
index 2ac190f..5c5a929 100644
--- a/src/kernel/mem/paging.cpp
+++ b/src/kernel/mem/paging.cpp
@@ -136,14 +136,22 @@ uint32_t paging_fault(registers *regs) {
}
if (seg == 0) {
- NL; WHERE; *ke_vt << "Unhandled Page Fault (PID " << current_thread->process->pid << ")\t";
- *ke_vt << "cr2:" << addr;
- NL; TAB;
- if (regs->err_code & 0x1) *ke_vt << "present"; TAB;
- if (regs->err_code & 0x2) *ke_vt << "write"; TAB;
- if (regs->err_code & 0x4) *ke_vt << "user"; TAB;
- if (regs->err_code & 0x8) *ke_vt << "rsvd"; TAB;
- if (regs->err_code & 0x10) *ke_vt << "opfetch";
+ 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 ";
return 1;
}
return 0;