Brad Parker’s usim is a nice C-language emulator for the first Lisp Machine first broadly produced, the MIT-CADR. It’s said that by 1978 upwards of 25 were produced at MIT, pretty much making it the first ‘production’ Lisp Machine. The subsequent commercial Lisp machines much of their origins from the CADR, so it’s very interesting to see where most of the ideas started.
I’ve been developing a variation of Brad’s usim emulator that fixes a few bugs and repairs problems with the keyboard mapping for X11. My slightly kluged version can be found here; it’s not tested to work on anything but Ubuntu Linux 18.04. Your mileage may vary!
Nevertheless, this version is pretty easy to build and run without fiddling with the Makefile:
$ tar -zxf usim-20200810.tgz | Unpack code |
$ (cd usim/chaos; make) | Compile chaosnet daemon |
cd usim; make | Compile usim emulator |
chaos/chaosd & | Run chaosnet daemon in background |
./usim | Run the emulator! |
Shortly we’ll see the CADR emulator running. Here I overlaid the terminal window output to get an idea of what you should see there:
Type in the current time and date. We should note that this version of the MIT code isn’t yet Y2K compliant, so it won’t properly display the year in date/time fields.
Let’s look at the code pre-installed on the disk image:
(login ‘bowb) | Tell the CADR who we are |
F2-e | System-E – run Zmacs |
Meta-X | Invoke Zmacs Extended command |
dired | Run ‘dired’ subprogram |
local:>*.*.* | In Dired, match all files at the root on the ‘local’ filesystem |
DireD and Lisp Machine demos
Dired commands are pretty similar to those in LambdaDelta, though ‘E’ doesn’t work, so browsing is a bit more of a hassle. Let’s browse to the demonstrations and see what we can find:
Meta-X dired | create another dired window |
local:>lmdemo>*.*.* | match all files in subdirectory LMDEMO |
So let’s load the worm demo into the buffer and compile. Just like the version of Zmacs on the Lambda, click on WORM.LISP to select, or use the spacebar to push the selection cursor down to that line. Then press ‘E’ to edit. Note that this emulator requires a bit of a hold of the left-mouse button to get the selection block to move.
We can compile the whole file using Zmacs:
Meta-X Compile File | Compile File extended command |
<return> | Use default buffer (local:>lmdemo>worm.lisp) |
F2-l | Flip back into Lisp listener |
(hacks:worm) | Run ‘worm’ demo from the ‘hacks’ namespace |
q | quit ‘worm’ |
Usim will get flaky (particularly the chaosnet daemon) after a while, so it’s a good idea to periodically restart everything. I’m sure there’s a way to fix it, but I’ll admit I’m less interested in debugging C-code than Lisp. That being said, let’s next demo the chaosnet file server and read some stuff into the CADR.
Loading a file from Linux into the emulator
When your usim is stopped, copy the file promh.9 into /tmp, then restart usim:
(login ‘bowb) | Identify ourselves to CADR |
(si:set-sys-host “server” ‘:unix 0404 “//”) | Associate name ‘server’ with a |
unix machine at chaosnet address 0404 | |
with the base of the shared hierarchy | |
at “//” | |
F2-e | Start Zmacs |
Ctrl-X Ctrl-F | Find File |
server:/tmp/promh.9 | Path in unix for promh.9 on fileserver ‘server’ |
<return> | CADR will demand a password; just use |
empty string. |
I haven’t yet been able to ‘complete the circle’ and recompile all the source code using Brad’s instruction, but I think we’re at a good stopping point for me, and a good launching point for your own MIT-CADR Lisp machine!
Happy hacking!