ecall module now kills processes which trigger an exception

master
Anton Lydike 3 years ago
parent b08198d166
commit 14c2dd95a6

@ -202,7 +202,12 @@ void init_ecall_table()
void handle_exception(int ecode, int mtval)
{
//TODO: handle exceptions well
dbgln("exception encountered!", 17);
__asm__ ("ebreak");
// kill off offending process
ProcessControlBlock* pcb = get_current_process();
pcb->status = PROC_DEAD;
pcb->exit_code = -99;
destroy_process(pcb);
// run the next process
scheduler_run_next();
}

Loading…
Cancel
Save