Building a Cog Development Image

The Cog VM source is in a Squeak Smalltalk Monticello package at http://source.squeak.org/VMMaker.  Load the newest version of  VMMaker.oscog, e.g. VMMaker.oscog-eem.1893 (*).

Building the image manually is tedious.  Fortunately an automated build in Squeak 5.0 is provided in the image subdirectory of http://www.github.com/OpenSmalltalk/opensmalltalk-vm.

$ git clone http://www.github.com/OpenSmalltalk/opensmalltalk-vm
$ cd opensmalltalk-vm/image
$ ./buildspurtrunkvmmakerimage.sh

 

This almost works perfectly; but…
  • on Windows you’ll need to use Cygwin and install wget, e.g. from from http://gnuwin32.sourceforge.net/packages/wget.htm, probably as http://downloads.sourceforge.net/gnuwin32/wget-1.11.4-1-setup.exe
  • the second part of the build loads VMMaker.oscog and the support packages.  During this you’ll get prompted for your initials.  Supply some to proceed.
Once you’ve built a VMMaker image, read the class comments of StackInterpreterSimulator and CogVMSimulator for running the simulator.  Alternatively use the example expressions in VM Simulation Workspace.text.  Slang test expressions are provided in Slang Test Workspace.text.   Test expressions that run the JIT to produce machine code disassembly from methods in the image are provided in In-image Compilation Workspace.

    The VM source is generated from as VMMaker.oscog image whenever required.  For the official source tree, which resides on github (see http://www.mirandabanda.org/cogblog/compiling-the-vm/) this is done by core developers on an as-needed basis.  For one’s own development, generate the source as and when you see fit.  For much of the time one can develop a VM using there simulator, but soon enough one will want to generate a real VM or have to debug the real VM because while the simulator is powerful, it is slow and of necessity incomplete (for example, the simulator cannot yet simulate FFI calls).

    (*) The VMMaker package is for the Interpreter VM and the VMMaker-oscog package is an obsolete version of the Pharo version of Cog.

    PDF24    Send article as PDF