Layout of an EROS Domain The content of this note is now obsolete. Current information can now be found on the Process page.
An EROS domain is made up of three nodes: the domain root, the general registers node, and the key registers node. There are three kinds of constraints on the content layout of these nodes: - Requirements for the domain to be well-formed.
- Universal slot usage conventions, which apply to all architectures.
- Slot usage conventions that apply to all 32-bit architectures.
- Slot usage constraints that are specific to a particular implementation.
1. Well-Formed DomainsIn order to be well-formed, a domain must meet the following constraints: The domain root node must have a read-write node key in slot 14. The node in this slot will act as the general registers node. The domain root node must have a read-write node key in slot 15. The node in this slot will act as the key registers node. Note 1: we are contemplating a design change in which a zero number key would be permissable in slot 15 to reduce the overhead of rehosted programs, which neither send nor receive messages. In the event that a zero number key was present and the domain was not marked as "foreign," the domain keeper would be invoked if a reference was made to the domain's key registers. The domain root node, general registers node, and key registers node (if present) must be distinct. All keys in register slots must be number keys. Register slots include all slots in the general registers node, and those slots in the domain root designated as holding register values, whether or not those slots are used by a particular architecture. All keys in reserved slots must be zero number keys.
A domain is checked to verify that it is well-formed whenever an operation is performed on a start key, resume key, or domain key. If the domain is discovered to be malformed, it is placed in a faulted state, and will not execute instructions until corrective action is taken. If a valid keeper key is present, the keeper will be invoked to inform it of the fault. 1.1 Non-Requirements:In spite of what you might reasonably expect, the following are not required in order for a domain to be well-formed: - A valid address space key. A domain without a valid address space key simply does not fetch instructions.
- A valid schedule key. A domain without a valid schedule key simply does not fetch instructions.
- A valid keeper key. The absence of a keeper key is only an issue when the domain takes a fault. If no keeper can be notified, the domain simply becomes unable to execute instructions.
2. Universal Slot Usage ConventionsAll implementations impose the following usage constraints on the slots in a domain root. Slots shown as "reserved" must hold a zero number key until these features are implemented. Domain Root| Slot | Usage | Slot | Usage |
|---|
| DR0 | Schedule Class key | DR8 | Register slot Bytes 0-3: order/return code Bytes 4-7: invocation ctrl block Bytes 8-11: Invoked key slot | | DR1 | Keeper key | DR9 | Register slot Bytes 0-3: PC Bytes 4-7: SP | | DR2 | Address space key | DR10 | Architecture Defined | | DR3 | Reserved for Symbol table space key. | DR11 | Architecture Defined | | DR4 | Brand key | DR12 | Architecture Defined | | DR5 | Number key providing trap code and associated information | DR13 | Reserved for alternate message buffer key. | | DR6 | Register slot Message receive descriptor. | DR14 | General registers Node key (if present) | | DR7 | Register slot Message send descriptor | DR15 | Key registers Node key (if present) | 2.1. Send and Receive InformationThe message send and receive information share a common structure for nibbles 0 through 15. These nibbles are used as follows: Send and Receive Information Description| Nibble | Meaning |
|---|
|
| 0-3 | Size of sent/received string buffer | 4 | Slot of 0th sent/received key | | 5 | Slot of 1st sent/received key | | 6 | Slot of 2nd sent/received key | | 7 | Slot of 3rd sent/received key | | 8-15 | Address of string send/receive buffer | | 16-23 | Available for architecture-specific use | Note that the send and receive information blocks correspond to specific registers in the implementation architecture. Two common message cases are messages that pass no keys and messages that pass no string. The layout of the send and receive information blocks is designed to map neatly onto a 32-bit register set to minimize the number of registers clobbered by the message mechanism in these cases. 2.2. Invocation Control BlockOnly the bottom three bytes of the invocation control block register have defined values. The remaining bytes must be zero. The invocation control block controls both the invocation and the send and receive of message strings, and is layed out as follows: Invocation Control Information| Nibble | Meaning |
|---|
| 0-3 | Key data (returned) | | 4 | Send control block. Values are:| Value | Meaning |
|---|
| 0x0 | Omit | | 0x1 | Send from buffer |
| | 5 | Receive control block. Values are:| Value | Meaning |
|---|
| 0x0 | Omit | | 0x1 | Receive to buffer |
| | 6 | Invocation type. Values are:| Value | Meaning |
|---|
| 0x0 | Invocation is a reply | | 0x1 | Invocation is a call | | 0x2 | Invocation is a fork | | other | Undefined |
| | 7 | Zero | 3. Common 32-bit Architecture ConstraintsSlot 9 of the domain root is reserved in all 32-bit architectures to contain the values of the PC and SP registers. This is to simplify the construction of domain generation tools by keeping registers that support concepts common to all 32-bit machines in common slots. This, on 32-bit architectures, the layout of this slot is as follows: Slot 9 Conventions| Byte | Meaning |
|---|
| 0-3 | PC value | | 4-7 | SP value | | 8-11 | Implementation defined | 4. i386/i486/Pentium Domain LayoutThe following tables give the register layouts used on the i386 family of processors. Layout inherited from above is included in normal face, and machine-specific additions are is shown in boldface. Domain Root| Slot | Usage | Slot | Usage |
|---|
| 0 | Schedule key | 8 | Bytes 0-3: %eax Bytes 4-7: %ebx Bytes 8-9: %ebp | | 1 | Keeper key | 9 | Bytes 0-3: %eip Bytes 4-7: %esp Bytes 8-9: %cs Bytes 10-11: %ss | | 2 | Address space key | 10 | Bytes 0-3: %EFLAGS Bytes 4-7: zero Bytes 8-11: zero | | 3 | Zero number key | 11 | Zero number key | | 4 | Brand key | 12 | Zero number key | | 5 | Trap code | 13 | Zero number key | | 6 | Bytes 0-3: %ecx Bytes 4-7: %edi Bytes 8-9: %ds Bytes 10-11: %es | 14 | Gen regs node key | | 7 | Bytes 0-3: %edx Bytes 4-7: %esi Bytes 8-9: %fs Bytes 10-11: %gs | 15 | Key regs node key | As it happens, all of the integer machine registers fit in the domain root on the x86 family. Registers associated with auxiliary components, such as the floating point unit and the hardware debugging registers are kept in the general registers node. Whether to reload the floating point registers can be determined by examining the bits in the EFLAGS register. Given all of that, the layout of the general registers shown below may make more sense. General Registers| Slot | Usage | Slot | Usage |
|---|
| 0 | Bytes 0-3: %fdp Bytes 4-5: %fds Bytes 6-7: %ftag Bytes 8-9: %fstatus Bytes 10-11: %fctrl | 8 | Floating Reg 0 | | 1 | Bytes 0-3: %fip Bytes 4-5: %fcs Bytes 6-11: zero | 9 | Floating Reg 1 | | 2 | Zero number key | 10 | Floating Reg 2 | | 3 | Zero number key | 11 | Floating Reg 3 | | 4 | Zero number key | 12 | Floating Reg 4 | | 5 | Zero number key | 13 | Floating Reg 5 | | 6 | Zero number key | 14 | Floating Reg 6 | | 7 | Zero number key | 15 | Floating Reg 7 | Copyright 1998 by Jonathan Shapiro. All rights reserved. For terms of redistribution, see the GNU General Public License |