Switch ok with debug mode apps, implement sys_exit correctly later.

This commit is contained in:
Yifan Wu 2020-11-29 01:31:36 +08:00
parent 4e8059e222
commit 3f3e6b2b99
16 changed files with 244 additions and 147 deletions

View file

@ -11,7 +11,6 @@ use riscv::register::{
stval,
};
use crate::syscall::syscall;
use crate::batch::run_next_app;
global_asm!(include_str!("trap.S"));
@ -34,11 +33,13 @@ pub fn trap_handler(cx: &mut TrapContext) -> &mut TrapContext {
Trap::Exception(Exception::StoreFault) |
Trap::Exception(Exception::StorePageFault) => {
println!("[kernel] PageFault in application, core dumped.");
run_next_app();
panic!("[kernel] Cannot continue!");
//run_next_app();
}
Trap::Exception(Exception::IllegalInstruction) => {
println!("[kernel] IllegalInstruction in application, core dumped.");
run_next_app();
panic!("[kernel] Cannot continue!");
//run_next_app();
}
_ => {
panic!("Unsupported trap {:?}, stval = {:#x}!", scause.cause(), stval);