Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Port of CADR source (open source Lisp Machine code) to OS X 10.5
branch: master
Failed to load latest commit information.
win32 first cut of ported code
Makefile first cut of ported code
README Adding instructions for installing SDL first.
cadr_1.bin first cut of ported code
cadr_2.bin first cut of ported code
cadr_3.bin first cut of ported code
cadr_4.bin first cut of ported code
cadr_5.bin first cut of ported code
cadr_6.bin first cut of ported code
cadrmem.c first cut of ported code
chaos.c first cut of ported code
chaos.h first cut of ported code
config.c first cut of ported code
config.h first cut of ported code
decode.c first cut of ported code
disk.c first cut of ported code
diskmaker.c first cut of ported code
diskmaker_old.c first cut of ported code
div.c first cut of ported code
endian.h first cut of ported code
fadd.txt first cut of ported code
iob.c first cut of ported code
kbd_new.c first cut of ported code
kbd_old.c first cut of ported code
keyboard.cfg first cut of ported code
keyboard.h first cut of ported code
lmfs.c first cut of ported code
logo.h first cut of ported code
macro.c first cut of ported code
main.c first cut of ported code
poo.html first cut of ported code
promh.9 first cut of ported code
promh.sym.9 first cut of ported code
readmcr.c first cut of ported code
sdl.c first cut of ported code
syms.c first cut of ported code
template.disk1 first cut of ported code
template.disk2 first cut of ported code
template.disk3 first cut of ported code
template.disk4 first cut of ported code
template.disk5 first cut of ported code
ucadr.lisp.841 first cut of ported code
ucadr.mcr.841 first cut of ported code
ucadr.mcr.896 first cut of ported code
ucadr.mcr.979 first cut of ported code
ucadr.sym.841 first cut of ported code
ucadr.sym.979 first cut of ported code
ucode.c first cut of ported code
ucode.h first cut of ported code
usim.h first cut of ported code
x11.c first cut of ported code


CADR simulator
Brad Parker

What is this?

This is a program designed to emulate the MIT CADR microprocessor
hardware.  A CADR is a second generation MIT lisp machine.  A good
description can be found in "A.I. Memo 528" from the MIT AI Labs
entitled, "CADR".

The CADR was a 32 bit microcoded microprocessor designed to run the
lisp language.

This program interprets the microcode found in the machine starting
with the "prom" microcode which runs when the machine is first powered
on.  The prom microcode loads additional microcode from the simulated
disk and then boots the load band.

There is sufficient hardware support for the disk and network to
provide a reasonaly functional lisp machine experience.


Grab the pre-made disk image with a warm start file (disk-with-state.tgz) and
run as "./usim -w". Enter the data and time and press "F1" and "F7" to
clean up the display. You're up!

If you want to use the network download and run chaosd.  Read the
"README" in the disks subdirectory on the http server.

Compiling for the Mac

First you will need SDL. The easiest way to get it is through MacPorts

sudo port install libsdl-framework
sudo port install libsdl

then run 'make clean' followed by 'make'. Then simply follow the Quickstart guide!

Recent Changes

v0.9 - minor speedups.
       Mac OSX (little endian) fixes.
       Warm start support (usim.state)
       Mouse/microcode synchronization (thanks to Devon for the idea)

v0.8 - speedups and bug fixes;  chaosd/FILE server supports rebuilding
       sources from server.  can now resize screen.

v0.7 - added raw X11 support.  Bjorn's new keyboard configuration code.
       diskmaker now takes a template file and will show info on existing
       disk images.

v0.6 - better network support


Unix, Linus, OS X:

There are three defines at the top of the Makefile you should check.
They are OS, DISPLAY and KEYBOARD.  OS should be set automagically.

The X11 display works but the keyboard mapping is not correct yet.  Both
the OLD and NEW keyboard code works, I would recomment using NEW.

Once the Makefile is changed just type "make".


I used a VC 6.0 project to make under win32.

Making a disk

I would recommend using the distributed disk.img unless you understand
the structure of a CADR disk.  The program "diskmaker" will interpret
a disk image partition table and make a new disk using a template file.

The distributed disk was made using "template.disk1".  The template file
basically feeds all the parameters to diskmaker to build a valid disk
image an populate it with microcode and a load band.


