Allow recover from exception

This commit is contained in:
Baptiste Wicht 2016-08-06 20:43:22 +02:00
parent 09a88a9087
commit ccba23ccb9
3 changed files with 12 additions and 3 deletions

View File

@ -36,6 +36,11 @@ void sbrk(size_t inc);
void tick(); void tick();
void reschedule(); void reschedule();
/*!
* \brief Indicates a fault in the current process
*/
void fault();
void sleep_ms(size_t time); void sleep_ms(size_t time);
void sleep_ms(pid_t pid, size_t time); void sleep_ms(pid_t pid, size_t time);

View File

@ -246,9 +246,7 @@ void _fault_handler(interrupt::fault_regs regs){
double_printf("cr2=%h\n", get_cr2()); double_printf("cr2=%h\n", get_cr2());
double_printf("cr3=%h\n", get_cr3()); double_printf("cr3=%h\n", get_cr3());
//TODO Improve that with kind of blue screen scheduler::fault();
asm volatile("hlt" : : );
} }
void _irq_handler(interrupt::syscall_regs* regs){ void _irq_handler(interrupt::syscall_regs* regs){

View File

@ -966,3 +966,9 @@ void scheduler::frequency_updated(uint64_t old_frequency, uint64_t new_frequency
} }
} }
} }
void scheduler::fault(){
logging::logf(logging::log_level::DEBUG, "Fault in %u kill it\n", current_pid);
kill_current_process();
}