diff options
author | Alex AUVOLAT <alexis211@gmail.com> | 2013-06-09 14:35:40 +0200 |
---|---|---|
committer | Alex AUVOLAT <alexis211@gmail.com> | 2013-06-09 14:35:40 +0200 |
commit | 9c74cb8c5bb5661d7f71f43b88816e70cc9fc022 (patch) | |
tree | 77a893ff826dcb14e9b8768c23e4970033e934ea /src/kernel/mem/paging.cpp | |
parent | 4d65fcb9a8b6c7c6fd5a3390c46a96d11b6a80d4 (diff) | |
download | TCE-9c74cb8c5bb5661d7f71f43b88816e70cc9fc022.tar.gz TCE-9c74cb8c5bb5661d7f71f43b88816e70cc9fc022.zip |
Many bug corrections.
Diffstat (limited to 'src/kernel/mem/paging.cpp')
-rw-r--r-- | src/kernel/mem/paging.cpp | 24 |
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; |