Newlib signals

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Agola
Member
Member
Posts: 155
Joined: Sun Nov 20, 2016 7:26 am
Location: Somewhere

Newlib signals

Post by Agola »

Hi.

I'm working on signaling on newlib. But interestingly I couldn't find I way to signal except raise. Is there a way that I don't know to signal a task?
I don't think newlib implementation of signal only support the signal and raise.

If newlib implementation of signal only supports the signal and raise, it should be impossible send signals from kill syscall. But it's defined.
Again if it only supports signal and raise, how can I handle signals to be sent from kill?

Thanks in advance.
Keyboard not found!

Press F1 to run setup.
Press F2 to continue.
User avatar
max
Member
Member
Posts: 616
Joined: Mon Mar 05, 2012 11:23 am
Libera.chat IRC: maxdev
Location: Germany
Contact:

Re: Newlib signals

Post by max »

Hey,

I'm not sure if I understand your question correctly, but usually a signal is only raised in the own process using raise and sent to other processes using kill.

The signal implementation provided by Newlib is basically just an emulation (works only within the current process). You will have to implement real signal handling in your kernel. (http://wiki.osdev.org/Porting_Newlib#Signal_handling). It takes quite some work to implement it; the state of the interrupted process must be stored, the appropriate signal handler called in user space and then the old state must be restored once the signal handler has finished it's work.

Greets
Post Reply