mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-16 16:11:42 -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 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);
|
||||||
|
|
||||||
|
@ -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){
|
||||||
|
@ -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