mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 19:05:08 +00:00
Kernel: Various stability improvements.
- Don't cli() in Process::do_exec() unless current is execing. Eventually this should go away once the scheduler is less retarded in the face of interrupts. - Improved memory access validation for ring0 processes. We now look at the kernel ELF header to determine if an access is appropriate. :^) It's very hackish but also kinda neat. - Have Process::die() put the process into a new "Dying" state where it can still get scheduled but no signals will be dispatched. This way we can keep executing in die() but won't get our EIP hijacked by signal dispatch. The main problem here was that die() wanted to take various locks.
This commit is contained in:
parent
03c0e836f0
commit
e05237485c
4 changed files with 41 additions and 14 deletions
|
@ -132,7 +132,7 @@ bool Scheduler::pick_next()
|
|||
|
||||
// Dispatch any pending signals.
|
||||
// FIXME: Do we really need this to be a separate pass over the process list?
|
||||
Process::for_each_not_in_state(Process::Dead, [] (auto& process) {
|
||||
Process::for_each_living([] (auto& process) {
|
||||
if (!process.has_unmasked_pending_signals())
|
||||
return true;
|
||||
// We know how to interrupt blocked processes, but if they are just executing
|
||||
|
@ -170,7 +170,7 @@ bool Scheduler::pick_next()
|
|||
g_processes->append(g_processes->remove_head());
|
||||
auto* process = g_processes->head();
|
||||
|
||||
if (process->state() == Process::Runnable || process->state() == Process::Running) {
|
||||
if (process->state() == Process::Runnable || process->state() == Process::Running || process->state() == Process::Dying) {
|
||||
#ifdef SCHEDULER_DEBUG
|
||||
dbgprintf("switch to %s(%u) @ %w:%x\n", process->name().characters(), process->pid(), process->tss().cs, process->tss().eip);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue