Booting a CapROS system involves the following steps, each of which is discussed in detail below.
A CapROS system consists of the kernel and objects. Preloaded objects are those that are loaded at the same time as the kernel. Non-preloaded objects are loaded from disk by the CapROS pager. Preloaded objects include all nonpersistent objects, and may include the persistent objects that define a big bang. The build tutorial has more information on the big bang.
The kernel and preloaded objects are loaded by a boot loader from some nonvolatile medium. The details are machine-specific. Here are some examples:
Kernel initialization is not yet documented.
The kernel starts the system by running the single nonpersistent IPL process. The IPL process is identified by an OID that is defined in the system image, using the mkimage "ipl" directive. The IPL process goes through a list of nonpersistent processes to be started, and starts them. This list is built using the mkimage "run" and "threadlist" directives. In a fully nonpersistent system, this list of processes includes all the initial processes, such as device drivers.
In a persistent system, the initial state of the persistent objects must be defined using mkimage and then set up in the system. There are two ways to do this.
There are several different scenarios for the restart sequence.
In this scenario, the initial (big bang) persistent objects are preloaded into RAM. The system image of the persistent objects should contain an IPL process. The IPL process is started in the restart sequence, and it in turn starts the other persistent processes. If there is any checkpoint on disk, it is ignored.
To build such a system, npgen is run twice, once to create an image file of the nonpersistent objects, and once to create an image file of the persistent objects. When building the nonpersistent objects, the -p option must be given to npgen.
After the system is initialized and running, it can be checkpointed to disk. Note that it takes at least two checkpoints to overwrite any old checkpoint that may already be on the disk.
If there are no preloaded persistent objects, but there is a disk with a checkpoint, the restart sequence loads the state of the persistent world from the checkpoint. See the Checkpoint Mechanism for details. The checkpoint on disk may be either the previous state of the system saved by a checkpoint, or a big bang (including an IPL process) written to disk by sysgen.
When building the nonpersistent objects, the -p option must be given to npgen so the nonpersistent world can find the persistent world.
If there are no preloaded persistent objects and no disk with a checkpoint, the system runs without any persistent objects; it is nonpersistent only. In this case the -p option must not be given to npgen.
As an implementation detail, the restart sequence is driven by a kernel process.
Copyright 2007, 2008 by Strawberry Development Group. All rights reserved. For terms of redistribution, see the GNU General Public License This material is based upon work supported by the US Defense Advanced Research Projects Agency under Contract No. W31P4Q-07-C-0070. Approved for public release, distribution unlimited. |