proposed change to small domain semantics
Jonathan S. Shapiro
jsshapiro@earthlink.net
Fri, 8 May 1998 13:01:30 -0400
There are currently two EROS domain runtimes -- one for "small"
domains and another for "large" domains. Small domains have a mutable
stack, but no mutable global data.
Until now, this has not led to divergence in libraries, but I am now
building some libraries that need to maintain internal state.
I am therefore contemplating a revision to the small domain runtime as
follows:
On startup, in addition to buying stack pages, the runtime system will
examine the values of 'etext' and 'end'. These values are the lower
and upper bounds (respectively) on the mutable data encoded in the
binary.
If the binary contains mutable data, the runtime code will purchase
the required number of mutable pages and copy the data from the
original read-only pages into the new, mutable pages before calling
main(). This change has the following consequences:
+ small domains can now declare mutable data in the usual way,
reducing register pressure (important on x86, helpful on
SPARC)
+ the source code for small domains can now be written in the
same style as the source code for large domains. There is
no need to create a funny structure on the stack and pass it
around.
+ more libraries will be able to work correctly
+ it will be possible to use the LRU key cache library within
a small domain.
Reactions or objections?
shap