Virtual Computer (was Re: Interpreter plug-ins)

Reinier van Loon R.L.J.M.W.van.Loon at inter.nl.net
Fri Apr 10 10:32:21 UTC 1998


Taking into account all the remarks about the VM I think we're actually
designing a virtual computer.

The standard way a hardware computer starts is like this:
After power-up the processor starts reading instructions from a well-known
address (either hardwired into the processor or by shortwiring a few
outside lines). The code which is then executed is called bootcode. The
bootcode knows what to do to start another program (i.e. jump into ROM
(C64) or load code from a disk (BIOS), etc). 

To get back to the thread about plug-ins:

The power-up of a VM is nothing more than starting a program in the current
platform. This program is the bootcode. The only function of the bootcode
is to boot the operating system, in our case SqueakOS. SqueakOS is a
program which is only capable of loading, unloading and starting executing
of other programs/libraries (maybe even thread support). SqueakOS is
configurable via for example a configuration file (SqueakOS.cfg) which
states which plug-ins to load and which plug-in to start. The very first
plug-in is probably the Interpreter.

Once the Interpreter is started we're in the Squeak world of Smalltalk. It
would be nice if we designed a standard startup for a common Interpreter,
e.g. evaluate Session class>>start. From this method we could check if the
following plug-ins are available: SqueakNetwork (sqnet), SqueakGUI (sqgui),
SqueakFile (sqfile), SqueakConsole (sqcon), SqueakDevelopment (sqdev)
etc.). Or we could use a file (Squeak.cfg) to state what to do.

When running under another operating system we don't need the bootcode
(only on a bare chip).

To get things working we might:
1) write a program in ANSI C called SqueakOS which 
	- supports primitives support;
	- supports 3 primitives: load, unload, start;
	- reads a file called <executable name>.cfg (default) or the file named in
the first command-line parameter;
	- loads the files named in the configuration file;
	- transfers control to a loaded file.

    Sample configuration file:
    ---------------------------
    SqueakVM load.	"load the interpreter"
    SqueakVM start.	"start the interpreter"

    SqueakVM load.			"load the interpreter"
    SqueakVM start: Session start.	"start the interpreter with sending the
message Session start"
    ---------------------------

2) put the interpreter in a file called SqueakVM which
	- has a main function called start();
	- supports all primitives needed for running bytecodes;
	- loads the base image;
	- performs the message in the command-line (e.g. Session start) or
continues at the program counter (default)

Now we're in the position to let Squeak start up inside Squeak.

Cheers, Reinier.

---
Want to express your thoughts? Use Smalltalk.
---
Reinier van Loon (rvloon at inter.nl.net or reinier at 2share.com)
Squeak Download Area at
http://web.inter.nl.net/users/R.L.J.M.W.van.Loon/Squeak/download.html





More information about the Squeak-dev mailing list