Spork Code

Code. Randomness. Sporks.

Run Your Own Virtual Lisp Machine

with 2 comments

I came across a really interesting project the other day (while browsing Hacker News) by a guy named Brad Parker. Basically, he is writing a specialized virtual machine for CADR (which was an OS for the now defunct Lisp Machines of the 80s). The project has plenty of bugs left for squashing, but in its current state it works quite well. Here’s how to set up your own virtual Lisp Machine.

As always, we have some tarballs to grab:

# this is the VM itself
wget http://www.unlambda.com/download/cadr/usim.tar.gz

# this is a disk image for the VM. If you prefer, you can
# build one of these yourself (there is some documentation on the website)
wget http://www.unlambda.com/download/cadr/disks/disk-with-state.tgz

Now let’s untar them:

tar -xvvf usim.tar.gz
tar -xvvf disk-with-state.tgz

We need to copy the resulting disk.img and usim.state into the /usim directory, because otherwise the ./usim executable we will be using complains about missing .bin files. The usim.state file contains the state of the disk.img; without it you wouldn’t be able to boot the image.

cp disk.img usim/disk.img
cp usim.state usim/usim.state

Ok, now all that is left is to boot up your virtual Lisp Machine:

cp usim/

# this command boots your Lisp Machine in a X window.
./usim -w

The VM should prompt you for the current time, which you can enter in plain English and it will parse for you. Unfortunately, It doesn’t seem as though the original creators of the OS thought that anyone would be using it in 2009, as when you enter 2009 as the year, it thinks you are living some time in the 19000th century. Yes, with 3 zeros. Be forwarned that there are some graphical glitches with the VM, but nothing that a ^C or two won’t fix.

If you are feeling particularly rebellious and you don’t want to use the default disk.img and supplied disk state, you can always make your own. Generating a new disk state is a simple ./usim -S away. Making a new disk is slightly more complicated, but still not particularly bad. you can find documentation on how to do so here.

If you are interested in reading up on CADR, here is the original paper on it (be forewarned, it is quite technical).

What Now?
So now you have your beautiful Lisp Machine up and running, its time to learn some LISP. The manual for programming this Lisp Machine can be found here.


Written by John Gunderman

July 12, 2009 at 3:02 pm

Posted in Uncategorized

Tagged with ,

2 Responses

Subscribe to comments with RSS.

  1. There is ZERO theory on how the VM is architected. What is the design? What are the books or papers to read.


    September 29, 2016 at 10:10 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: