genodelabs/genode — Issue #53: Noux: fork syscall
Author: nfeske
Created: 2012-01-03 13:21:11+00:00
State: open
Labels: feature

At the current stage, we can execute individual Unix tools. But this is of little value if those tools cannot be combined. Hence, we need to implement the fork syscall to enable the shell to spawn new processes.

The fork implementation will likely depend on the base platform. On Linux, we need to investigate a way to use fork locally (by the noux process) and inform Noux about the new child. So we let the Linux kernel do the actual forking work. However, we have to keep in mind that memory objects allocated via 'env()->rm_session()' are actually mmaped files mapped with the SHARED flag. Because those objects would not be forked as expected, we must manually replace them by copies right after performing the fork syscall.

On non-Linux platforms, fork can (and should) be implemented in Noux. For this, Noux has to keep track about RM-session operations of each child and must provide a way to replicate an address space. For the first version, this replication can happen by eagerly copying r/w mappings (rather than implementing copy-on-write).