Everything basically works.  The simulator will boot a load band and talk
on the (simulated) network.

The emulation is reasonably complete (modulo bugs).  It gets through the
prom code, loads the microcode band, copies the band to swap and
executes the load band cleanly.  The system boots and runs.

The code was originally written to run on x86 linux using SDL and X
Windows.  It's since been ported to run on OS X and Win32, both with
SDL libraries.  A native X11 interface has also been added.  It should
compile and run on X86 linux, Win32 and and OS X.

The console display is drawn into an X window (using SDL) which tracks
the mouse and keyboard.  The simplest way to run it is


You can turn off the mouse synchronization with the "-m" option.

If you want to see a trace of macrocode function names try:

	./usim -n -Tl >output

If you want to see a voluminous trace of every microcode instruction

	./usim -n -t >output

You can make a warm start state file with

	./usim -S

Run the emulator, enter the date and time.  The ^C twice.  The memory state
will be saved in "usim.state".  You can then warm start to come up

	./usim -w

Note that the warm start state file is intimately connected to the
disk image.  If the two are mismatched bad things will happen.  The two
files should be portable across X86, Win32 and Macintosh.

The disk emulation reads from a 'disk image' file which is constructed
with 'diskmaker'.  The disk image looks like a Trident T-300 disk
to the microcode, complete with a parition table.

The display board and iob are emulated.  An X window displays in
monochrome at 768x1024.  The mouse and keyboard are tracked.  The
keyboard is "mapped" to the old Knight keyboard or new style depending
on compilation options.

The internal microsecond clock and the 60hz tv interrupt currently try
and use wall clock time for a more realistic simulation.

There is also emulation of the chaosnet board.  Packets are sent via a
unix socket to a "chaosd" daemon which distributes them to various
client programs (see the chaos directory).

There are some hacks for noticing unibus access but no xbus/unibus
mapping support.  The two machine lash-up/debug interface is not (yet)
supported.  I want to add this, however.

There's still a long delay when booting the distributed world.  The
system is available right away, however, try "F2-p".  If you are
impatient try the warm start state file, but be sure to use it with
it's matching disk.img.

What needs to be done?

- cleanup mouse emulation
- speed up the network emulation
- speed up the microcode simulation

The keyboard mapping has been cleaned up by Bjorn Victor (thanks!).  The
latest (v0.7+) code uses the "keyboard.cfg" file to map the PC keyboard
onto the lispm keyboard.

Some default keys:

f1	terminal
f2	system
f3	network
f4	abort
f5	clear_input
esc	Alt Mode
f1	Terminal
f2	System
f3	Network
f4	Abort
f5	Clear Input
f6	Help
f7	Page
pgup	Break
pgdn	{appears to crash usim}
home	Call
end	End
backspace rubout
backspace Rub Out

Terminal-M	Toggle **MORE** processing.
Terminal-0-M	Disable **MORE** processing.

The mouse emulation works but doesn't track exactly.

What programs are here?

usim		- the CADR emulator
diskmaker	- program to make CADR disk images from .mcr files and
		  .lod files
lod		- utiltity to pick apart load bands and show their insides
lmfs		- raw hack to read files from LMFS paritition

Standing on the Shoulders of Giants

I would like to thanks the following people for helping me on this, er,

Tom Knight
Howard Shrobe
Richard Greenblatt
Danial Weinreb
Al Kossow
George Carrette
Steve Krueger
Alastair Bridgewater
John Wroclawski
Bjorn Victor
Devon Sean McCullough

Without their support or encouragement I would probably not have done
this.  Certainly if Al had not sent me the prom images I would never
have started.  And without Dan's box-of-tapes I could never have
succeeded.  RG offered some good explainations when I was confused.
TK and Howie were extremely supportive at the just right moment (and
answered a lot of email).  George offered many good suggestions and
answered lots of questions. Steve helped me locate missing pages from
"memo 528".  Alastair did some amazing work on several explorer
emulators.  Bjorn has used the code, offered many suggestions, fixes
and improvements.  And John's office is where I first saw a 3600
console and said, "what's that?".
Something went wrong with that request. Please try again.