mirror of
https://github.com/panpaul/tiny_os
synced 2024-09-20 09:45:19 +08:00
chore: kernel: trap: print trace when page fault happens
This commit is contained in:
parent
d69e95721c
commit
0300ac3c5d
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
@ -16,5 +16,9 @@
|
||||
"**/.rustup/**": true,
|
||||
"**/.cargo/registry/**": true,
|
||||
"**/.cargo/git/**": true,
|
||||
},
|
||||
"[riscv]": {
|
||||
"editor.indentSize": "tabSize",
|
||||
"editor.tabSize": 8
|
||||
}
|
||||
}
|
@ -93,6 +93,10 @@ impl TrapContextOps for TrapContext {
|
||||
if from_kernel {
|
||||
panic_fatal!("Page Fault in Kernel");
|
||||
}
|
||||
|
||||
let stval = riscv::register::stval::read();
|
||||
trace!("Page Fault: sepc: {:#x}, stval: {:#x}", self.sepc, stval);
|
||||
|
||||
// TODO: handle page fault
|
||||
},
|
||||
_ => panic_fatal!("Unhandled Trap"),
|
||||
|
Loading…
Reference in New Issue
Block a user