mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-15 23:47:25 -04:00
Allow recover from exception
This commit is contained in:
parent
09a88a9087
commit
ccba23ccb9
@ -36,6 +36,11 @@ void sbrk(size_t inc);
|
||||
void tick();
|
||||
void reschedule();
|
||||
|
||||
/*!
|
||||
* \brief Indicates a fault in the current process
|
||||
*/
|
||||
void fault();
|
||||
|
||||
void sleep_ms(size_t time);
|
||||
void sleep_ms(pid_t pid, size_t time);
|
||||
|
||||
|
@ -246,9 +246,7 @@ void _fault_handler(interrupt::fault_regs regs){
|
||||
double_printf("cr2=%h\n", get_cr2());
|
||||
double_printf("cr3=%h\n", get_cr3());
|
||||
|
||||
//TODO Improve that with kind of blue screen
|
||||
|
||||
asm volatile("hlt" : : );
|
||||
scheduler::fault();
|
||||
}
|
||||
|
||||
void _irq_handler(interrupt::syscall_regs* regs){
|
||||
|
@ -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();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user