PREVIOUS

Creating an object

The domain is the microkernel primitive used to implement new kinds of objects. Upon invocation of a gate key, the message is delivered to and interpreted by code which is obeyed by that domain.

To create an object: Put the code to instruct the object in a segment (perhaps just a page); request a new domain and accept the domain service key. With the domain service key -

Now the start key may be passed to intended users of the object.

The program segment of a domain is typically read-only if several domains are to obey the program. If the program has store instructions a write-able address segment must be provided for the domain. One may do this by providing, for each domain, a private segment the domain can store into and composing the domain’s address segment from that segment and the shared read-only program segment. Alternatively, one may create a “copy on write” segment keeper which will share all pages which are only read, but create write-able private pages upon stores.

Many simple objects can be implemented in assembler so as to require no private pages. Such programs have no store instructions as the domain’s address segment consists of just read-only pages (frequently, only one). Objects of this simple type all share the same read-only segment. Such objects typically occupy from 200 to 700 bytes of individually dedicated disk storage.

Usually, programmers work at a higher level and these segment planning details are handled automatically.

In contrast to the Smalltalk object [8], there are no “variables” local to the start key invocation. There are, however, variables that keep their values between invocations (like “own” variables in Algol 60).

A start key to a domain conveys no authority to examine the state of the domain or to examine the domain code. In a computer supporting two non-privileged instruction sets, the set employed by a given domain would not be visible, given start keys to the domain.

NEXT