usim

Documentation
Login

MIT CADR simulator

This program was originally written by Brad Parker brad@heeltoe.com , and is designed to emulate the MIT CADR microprocessor and hardware peripherals. The CADR is a second generation MIT Lisp Machine, and a good description can be found at https://tumbleweed.nu/r/lm-3/uv/cadr.html.

There is sufficient hardware support for the disk and network to provide a reasonably functional Lisp Machine experience.

Getting started (quickly)

Please see the README in the l project for how to quickly get up and running.

How to compile

usim supports multiple backends for keyboard, video (tv) and mouse support. When compiling, one of these backends has to be used. At the moment, there are three backends:

usim Makefile has following targets:

Thus, for example, make x11 builds usim using x11 backend, readmcr and diskmaker tools.

Configuration of usim (usim.ini)

When usim starts, it tries to read usim.ini which is a INI style configuration file consisting of sections, and key/value pairs.

usim section

ucode section

chaos section

disk section

trace section

idle section

kbd section

X11 and SDL2 backends

This maps X11 keys to a corresponding key in the simulator. The left-hand side is an X11 key name, the right-hand side is a Lisp Machine character name that will get inserted.

For example, to map a few host Fn-functions keys to provide access to keys that are not available on PC keyboards:

[kbd]
F1 = system
F2 = network
F3 = status
F4 = terminal
F5 = help
F6 = clear
F7 = break
F10 = hold_output
F11 = abort
F12 = resume

To insert the alpha character when pressing a key that is mapped to Alpha in X11:

Greek_alpha = alpha

SDL3 backend

This maps SDL3 keycodes to space-cadet keyboard scancodes. SDL3 keycodes identify layout independent physical keys on a keyboard. Space-cadet keyboard scancodes also identify the physical keys.

The left-hand side is a SDL keycode name, the right-hand side is a space-cadet scancode name. For example:

[kbd]
F9 = top
F10 = greek
F11 = hyper

Any key on the keyboard can be mapped to any space-cadet key including function and modifier keys. Thus, SDL3 backend does not use kbd.modifiers section.

In order to help creating a custom mapping, if kbd facility is enabled in trace at debug level, all SDL keycode names are printed. All space-cadet scancode names can be found in sdl3_keyboard_cadet_scancodes.defs file.

kbd.modifiers section

(kbd.modifiers section is not used by SDL3 backend)

This maps X11 modifiers to the corresponding bucky key in the simulator. The left-hand side is an X11 modifier name (Mod1, Mod2, ...), the right-hand side is a corresponding to a Lisp Machine bucky key.

Not all bucky keys are supported by all keyboard types. There is also no support currently to differentiate between left and right bucky keys.

Available modifier masks from X11 are: Shift, Lock, Control, Mod1, Mod2, Mod3, Mod4, Mod5.

Available bucky keys: Shift, Top, Control, Meta, ShiftLock.

Cadet specific bucky keys: ModeLock, Greek, Repeat, AltLock, Hyper, Super.

Simulator keyboard bindings

X11 and SDL2 backends

All keys have been mapped so that they should work mostly as advertised. Not all keys have been mapped to the host; e.g., Call or Altmode on the Knight.

X11 Modifier have been mapped as follows, depending on the type of Lisp Machine keyboard currently in use:

Host Knight Cadet
Shift Shift Shift
Lock Shift Lock Caps Lock
Control Control Control
Mod2 (Alt) Meta Meta
Mod4 (Super) Top Super

Some additional keys that are hard to type, or do not have a corresponding key on a normal PC keyboard have been mapped as well.

Host Knight Cadet
F1 Top-Escape System
F2 Top-Break Network
F3 n/a Status
F4 n/a Terminal
F5 Top-H Help
F6 Clear Clear-Input
F7 Break Break
------------ ---------- ------------
Page Up Top-Call Abort
Page Down Resume
Home Break
End Top-CR End

SDL3 backend

A default mapping is provided in sdl3_keyboard_default_mapping.defs file, and it includes:

The modifiers are mapped as follows:

Host Cadet
Shift Shift
Ctrl Ctrl
Super Super
Alt Meta
Caps Lock Caps Lock

Some additional keys that are hard to type, or do not have a corresponding key on a normal PC keyboard have been mapped as well.

Host Cadet
F1 System
F2 Network
F3 Status
F4 Terminal
F5 Help
F6 Clear-Input
F7 Clear-Screen
------------ ------------
Escape Alt Mode
------------ ------------
Home Break
End End
Page Up Abort
Page Down Resume
------------ ------------
Left Hand Left
Right Hand Right
Up Hand Up
Down Hand Down

What programs are here?

Debugging utilities:

Release History

v0.10 - TBD

v0.9 - Minor speedups. Mac OSX (little endian) fixes. Warm start support (usim.state). Mouse/microcode synchronisation (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 Victor's new keyboard configuration code. Diskmaker now takes a template file and will show info on existing disk images.

v0.6 - Better network support.

Standing on the shoulders of giants

I (Brad Parker) would like to thanks the following people for helping me on this, er, project:

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 Daniel's box-of-tapes I could never have succeeded. RG offered some good explanations when I was confused. TK and Howard 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?".