[coyotos-dev] Process startup

Jonathan S. Shapiro shap at eros-os.com
Wed Feb 7 20:16:07 CST 2007


This note is more in the way of a reminder to myself than a message to
the list.

One problem with having a UPCB is that the mkimage tool needs to be able
to set the initial program counter, which is now in a machine-specific
data structure. Mkimage targets multiple architectures, so this is
excessively inconvenient.

This evening, it occurred to me that there is a straightforward "fix".

We invent a new exception code, say: ExIPL (for "initial program load").
The faultInfo field for the ExIPL holds the desired initial PC.

When a process indicates that it is faulted with an ExIPL fault, the
behavior is as follows:

1. Initialize necessary register slots in UPCB to architecture-dependent
initial values. For IA32 this would include initializing segment
registers to known values.

2. Copy faultInfo (the desired initial PC) to actPC in the UPCB.

3. Now deliver the ExIPL fault to the activation handler, which knows
(because it has just received an IPL fault) that it should perform
first-time initialization.

At the cost of a small number of kernel lines that probably need to be
in there somewhere anyway, we can completely eliminate the machine
dependency issue in mkimage.


shap



More information about the coyotos-dev mailing list