Check out the new USENIX Web site. next up previous
Next: Fork Up: Linux process external environment Previous: Linux process external environment


The Linux process tree

In order to implement a Linux environment the Linux process tree must be supported. In K42 this functionality is provided by the ProcessLinuxServer. This server was implemented primarily by using Linux data structures, such as the task struct, with only minor changes to track Linux processes in K42.

Linux processes are backed by native K42 processes and contain a pointer to the underlying K42 process. In addition to backing Linux processes, K42 processes are used to implement core facilities. Linux processes are used for user applications and many of K42's servers, such as the filesystem. Should additional personalities be added to K42, they would add additional types of processes.

The ProcessLinuxServer keeps track of the relationship between different Linux processes. It tracks the parent-child relationship when a process is created via fork (we only intend to support forking of Linux processes). When a parent process finishes or is terminated, the ProcessLinuxServer re-assigns the child to init. In addition to the process tree, the ProcessLinuxServer keeps track of two other trees or sets. It tracks the sessions used to associate processes that are related by their starting tty. It allows any process to get access to the session tty even though the parent has not passed the child an open fd for it. In addition to sessions, the ProcessLinuxServer keeps track of the set of process groups. As in Linux, every process knows what process group and what session it belongs to.

In addition to maintaining the three structures mentioned above, the ProcessLinuxServer manages Unix credentials, and as in Linux, matches process to process groups where appropriate. The ProcessLinuxServer is also responsible for the delivery of signals (discussed in more detail later). The Linux process tree, combined with session and process groups, forms the core tracking infrastructure for many of the services described in the rest of the paper.


next up previous
Next: Fork Up: Linux process external environment Previous: Linux process external environment
2003-04-08