[coyotos-dev] Executable format for Coyotos

Jonathan S. Shapiro shap at eros-os.com
Thu Mar 8 22:51:39 CST 2007


On Thu, 2007-03-08 at 22:25 +0100, Pierre THIERRY wrote:
> Scribit Jonathan S. Shapiro dies 04/03/2007 hora 20:56:
> > For a self-hosted build, you would now run an additional tool. This
> > tool extracts the loadable sections from the executable file and
> > copies them into their proper positions into a new address space. This
> > address space is what gets installed into the constructor (i.e. not
> > the executable).
> 
> OK.
> 
> Now, my problem is, I'm pretty sure I don't quite get the big picture
> about how memory objects are dealt with in Coyotos. Specifically, how
> could an address space be built?

I'm not sure whether you want the high-level answer or the low-level
answer.

At a high level, the answer is: you go to the zero space constructor
(zsc) and ask it to fabricate a new, demand-allocated space full of
zeros for you. You map this at any convenient location and write bytes
to it.

Internally, page faults are occurring as the first write to each page
within the space happens. These get reflected to the keeper of the
space, which buys any necessary pages and gpts from the space bank and
then modifies the space to populate it as needed.

> I didn't find in the Coyotos specification which interface should be
> used for that purpose... Would an address space be built by asking the
> space bank for the creation of a GPT and various pages?

You didn't find it in the microkernel spec because the assembly of the
space isn't done by the microkernel. Yes, the space keeper extends the
space by purchasing GPTs and Pages.

> > I think what you are missing is that address spaces are persistent, so
> > there is no reason to do this step every time a program is started.
> 
> It's absolutely fantastic what persistence will make easily possible, it
> seems, but that's a model I wasn't used to at all...
> 
> > You could also emit code directly into a target address space.
> 
> That should be quite easier than creating an ELF executable. This would
> be useful at least when prototyping the compiler...

Yes, though caution is in order: don't forget the need for debugging
information!

shap
-- 
Jonathan S. Shapiro, Ph.D.
Managing Director
The EROS Group, LLC
+1 443 927 1719 x5100



More information about the coyotos-dev mailing list