Add some basic signal support.

It only works for sending a signal to a process that's in userspace code.

We implement reception by synthesizing a PUSHA+PUSHF in the receiving process
(operating on values in the TSS.)
The TSS CS:EIP is then rerouted to the signal handler and a tiny return
trampoline is constructed in a dedicated region in the receiving process.

Also hacked up /bin/kill to be able to send arbitrary signals (kill -N PID)
This commit is contained in:
Andreas Kling 2018-11-06 10:46:40 +01:00
commit 153ea704af
Notes: sideshowbarker 2024-07-19 18:33:15 +09:00
13 changed files with 240 additions and 30 deletions

View file

@ -146,6 +146,8 @@ static DWORD handle(RegisterDump& regs, DWORD function, DWORD arg1, DWORD arg2,
return current->sys$dup((int)arg1);
case Syscall::Dup2:
return current->sys$dup2((int)arg1, (int)arg2);
case Syscall::Sigaction:
return current->sys$sigaction((int)arg1, (const Unix::sigaction*)arg2, (Unix::sigaction*)arg3);
default:
kprintf("<%u> int0x80: Unknown function %x requested {%x, %x, %x}\n", current->pid(), function, arg1, arg2, arg3);
break;