[squeak-dev] step through VM source

David T. Lewis lewis at mail.msen.com
Mon Jul 27 11:31:15 UTC 2009


On Mon, Jul 27, 2009 at 03:51:35AM -0700, Ang Beepeng wrote:
> 
> I was looking at Croquet VM source code and stepping through the code. It
> seems like the interpret() loops forever, while I expect to find a point
> where it finished initialization and wait for user input. 
> 
> I know that it loops forever, but what is the VM doing before it gets any
> input from the user?

In a nutshell, the VM starts up, loads the image file into memory, and sets
up various things that the interpreter is going to need in order to run. It
then enters the interpreter loop, and it's all Squeak from then onward.
Input event handling, process scheduling, and all the rest are handled by
the running Smalltalk system, which is basically the interpreter animating
the objects in object memory and responding to external stimuli.

You can follow the startup logic by looking through the platform support
code for whatever platform you may be using. For example, if you are using
a unix VM, the main() routine starts in platforms/unix/vm/sqUnixMain.c, and
shows the main steps involved in setting things up prior to entering interpret().

Dave




More information about the Squeak-dev mailing list