insane-adding-machines / frosted

Frosted: Free POSIX OS for tiny embedded devices
GNU General Public License v2.0
215 stars 39 forks source link

Execute signal handlers in process context #31

Closed danielinux closed 8 years ago

danielinux commented 8 years ago

Right now, signal handlers are executed via catch_signal() .

Write a proper trampoline function that can put the process on hold while the signal handler is being executed. When the signal handler returns, the process resumes its normal execution, so the status needs to be properly restored.

Roadmap:

danielinux commented 8 years ago

There is still a bug: executing signal handler cannot be correctly preempted. This is due to the different stack layout between pend_sv_handler and sv_call_handler.

Perhaps this can be fixed by explicitly differentiating between the two cases, so the stack can be prepared accordingly by the trampoline function.

danielinux commented 8 years ago

I have pending changes that would allow execution of syscalls within the signal handler, but reveals a bug in the ktimer interface. See #34 .

danielinux commented 8 years ago

closed in a0c0e39