gsilvis / silvos

half-baked Silvis OS kernel
MIT License
4 stars 2 forks source link

Add fork_daemon (analogous to spawn_daemon) #92

Closed gsilvis closed 5 years ago

gsilvis commented 5 years ago

In this case there's a very nice IPC-based API that can be used. When you call fork_daemon, you pass in a message (just like for call/respond). The destination field is ignored; instead, a new thread is created via fork, and put into the DAEMON state, and the message is sent to that thread. The parent is put into the CALLING state. So, when the child responds, the parent will wake up.

This is only really usable if you can figure out your own thread-id, so add a syscall for that too.

gsilvis commented 5 years ago

Rebased onto master.