The actual SCHEMESTATION simulator consists of two programs. These programs are the domain simulator ss and the network simulator ssnetsim. Both programs utilize also a third program, namely the SCHEMESTATION console ssconsole, but it does not need to be started manually and can be seen as a part of the other programs.
Domains can be run without the network simulator. However, in such a case different domains cannot communicate between anothers. Usually the network simulator is used.
The network simulator is used to simulate a virtual network where the SCHEMESTATION domains connect to. It is implement on the top of TCP/IP communications. The network simulator opens a port that it listens to, and the domain simulators connect to it in order to connect to the virtual network. All data between different domains is then actually transferred via the network simulator. This gives the possibility to gather statistical data about inter-domain communications and to observe the workings of the distributed system easily.
Both the network simulator and the domain simulator are UNIX processes. The overall picture resulting is shown in Fig. 1.
The network simulator is started from the UNIX command line with the command ssnetsim. The simulator accepts certain command-line options. In the absence of all options, the simulator sets as its own domain address to be Network----AAAAAAAAAAA in the SCHEMESTATION base 64 encoding, and begins to listen the TCP/IP port number 7000. (In principle, the network simulator is also a SCHEMESTATION domain. Thus, in principle, it can be extended to communicate with casual SCHEMESTATION agents. However, this is sort of meta simulation and is perhaps not interesting.) It also opens a console window where it shows information about connected domains and transferred packets. The statistics are updated every two seconds.
A summary of the few command line options can be got, as usual, by ssnetsim --help. The network simulator does not need the standard input/output streams after it has been started, so it can be easily started on background. The simulator can be terminated by clicking the appropriate command button in the console display, or by sending an interrupt signal.
Here is an actual snapshot of the network simulator console display:
The first line shows the domain address of the simulator itself and also features the exit button. Lines below correspond to connected domains, one line for one domain. The first number at the left is the ordinal number of the connection. Most recently connected domains are shown first. Next comes the connected domain's domain address, then the corresponding domain simulator's IP address and the port where it has connected. Then come statistics about packets sent, received and redirected as well as byte counts.
A SCHEMESTATION domain simulator is started from the UNIX command line with the command ss. The domain simulator supports certain command line options. A summary of them can be got, as usual, by ss --help. They are also described below.
There are two kinds of boot-ups for a SCHEMESTATION domain. First, the initial boot-up, and second, a system wake-up. During the initial boot-up, a domain that has not existed before is created. System wake-ups occur when a domain that has been temporarily freezed starts working again and the persistent agents stored continue execution from the point where they were left when the system went down. In the simulation the freezing essentially means saving the entire state of the simulator to disk: agents and their heaps, addressing system and all such. [Network connections need not to be saved as they are automatically opened upon request.]
When you start a domain simulator, you must do, thus, either an initial boot-up or a wake-up. Initial boot-up is specified by giving the "--new=true" switch (can be abbreviated to "-N", and that is set by default if you do not specify a core file name). Wake-up requires a core file that contain the image of the state to be recovered. The name of the core file is specified by the option "--core=FILENAME" (can be abbreviated to "-c"). If you give a core file name, it is also used as the name for a core file name created during shutdown.
If you start a virgin domain (i.e. do an initial boot-up), you need to configure the newly created domain by giving certain command line options, such as specifying the domain address of the domain. You do not need to give the options again when you wake the domain up after a shutdown, as they are saved as a part of the domain's state.
The easiest way to start a fully functional domain instance that does not need the virtual network simulator is, assuming that you have correctly built the distribution,
ss -T -i -b -O
Here, -T denotes that you want a terminal, -i that you do not want to connecto the network, -b that you want a status bar display, and -O that you want to run an object server. See the discussion below for a comprehensive listing of all the command line options provided.
System shutdown is initiated by an agent with sufficient priviledges. In the SCHEMESTATION simulator the user has always an access to such an agent. The agent program shutdown.ssbc shuts down the domain where it is run. The shutdown that takes place is a "persistent" shutdown, i.e. a core file is created. If the current domain was once recovered from a core file, the same core file name is used. Otherwise the core file name is derived from user name and the current date, except if another name has been explicitly specified via the -c switch.
SchemeStation simulator can be also stopped by sending one of the SIGINT, SIGHUP and SIGTERM signal to it, but the no core file created.
SCHEMESTATION is an operating system, and thus it is a little dubious to talk about "using" SCHEMESTATION in any particular way, as you can e.g. tweak the kernel code to do whatever you wish. Starting new agents, communicating with them and observing their workings can be seen, however, as the principal usage of the SCHEMESTATION simulator. This section describes these things in the default setting.
First, you start up the domain. You type in the shell ss -T -i -b -o, and soon a terminal window appears. It should look like this:
Here we see a login window, and a piece of fine poetry. The login window is actually a non-op. Write whatever you wish there. After pressing return twice, the login window disappears and you get a shell. After that, the top of the terminal should look like this:
From the shell, you can start new agents. For example, if you wish to run the program blop.ssbc (comes in the distribution), you type the name to the shell and press return. After a while, the program starts to run, opening a window and beginning to increment a number in it. Then the top of the terminal should look like this:
You can see three "buttons" in the right ends of the title bars. The first button, [+], increases the size of the window. The next, [_] hides the window. If you hide a window, the title of the window appears in the "task bar" in the bottom of the terminal. You can then get the window back by clicking on the title there. The last button, [X] destroys the window. Usually the application using the window exits then also, but it is of course completely in the discretion of the individual program.
You can also see that the title bars come in two different colors. The window with a blue title bar is the current "focus window". When you type text, the focus window receives the text you write. You can change the focus window by clicking on the title bars.
In order to program agents for the SCHEMESTATION [simulator], it is important to understand the general internal structure of a SCHEMESTATION domain, as well as the main features of the operating environment.
The SCHEMESTATION kernel is responsible for one domain. The kernel itself is a set of agents, although special ones; it is possible to communicate with the kernel by the same way of message passing as with other agents. The main kernel agent is called the core domain kernel agent (CDK). Other kernel agents exist also, for example the terminal device driver.
Usually a kernel agent has as its counter-part a kernel-implementing agent. Kernel-implementing agents are standard agents, running on the top of the virtual machine. They communicate with their corresponding kernel agent parts. Kernel-implementing agents are used to provide more convenient interfaces and to implement functionality that does not necessarily be implemented as a code in the (C-)kernel. For example, the kernel-implementing agent corresponding to CDK is the domain kernel interface agent (DKI).
Agents are asynchronous processes that communicate with other agents via message passing. Usually agents execute on the top of the SCHEMESTATION virtual machine. The exceptions to this rule are (1) kernel agents and (2) external agents. For kernel agents, see above. External agents are described later. They are external programs that get an agent interface inside a SCHEMESTATION domain.
Object servers are an integral part of the SCHEMESTATION operating environment. They act much as files servers, but have more general functionality. They are capable of storing and retrieving arbitrary objects. In this way, object servers can act as conventional file servers (by storing strings), as domain name servers (by storing domain addresses), as agent address servers (by storing agent addresses), etc.
Normally an object server is started during boot time via the -O command line switch. The object server that is started is just a normal agent, but the kernel knows that it works as an object server and thus gives it treatment according to that. Agents communicate with the object server agents just normally via message passing. There are functions in the SCHEMESTATION Scheme standard library that make accessing object servers easy (see below).
One way to access the system's obejct server is to run a program from the shell, because the "program" is an object that is fetched from the object server. This happens behind the scenes in this case, though, so you do not necessarily "see" it happen.
Agents are run by asking the kernel to start a new agent. The agent is specified either by directly sending the byte code object to the kernel, or by specifying an ID corresponding to an object in the object server used by the domain kernel. As a simulator user you have full access to the domain kernel and can thus spawn arbitrary agents as you wish. One way to ask the kernel to start a new agent is to use the shell. The SCHEMESTATION Scheme standard library includes a function that you can use very conveniently to start an agent, see blow.
The casual SCHEMESTATION agents are byte code programs that run on the top of the SCHEMESTATION virtual machine. This section describes the structure of agents and of the virtual machine, to the extent that is required in order to understand how new agents can be designed.
An agent has a theoretically infinite amount of memory that is a garbage-collected list-structured heap. The byte code program of the agent accesses and modifies this heap when run: new objects can be created and older accessed, modified, and deleted by losing the last references to them. The objects in the heap are dynamically typed, i.e. the type information of an object is saved automatically in the heap also. The heap can contain objects of the following types:
The agents are able --- in addition to fiddling with their own heap --- to send and receive messages. Messages are arbitrary heap objects that are passed around between (different) running agents. However, procedures may not be included in messages due to well-understandable reasons (the heaps of different agents are not shared between).
Sending messages is easy. There is a virtual machine instruction that can be used to send an arbitrary message to an arbitrary address. This instruction is mapped to a procecure send-message that is available in the cross-compiler (see below).
Messages are received as exceptions. When an agent is being delivered a message and its exceptions are enabled, the agent's exception handler is started. The handler gets the message as its argument, and then the agent may do whatever it wishes to the message in the handler. When the exception handler returns exceptions are enabled again and a new exception can take place.
However, normally messages are not actually processed in the exception handler. Instead, the default exception handler (produced by the compiler) puts all messages it receives to a message queue that is maintained in the agent's heap, and then just returns. The items in this queue can be read and removed one by one in a way that if the queue is empty, the agent stops execution and moves to a blocking state. In a blocking state the only thing that can make agent proceed further is getting and exception. The exception can then cause the message queue to get a message and then the agent can continue to run.
This procedure is not enforced by the virtual machine but is implemented in the compiler. Of course, other exception handling mechanisms can be implemented by the user.
New agents are created by compiling Scheme source code into byte code objects. The byte code objects are then incorprated via object servers into the operating system and made available. The byte code objects can be "executed", i.e. the programs contained in the objects can be started as agents.
The byte code objects are created by compiling Scheme source code. This compilation happens currently outside the SCHEMESTATION simulation, i.e. in the underlying UNIX environment using the supplied SCHEMESTATION cross-compiler ssc.
ssc is invoked using the syntax
ssc [file | option] ...
where are the source code files to be compiled and options are options that control the behaviour of the compiler. The following options are recognized:
The source code files must have the suffix ".ssscm" in their names. This suffix is replaced with ".ssbc" to get a name for the byte code object file resulting. For example,
ssc foo.ssscm
compiles the file foo.ssscm in the current directory and, if the compilation succeeds, output the resulting byte code object file to foo.ssbc.
ssc understands roughly the Scheme programming language as specified in the Revised4 Report on the Algorithmic Programming Language Scheme. Certain differences exist due to needs that are SCHEMESTATION-specific. These differences are summarized here; more elaborate description of the dialect and different features follow later.
The core syntactic forms provided by the compiler in any setting are the following:
On the top of the core syntactic forms, a set of standard syntactic forms is defined by using the macro system. The definitions of these forms are included in compilation by default; there is a compiler flag that can be used to disable the inclusion.
The macro system of the SCHEMESTATION cross-compiler is very much like the macro system described in the appendix of R4RS. It is a hygienic macro system, meaning that identifier names introduced in different contexts cannot clash even if the read the same. The implication of this is that whatever names can be used as local variables introduced in macros; they will not clash with the same names injected into the macro expansion from the outside via a macro parameter.
Macros can be defined using let-syntax, letrec-syntax and define-syntax. let-syntax defines a set of local macros that are in effect inside the body of let-syntax. letrec-syntax does the same but the macros defined can be mutually recursive. define-syntax is used to define a global macro that is in effect after the definition. In order to avoid certain surprises that could result when referring to a global macro before its definition, it is recommended that all global macros be defined at the beginning of a program. This is not enforced, though.
In all the macro-defining forms the actual macro definition(s) are done according to the same syntax:
macro definition = (name (literal ...) ((pattern template)...))
name is the name of the macro. Following is a possibly empty list of literals, which are special keywords that the macro wants to recognize. For example, for the derived syntactic form cond these keywords are "else" and "=>", as they have a special meaning inside the cond macro.
After the literals list, there is a set of pattern-template pairs. When the macro is being expanded, the patterns are matched against the actual invokation of the macro. If a matching pattern is found, the macro invokation is replaced with the corresponding template. If multiple patterns are found the first one in the macro definition is used. If no patterns matchin the invokation are found there is an error and the compilation is aborted.
The patterns are about as in R4RS and the templates as well. Consult the report for details.
The core procedures described here are implemented more or less directly on the top of the virtual machine and are always available.
The cross-compiler can produce several error and warning messages. Usually the messages are self-explanatory. However, a message about "internal compiler error" means that there is a bug in the compiler and that the bug was detected by an internal consistency check. If you encounter internal compiler errors, please report them to our help desk (see above).
The SCHEMESTATION standard library consists of miscallenous and more or less useful procedures that are distributed along with the compiler. Technically the library consists currently of procedure definitions that can be included in a program, for example by using the include syntactic form. The standard library needs to be recompiled every time it is used in a program because the simulator does not support, at least yet, linking of pre-compiled program pieces together. The library consists of multiple files. They can be included separately, or the file stdlib.ssscm can be included in order to include a certain subset of the files; see below.
File: carcdr.ssscm; part of the SCHEMESTATION compiler standard library
File: asynchronous.ssscm; part of the SchemeStation compiler standard library
File: control.ssscm; part of the SchemeStation compiler standard library
File: display.ssscm; part of the SchemeStation compiler standard library
File: exceptions.ssscm; part of the SchemeStation compiler standard library
File: lists.ssscm; part of the SchemeStation compiler standard library
File: misc.ssscm; part of the SchemeStation compiler standard library
File: read.ssscm; part of the SchemeStation compiler standard library
File: standard-agent.ssscm; part of the SchemeStation compiler standard library
File: strings.ssscm; part of the SchemeStation compiler standard library
File: text.ssscm; part of the SchemeStation compiler standard library
The following example agent writes a new number on its window every 400 ms. This agent is also found from the distribution; the source file is in schemestation/station/scheme-src/blop.ssscm.
;;; Blop |
The agent works as follows. When it starts running, someone (e.g. the shell) sends it the address of a terminal controlling agent in a TCAad message. This message is captured in the message handler whose definition begins (define-handler "TCAad"... The agent stores the address of the TCA to the variable TCA-address, and then requests the TCA to create a window that has the title Blop and is two rows high (see the used messages list below).
When a window has been created, a TCAwc message is sent back to the agent. From this message the agent gets the address of an agent that is created to control the particular window that was opened for the Blop agent. Having the window, the agent starts its cycle where it prints a new number to the window every 400 ms. This cycle is implemented in the make-blop procedure, which calls itself indirectly recursively via the timeout mechanism provided by the standard library (see above).
The messages sent between Blop and the rest of the system are sketched in Fig. 2.
This sections describes shortly all Scheme agents that are a part of the distribution.
$ migrate.ssbc 5 daisy
meaning that you would like to see the agent that has the scheduling indentifier 5 to be moved to the domain that has the abstract domain name "daisy". You can inspect the current processes in a domain (and their scheduling identifiers) via another program, top (see below).
$ blop.ssbc
($ is the prompt) would start running the Blop agent (see above). You can also type exit to exit from the shell (if you do not want to do that by deleting the shell window, which causes the shell to exit also). For your convenience, you can also migrate the shell to another domain by simply typing e.g.
$ > daisy
($ is the prompt again), where daisy is now the abstract domain name of the domain where you want your shell jump to. The shell detects the change of the domain and starts to communicate with the new, local DKI.
This chapter documents the messages that are used in the example programs distributed.
Message: ("CA" arguments)
Name shortcut for: Command-line Arguments
Description: This message is sent to an agent when it has been started
from a shell-like program; ARGUMENTS is a list of strings that
the user has supplied as command-line arguments.
Message: ("CDKacr" domain address new-domain new-address)
Name shortcut for: Core Domain Kernel Address Control Remap
Description: As DKIacr, but passed from a DKI to a CDK.
Message: ("CDKeir" address)
Name shortcut for: Core Domain Kernel External agent Interface Running
Description: This message is sent by a DKI to a CDK to inform that
a previously requested external agent interface agent is now running
and has the address ADDRESS.
Message: ("CDKpir" address)
Name shortcut for: Core Domain Kernel Process Information Request
Description: As DKIpir, but passed from a DKI to a CDK.
Message: ("CDKrkq" domain)
Name shortcut for: Core Domain Kernel Remote Kernel Query
Description: This message is sent to a CDK by the corresponding DKI in order
to query for the address of the DKI of the remote domain that
has the domain address DOMAIN. The CDK answers with DKIrka.
Message: ("CDKru" id address)
Name shortcut for: Core Domain Kernel RUnning
Description: This message is sent by the CDK to the DKI to denote that
the agent that was requested to start executing, associated with
the identifier ID, is now really running and has the address
ADDRESS.
Message: ("CDKsd")
Name shortcut for: Core Domain Kernel ShutDown.
Description: This is as DKsd, but passed from a DKI to a CDK.
Message: ("CDKsl" message)
Name shortcut for: Core Domain Kernel System Log message
Description: As DKIsl, but passed to a CDK by a DKI.
Message: ("CDKto" id)
Name shortcut for: Core Domain Kernel TimeOut
Description: This message is sent by a CDK to an address that has requested
the deliver of a timeout message some time ago. ID is the same integer
that was supplied in the DKItr (or CDKtr) message.
Message: ("CDKtr" address time id)
Name shortcut for: Core Domain Kernel Timeout Request
Description: This is actually the same message as DKItr,
but understood by the CDK instead of the DKI.
Message: ("DKIacr" domain address new-domain new-address)
Name shortcut for: Domain Kernel Interface Address Control Remap
Description: This message is sent to a DKI in order to note that
the remote address DOMAIN:ADDRESS points actually to
NEW-DOMAIN:NEW-ADDRESS. It is sent to a domain when a domain
is sending messages to DOMAIN:ADDRESS instead of sending them
directly to NEW-DOMAIN:NEW-ADDRESS; the intention is to let
the receiving domain change its address table and thus optimize
messaging cost by dropping one level of indirection.
Message: ("DKIdkc" address)
Name shortcut for: Domain Kernel Interface Domain Kernel Changed
Description: This message is sent to an agent after it has been migrated
to a new domain. ADDRESS contains the address of the DKI in the
new domain. It is up to the receiving application to decide
what to do with this information.
Message: ("DKIosa" address)
Name shortcut for: Domain Kernel Interface Object Server Address
Description: This message is sent by a DKI as a response to a previously
received DKIosar message. ADDRESS is the address of the
locally used object server, or #f if no object server is
in use (which is a very rare occasion).
Message: ("DKIosar" address)
Name shortcut for: Domain Kernel Interface Object Server Address Request
Description: This message is sent to a DKI to query for the address
of the object server used in the corresponding domain.
The response is sent with the message DKIosa to
ADDRESS.
Message: ("DKIpir" address)
Name shortcut for: Domain Kernel Interface Process Information Request
Description: Sent to a DKI in order to request information about the processes
(agents) running currently in the domain of the DKI.
Process information is returned by sending a DKpi message
to ADDRESS.
Message: ("DKIrka" domain address)
Name shortcut for: Domain Kernel Interface Remote Kernel Address
Description: This message is sent to a DKI by a CDK in order to deliver
the address of the DKI of a remote domain. (The CDK is able to construct
such an address due to the fact that DKI's have local addresses zero
by convention.) DOMAIN is a domain address and ADDRESS the address
of the DKI in the domain.
Message: ("DKIsl" message)
Name shortcut for: Domain Kernel Interface System Log message
Description: This message is sent to the DKI by any agent. It requests outputting
the message MESSAGE in the system log.
Message: ("DKItr" address time id)
Name shortcut for: Domain Kernel Interface Timeout Request
Description: This message is sent to a DKI in order to request the delivery
of a timeout message to ADDRESS after TIME milliseconds.
The message ("CDKto" id) is sent to ADDRESS after
TIME ms. ID must be an integer.
Message: ("DKIx" template address)
Name shortcut for: Domain Kernel Interface eXecute
Description: This message is sent to a DKI to request the execution of an agent
whose code is found from a local object server with an identifier
matching TEMPLATE. When the agent has started, a DKIru message
is sent to ADDRESS.
Message: ("DKcd" type address)
Name shortcut for: Domain Kernel Control Device
Description: This message is sent to the DKI by the CDK in order to request
the DKI to get control over a device whose low-level device driver
is found from the address ADDRESS. TYPE is the type of the device.
(Currently, only the type "terminal" is understood.)
Message: ("DKgei")
Name shortcut for: Domain Kernel Get External agent Interface agent
Description: This message is sent by the CDK to the DKI in order to
request the spawning of a new generic external agent interface agent.
Message: ("DKin" key value)
Name shortcut for: Domain Kernel INformation
Description: This message is sent by the CDK to the DKI to pass information
about the current status of the system. KEY is a string that describes
what kind of information is provided in VALUE. The following keys
are used:
Message: ("DKpi" id name status frac id name status frac ...)
Name shortcut for: Domain
Kernel Process Information
Description: This is sent by the core domain kernel
as a response to a DKIpir/CDKpir message. The
contents of the message describe the currently existing processes. ID
is the scheduler identifier of particular process. NAME is the name of
a process as supplied originally by the compiler (actually it is the
first entry in the constants table of the running agent's heap).
STATUS is the status of the process and can be one of the following: 1
= no agent (should not be sent), 2 = running, 3 = running with
exceptions disabled, 4 = blocking (i.e. waiting for a message), 5 =
dead (should not be sent). There are as many (ID NAME STATUS FRAC)
quadruples as there are processes running in the local domain.
Message: ("DKsd")
Name shortcut for: Domain Kernel ShutDown
Description: This message is sent to a DKI in order to request domain shutdown.
Message: ("DKwe" address)
Name shortcut for: Domain Kernel WElcome
Description: This message is sent to every ordinary agent as the first message
a new agent ever receives. It contains the address of the agent itself.
Message: ("MIdo" address domain agent-object)
Name shortcut for: MIgration DO
Description: This message is sent by a DKI to another DKI in order to
transport an agent object during migration. ADDRESS is the local address
the agent had in the sending domain as a bit string in order
to prevent address remapping. DOMAIN is the domain address
of the sending domain. AGENT-OBJECT is the agent object to transport.
Message: ("MIin" address domain agent-object)
Name shortcut for: MIgration INitialize
Description: This message is sent to a DKI by the corresponding CDK in order
to transport an agent object to another domain. AGENT-OBJECT is
a packed agent that had the local address ADDRESS and should be
transported to the remote domain having the domain address DOMAIN.
Message: ("MIok" original-address new-address new-domain)
Name shortcut for: MIgration OK
Description: This message is sent by a DKI that has received a new agent,
by migration, to the DKI of the domain that sent the agent.
ORIGINAL-ADDRESS is the local address the agent had before migration
in the old domain, NEW-ADDRESS is the new local address in the
new, current domain and NEW-DOMAIN is the domain address of the
new domain.
Message: ("MIre" address domain agent-object)
Name shortcut for: MIgration REceive
Description: As MIdo, but passed from the receiving DKI to the corresponding
CDK.
Message: ("MIss" original-address new-address original-domain new-domain
new-address-*)
Name shortcut for: MIgration SuccesS
Description: This message is sent by a CDK to the corresponding DKI after
an agent has been succesfully received. ORIGINAL-ADDRESS is the
address the agent had before being transported to the current domain.
NEW-ADDRESS is its new address in the local domain.
Similarly, ORIGINAL-DOMAIN is the domain where the agent came from
and NEW-DOMAIN is the current domain address. NEW-ADDRESS-* is
as NEW-ADDRESS but is of the actual address type, whereas NEW-ADDRESS
is a bit string without address tag in order to prevent it from
being remapped later.
Message: ("MIst" address domain)
Name shortcut for: MIgration STart
Description: This message is sent to a DKI in order to start migrating
the agent that has the local address ADDRESS to the domain having
the domain address DOMAIN.
Message: ("MIsti" id domain)
Name shortcut for: MIgration STart with Identifier
Description: This message is sent to a DKI in order to start
migrating the agent that is running with the scheduler identifier
ID in the current domain to the domain having the domain address
DOMAIN.
Message: ("OSad" identifier object)
Name shortcut for: Object Server ADd
Description: This message is sent to an object server to request the adding
of the object OBJECT, indexed by the identifier IDENTIFIER, to the store.
Message: ("OSfe" address template)
Name shortcut for: Object Server FEtch
Description: This message is sent to an object server to fetch an object
whose identifier matches TEMPLATE. The object server returns
an object by sending the message OSfr back to ADDRESS.
Message: ("OSfr" template object)
Name shortcut for: Object Server Fetch Result
Description: This message is sent by an object server as a response
to a previous OSfe message. TEMPLATE is the template
that was given and OBJECT is an object that was found from the
object server's store, associated with an identifier that
matches TEMPLATE. If there was no object with a matching identifier,
this message is still sent; object is then the boolean false #f.
Message: ("OSin" filename object)
Name shortcut for: Object Server INject
Description: This message is sent to an object server to request the insertion
of the object OBJECT that was read from a UNIX file named FILENAME.
It is equivalent to ("OSin" (("filename" filename)) object).
Message: ("OSqr" template matching-identifiers)
Name shortcut for: Object Server Query Result
Description: This message is sent by an object server as a response
to a previous OSqu message. TEMPLATE is the template
that was given and MATCHING-IDENTIFIERS is a set of identifiers
that match TEMPLATE and that are found from the object server's store.
Message: ("OSqu" address template)
Name shortcut for: Object Server QUery
Description: This message is sent to an object server to query for a set of
identifiers that match the template TEMPLATE. The object server
returns the list of matching identifiers (either all of them
or a subset at its own discretion) by sending the message OSqr
back to ADDRESS.
Message: ("OSre" template)
Name shortcut for: Object Server REmove
Description: This message is sent to an object server to request
the removal of all objects whose identifiers match TEMPLATE.
Message: ("TCAad" address)
Name shortcut for: Terminal Controlling Agent ADdress
Description: This message is sent to an agent to pass the address of a TCA
forward. (It is required if the agent needs to e.g. open a window.)
Message: ("TCAcd" address)
Name shortcut for: Terminal Controlling Agent Control Device
Description: This message is sent to a TCA to inform that the TCA should
take over the control of a terminal device driver whose address
is ADDRESS.
Message: ("TCAcw" title height address id)
Name shortcut for: Terminal Controlling Agent Create Window
Description: This message is sent to a TCA in order to request
the creation of a new window, whose title is TITLE, height originally
HEIGHT lines and that has the identifier ID.
Message: ("TCAkp" key)
Name shortcut for: Terminal Controlling Agent Key Press
Description: As TDDkp, but sent by a TCA.
Message: ("TCAmc" x y button)
Name shortcut for: Terminal Controlling Mouse Click
Description: As TDDmc, but sent by a TCA.
Message: ("TCAwc" user-id address)
Name shortcut for: Terminal Controlling Agent Window Created
Description: This message is sent after a TCA has created a new
window. The message is sent to the address that was given in the
corresponding TCAcw message. USER-ID is the identifier
the using application supplied in the TCAcw message, and
ADDRESS is the address of the agent controlling the newly
created window.
Message: ("TCAwin" TCA-address id user-id address)
Name shortcut for: Terminal Controlling Agent Window INitialize
Description: This message is sent to a window controlling agent, which is
an agent taking care of one window displayed on a terminal controlled
by a TCA. The purpose of the message is to initialize the agent.
TCA-ADDRESS is the address of the TCA, ID is an id invented
by the TCA, USER-ID is a window identifier invented by an application
requesting the window creation, and ADDRESS is the address where
information about the window should be sent, in particular,
a TCAwc message.
Message: ("TCAwiw" id x y string fg bg)
Name shortcut for: Terminal Controlling Agent Write In Window
Description: This message is sent to a TCA in order to request
the agent to draw the string in the window with the identifier
ID at position (X, Y) with the foreground color FG and background
color FG. This message is mainly used by the window controlling agent
and should not be used for other purposes, otherwise the terminal
can get messy.
Message: ("TCAwk" id)
Name shortcut for: Terminal Controlling Agent Window Kill
Description: Sent to a TCA,
request the deletion of the window that has the identifier ID.
Message: ("TCAwrs" new-height)
Name shortcut for: Terminal Controlling Agent Window ReSize
Description: Sent to a window controlling agent by the TCA, inform the
agent that the size of the window as displayed on the terminal has
changed to NEW-HEIGHT and the window should be redrawn.
Message: ("TDDcf" width height)
Name shortcut for: Terminal Device Driver ConFiguration
Description: Report the configuration of the hardware device driver, i.e.
the size of the terminal. This message is sent to a TCA by
the terminal device driver special agent.
Message: ("TDDkp" char)
Name shortcut for: Terminal Device Driver Key Press
Description: This message is sent to a TCA from a terminal device driver.
It is used to announce that the user has pressed the key CHAR.
Message: ("TDDmc" x y button)
Name shortcut for: Terminal Device Driver Mouse Click
Description: This message is sent to a TCA from a terminal device driver.
It is used to announce that the user has clicked the BUTTONth button
of a pointer device at position (X, Y).
Message: ("TDDqc")
Name shortcut for: Terminal Device Driver Query Configuration
Description: Sent to a terminal device driver, request the driver to send
a TDDcf message to the corresponding TCA.
Message: ("TDDsc" address)
Name shortcut for: Terminal Device Driver Set Controller
Description: Sent to a terminal device driver, tell the driver that
it is from now on controlled by the TCA in address ADDRESS. From
receiving this message on, the driver sends e.g. all mouse-click and
key-press events to the given ADDRESS.
Message: ("TDDws" x y string fg bg)
Name shortcut for: Terminal Device Driver Write String
Description: Request the string STRING to be displayed on the terminal
at position (X, Y), drawn with foreground color FG and background
color BG.
Message: ("TWcl")
Name shortcut for: Terminal Window CLear
Description: Sent to a window controlling agent, request the contents
of the window to be emptied.
Message: ("TWsc" amount)
Name shortcut for: Terminal Window SCroll
Description: Sent to a window controlling agent, request the contents
of the window to be scrolled AMOUNT lines upwards.
Message: ("TWw" string x y)
Name shortcut for: Terminal Window Write
Description: Sent to a window controlling agent, request the string STRING
to be display at the position (X, Y), relative to the upperleft
corner of the window. The change in the window contents is cached,
as opposed to the (not very useful) TWws.
Message: ("TWwl" line)
Name shortcut for: Terminal Window Write Line
Description: Sent to a window controlling agent, request the line
LINE to be displayed at the bottom of the window after the
old contents
have been scrolled up once.
Message: ("TWws" string x y fg bg)
Name shortcut for: Terminal Window Write String
Description: Sent to a window controlling agent, request the string STRING
to be display at the position (X, Y), relative to the upper-left corner
of the window, with foreground color FG and background color BG.
This message bypasses the contents caching normally applied
by the window controlling agent and is no longer very useful.
The kernel provides an interface for external agents to directly connect to the system. The external agent can show as members of that domain in the SCHEMESTATION system. The communication between the external agent and the domain will be done through a unix socket. The networking module will provide the way for the external agents to connect and register themselves.
The scheme used is quite simple: the external agent programmer requests the ssextagent-library to open a connection to the specified SCHEMESTATION domain. After that he can both send and receive byte-string messages using the descriptor of that connection. The read facility is non-blocking, while writing is done in possibly-blocking manner.
The external agant interface is rahter simple and provides no support for the SCHEMESTATION data structures such as heaps. The users of the external agent interface are urged to write some kind of interface agents in scheme, through which the external agents should communicate with the rest of the world.
To use the external agent interface in a C program, the user has to include the ssextegent.h file included in the distribution, and link the libssextagent.a to the executable.
There is a more detailed description of the external agent interface in [External Agent Interface Specification and External Agent Interface Implementation].
In order to use the underlying unix system's file system from the SCHEMESTATION domain, one can use the external file server agent that comes with the distribution.
The SCHEMESTATION system includes an object server (Operating system specification). Since the Operating System specification requires the system to be persistent, there has to be some backup mechanism for the objects.
Also, since the compiler has not yet been ported to be a native part of he system, there has to be a way to import bytecode files to the system.
The files system acts as an gateway from the SCHEMESTATION system to the underlying unix file system. The user may access the files inside the domain communicating through the interface agent of the external agents'.
The file server external agent executable can be started using the following command line swithces:
The exact protocol between the client agent and the file server is specified in [External agents].
More detailed description on the file server is in [External agents].
The TCP server gives the SCHEMESTATION the ability to do any kind of TCP communication. Once the server is started, it begins waiting for a command for the interface agent. The interface agent may instruct the server to begin listening for a local TCP port, or to directly connect to a remote port. The result of a listen request is either a success acknowledgement, or an error message.
If a connection occurs to a listened port, or when an explicitly requested remote connection is succesfully opened, the server acknowledges the interface agent with a open-acknowledgement, which includes the port to which the connection was established (either the local port that was listened for, or the remote port, where the connection was requested to), possibly the remote host (if the ack corresponds to a remote open request) and the connection number, with which the interface id is supposed to later address the connection.
The interface agent may thereafter send packets to the open connection giving the connection number, the length of the data and the data itself.
The interface agent receives similar messages when data arrives to the port.
The TCP external agent executable can be started using the following command line swithces:
The external agent interface to the native scheme agent is best illustrated through an example. For this reason, we have included an http server in the distribution. It can be inspected in [Code browser: httpd.ssscm].
More detailed description on the TCP server is in [External agents].
Problem | Tentative solutions |
---|---|
I try to start a domain, but I "can't connect to the virtual network." | (1) You do not have the network simulator running. You need
to start it first, if you are going to use the
network. Start ssnetsim.
(2) You actually do not want to have a network simulator, and try to run the station without, but have not given the -i switch. Set -i, and the station does not try to connect to the network. (3) You have set incorrectly the TCP/IP address and/or the port of the simulator. See the domain simulator command line options. |
I try to start a domain, but it seems that "the terminal cannot be spawned." | The most probable reason is that the ssconsole program is not in your path. Set your path to include schemestation/bin. |
I still do not get a terminal. | You need an X server to use the terminal. Make sure your DISPLAY environment variable points to the right X server. |
I tried to write my first Scheme program, but the compiler would not compile it. | (1) You have misbalanced parenthesis in your program.
Add yet one more ')'!
(2) Check the error messages provided by the compiler. (3) Try to run your Scheme program in another Scheme interpreter, e.g. VSCM, if that would describe the problem better. |
To me, the external agent interface seems fairly cumbersome. | (1) Tough.
(2) Oh yeah? Write your own one! |