Giter Club home page Giter Club logo

usim's Introduction

MIT CADR simulator -*- org -*-

What is this?

This is a program was originally written by Brad Parker <[email protected]>, and is designed to emulate the MIT CADR microprocessor hardware and peripherals. The CADR is a second generation MIT Lisp Machine, and a good description can be found at https://lm-3.github.io/cadr.html .

This program interprets the microcode found in the machine starting with the boot PROM 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 reasonably functional Lisp Machine experience.

Building

UNIX-like systems:

Just run “make”.

Everything else:

Unsupported.

Quick-start

Build usim and all related code as described above. Then download the PROM, microcode and load bands from https://github.com/LM-3/bands.git, by default diskmaker assumes that the bands/ directory is located directly below the usim source code directory (usim/../bands). You can also use a configuration file and customize the disk image, see the bands/disk.cfg fuke for an example.

./diskmaker -c

When you have created a disk image you can run usim, and it will boot up to a time/date prompt. The format of the date and time is quite flexible (see SYS: IO1; TIMPAR LISP), one possible format is:

Jan-3-1980 11:30

Now you have a working CADR system, it will not have network setup, or a local file system, this will be described later in this section.

Here are a simple few things to try (in the Listener you don’t need to type Enter after closing a Lisp form):

(ed) ; Start Zmacs; it works just like any other Emacs. (hacks:demo) ; A few Lisp Machine demo programs.

Here are some interesting keybindings to try in the Listener, see the “Keyboard bindings” section of this document:

System-L ; Switch to the Listener. System-E ; Switch to Zmacs. System-P ; Peek program, show internal system information. System-? ; Show what System commands are available.

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

For more details see the Lisp Machine Manual (https://lm-3.github.io/lmman.html).

To get usim talking to the host you need to build the chaos daemon and related programs from http://github.com/lm-3/chaos. Build it as per the instructions in the README file and then start the chaosd daemon (just run ./chaosd where you build it) in another terminal window, you must start chaosd before starting usim (this is a bug, see #—!!!).

Your CADR has the host name “CADR” (Chaos address: 0401) , and the host where usim is running is called “SERVER” (Chaos address: 0404).

Once your CADR is up and running running, in the listener type:

(si:set-sys-host “server” ‘:unix 0404)

Answer Yes when asked if this is host is OK. This is to set the SYS host accordingly so that the system knows where it can look for files. You can now login as LISPM onto the host SERVER using, USER is your local user name (and if you are asked for a password, it is also your local password):

(login ‘USER ‘server)

Now you can read/write files form the host system, the format for Unix pathnames is HOST:/DIRECTORY/FILE.EXTENTION. N.B. Slashes in a string in Lisp have to be escaped!

To edit the file /tmp/foo.lisp on the host SERVER, we can type the following form:

(ed “server://tmp//foo.lisp”)

Or if we are in Zmacs, we can enter (note the lack of escaped slashes):

C-x C-f server:/tmp/foo RET

This is a fully usable system, but it has no site associated with it yet. A site defines where to find system source code, the timezone, and a bunch of other things (see SYS: SITE; SITE LISP or the Chinual for details).

To finish of a complete, but basic setup we need load a site file and save our current setup (so we don’t have to do everything again), first download the system source code from http://github.com/lm-3/chaos/sys.

By default, the system source code is assumed to be stored in /tree on the host, if you want to relocate this you will need to modify the lmsite/site.lisp file accordingly.

The following two forms are only required if you didn’t keep usim running from the previous setup:

(si:set-sys-host “server” ‘:unix 0404) (login ‘USER ‘server)

Load the site file and make the system aware of its new surroundings. The system doesn’t know how to translate logical pathnames yet, so we need to specify the actual location:

(load “server://tree//lmsite//site.lisp”) ; Replace with actual location! (fs:define-sys-logical-device)

Recompile a few required files, and update internal state (this only needs to be done once, or when you modify the site definition):

(qc-file “sys:site;site lisp >”) (qc-file “sys:site;hsttbl lisp >”) (qc-file “sys:site;lmlocs lisp >”) (si:update-site-configuration-info)

Now you can save the current system, and make it current:

(si:disk-save 2) ; Answer yes to clobber. (set-current-band 2)

Or if you just wish to try it out (you can make it current later):

(disk-restore 2)

Now all the fun can finally start since we can access the system source code, to see what the function SI:SET-SYST-HOST does we can issue the following in the Listener:

(ed ‘hacks:demo)

Or why not, open a file:

(ed “sys: sys; qmisc lisp”)

The final step is to update the system to the latest patch level (—!!! see system-patch-dir file?). This is left as a small exercise for the reader, you need to do the following steps:

  1. Compile all the patch files in SYS: PATCH.
  2. Run the LOAD-PATCH function.
  3. Save and make current the world again (just like above).

Keyboard bindings

Keys are mapped in the following manner by default:

esc Alt Mode f1 Terminal f2 System f3 Network f4 Abort f5 Clear Input f6 Help f7 Page f8 f9 f10 f11 f12 pgup Break pgdn {appears to crash usim} home Call end End backspace rubout backspace Rub Out

The diskmaker Utility


The program “diskmaker” will interpret a disk image partition table and make a new disk using a template file. 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.

What programs are here?

usim - the CADR emulator diskmaker - program to make Trident disk images for the CADR from a microcode file, and a load band readmcr - utility to read MCR file lod - utiltity to pick apart load bands and show their insides lmfs - raw hack to read files from (Symbolics) LMFS partitions cc - crude CADR debugger program

Recent Changes

v0.10 - TBD

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 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:

  • Tom Knight
  • Howard Shrobe
  • Richard Greenblatt
  • Daniel 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 explanations 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?”.

usim's People

Contributors

ams avatar lisper avatar rmblair avatar larsbrinkhoff avatar

Watchers

Kuba Tyszko avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.