Skip to content

Instantly share code, notes, and snippets.

@oubiwann
Last active August 29, 2020 23:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oubiwann/25ed46df972b8b55068cecce6dda9676 to your computer and use it in GitHub Desktop.
Save oubiwann/25ed46df972b8b55068cecce6dda9676 to your computer and use it in GitHub Desktop.
Setting Up an MIT CADR Machine (emulation)

Setting Up an MIT CADR Machine (emulation)

Reference

Most of this was taken from the project instructions here:

Other materials referecned:

This gist isn't intended as a repacement for any of the above, rather a convenienceto easly re-use later (and share with others).

Dependencies

  • X11 / XQuartz
  • the fossil DVCS

On Mac:

brew install fossil

Setup and Download

mkdir -p ~/lab/lisp-machine
cd ~/lab/lisp-machine
fossil clone https://tumbleweed.nu/r/usim usim.fossil
mkdir usim
cd usim
fossil open ../usim.fossil
cd ..

fossil clone https://tumbleweed.nu/r/chaos chaos.fossil
mkdir chaos
cd chaos
fossil open ../chaos.fossil
cd ..

fossil clone https://tumbleweed.nu/r/sys78 sys78.fossil
fossil clone https://tumbleweed.nu/r/usite usite.fossil
mkdir sys78
cd sys78
fossil open ../sys78.fossil

mkdir site
cd site
fossil open --nested ../../usite.fossil
cd ../..

cd usim

Depending upon what version of usim you're using, you may not need to do this next step. On Mac OX X, you may need to update the Makefile to look for the lib and include files where your Mac them. In particular, you may need to change the following:

--- Makefile
+++ Makefile
@@ -6,11 +6,11 @@
 LISPM_SYSTEM = 7800L

 CC = gcc -std=gnu99
 CC += -Wall -Wextra

-CFLAGS = -ggdb3 -O0 -I/usr/X11R6/include -DLISPM_SYSTEM=$(LISPM_SYSTEM)
+CFLAGS = -ggdb3 -O0 -I/usr/X11R6/include -I/opt/X11/include -DLISPM_SYSTEM=$(LISPM_SYSTEM)
 CFLAGS += -I. $(CHAOS_CFLAGS)

 all: TAGS usim readmcr di diskmaker lod

 $(CHAOS)/libhosts/libhosts.a:
@@ -39,11 +39,11 @@
 USIM_UCH11 = uch11.o chutil.o challoc.o chdopen.o chopen.o MINI.o FILE.o glob.o

 usim.o: CFLAGS += -DVERSION=\"$(VERSION)\"
 usim: usim.o ucode.o mem.o iob.o mouse.o kbd.o knight.o cadet.o tv.o x11.o $(USIM_UCH11) disk.o ini.o ucfg.o trace.o disass.o syms.o misc.o \
 	$(CHAOS)/libhosts/libhosts.a
-	$(CC) $(CFLAGS) -o $@ $^ $(CHAOS)/libhosts/libhosts.a -lpthread -lX11 -L/usr/X11R6/lib
+	$(CC) $(CFLAGS) -o $@ $^ $(CHAOS)/libhosts/libhosts.a -lpthread -lX11 -L/usr/X11R6/lib -L/opt/X11/lib

 readmcr: readmcr.o disass.o misc.o syms.o
 	$(CC) $(CFLAGS) -o $@ $^

Then you can procede with the build:

make CHAOS=../chaos
wget --no-check-certificate				\
     https://tumbleweed.nu/r/sys78/uv/disk.img.gz	\
     https://tumbleweed.nu/r/sys78/uv/usim.ini
gunzip disk.img.gz

Starting CADR and Logging In

./usim

You'll then see output like this in your terminal:

CADR emulator v0.9-ams; using System 78.00 definitions.
disk: opening disk.img as unit 0
disk: all disk units are mapped to unit 0
...

And then an X window will pop up for CADR. If this is the first time you do this, it will be a cold boot, so it will take a few minutes. Once it's done booting, you will see:

Screenshot 2020-08-29 at 5 15 26 PM

Mine says System 78.50 and Microcode 841, which I believe puts the release date in 1982 somewhere. The corresponding Chineual would then be the 4th Edition.

At this point, you're ready to log in to the system:

(login "oubiwann")

Once you're logged in with your desired user name, you can check that you have a user ID with the following:

:user-id

To get a list of features of the Lisp environment (provided as a compatibility with Maclisp):

(status features)

Running ZWEI

You can start up the MIT CADR's EMACS clone called "ZWIE" (successor to "EINE" or "EINE Is Not EMACS"):

(ed)

Take care with the commands, though: lazy <CTRL>-pressing habbits will backfire on you!

Screenshot 2020-08-29 at 6 32 54 PM

@oubiwann
Copy link
Author

oubiwann commented Aug 29, 2020

Paste-bin for images, to use in the README ...

Screenshot 2020-08-29 at 5 15 26 PM

Screenshot 2020-08-29 at 6 32 54 PM

@oubiwann
Copy link
Author

oubiwann commented Aug 29, 2020

Things to experiment with:

  • ZWEI ((ed))
    • Save a file
    • Quick the editor
    • Load the file
  • Run a Zetalisp program
    • Create a lisp file
    • Compile it
    • Run it
  • Saving the world
    • Creating partitions (going to try (lmfs:fsmaint-fs-initialize) ...)
    • Loading a saved world
  • Connecting to the host machine (e.g., to read files)
    • Best way to do this?
    • I did see that the Chineual says UNIX hosts are supported ...
    • Not sure if the emulated machine does, though?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment