Klein Metacircular Virtual Machine Kit
Building and running Klein
Downloading the Klein source code
You can download Klein here.
Building the Klein debug server
- Use Apple's Xcode to open up the klein_C_code.xcodeproj file in the klein_C_code/xcode/klein_C_code directory.
- Make sure that the active target is "OSX debug server", and that the active build configuration is "Release" (we've had problems using it in Debug mode - it tends to put the Klein image at too high an address in memory, which Klein isn't smart enough to be able to handle yet).
- Click "Build".
Filing the Klein source code into Self
The Klein development and build environment runs inside Self, so you will need to:
- Download Self and install it.
- Execute the Self code
Building Klein inside Self
- Start the Self desktop if it is not already started (run the code
desktop open ).
- Right-click the background and choose "Klein host" from the menu. A yellow box should come to your hand, with the status message, "down: connect failed: EINVAL". This yellow box represents the Klein debug server.
- Open a Terminal window, navigate to the self/bin/mac_osx directory, and run the kleinDebugServer executable that you built earlier. (Leave the Terminal window open.) The yellow thing's status message should change to "up on a PPC".
- Right-click the yellow box and choose "Get program." Then choose the image you wish to build. (The full Klein VM is named "selfVM".) A green box should appear; this represents the Klein image.
- Wait for the build process to complete. (This may take a while for a large image - on a 1.33 GHz G4 Powerbook, it takes about ten minutes to build the full selfVM image.) The build process is complete when the status line on the green box says "ready".
- Pick up the green thing and drop it on the yellow thing. A green debugger should appear.
- Click "Continue" to make the Klein process start running.