The Arcology Garden

MakerLisp Machine

LifeTechEmacsArcology

The MakerLisp Machine is a portable, modular computer system, designed to recapture the feel of classic computing, with modern hardware. The CPU is a Zilog eZ80 running at 50 MHz, which supports up to 16 MB of zero wait state RAM. The system software is 'MakerLisp', a 'Lisp on Bare Metal' system that allows direct access to system hardware, while providing the concise expressive power of a functionally complete Lisp environment. The machine is also an ideal platform for an extended CP/M. A full system configuration is pictured here, with CPU, expansion board, USB keyboard, and VGA display, in the laser-cut wood 'MakerStation' enclosure.

I picked up this machine at Vintage Computer Festival and proceeded to not do much with it over the last year. I've taken a fancy to learning roam:Forth programming and this little z80 board sounds like a great little system to be playing with that sort of stuff.

I have the MakerLisp code and whatnot tied in to file:~/Code/makerlisp , theres' a bunch of useful docs.

Why program a z80?

In middle- and high-school I attempted to learn how to program z80 assembly to write software for the TI-84 graphing calculator after finding myself enamored by some of the games and utilities on TIcalc.org. I wasn't ready to take on that sort of effort then: assembly was a proper thing to learn and to this day I still haven't learned an assembly language well enough to write anything substantial, I've always stuck to high-level languages and not really dealt with the specifics of hardware. So, I found myself writing BASIC in a roam:PalmOS programming environment and eventually Pascal and roam:OnBoardC . This through-line eventually lead me to some IRC rooms and running Linux and building Linux systems which would carry me in to my professional career eventually developing system software in Python, JavaScript, Golang, Emacs Lisp , and Elixir.

Yet these legible systems based on hardware and software designed before I was born still appeal to me, especially as some of my favorite video games are running on the z80-ish GameBoy. I use a powerful text editor slash operating system that can trace its development lineage back to some of the first multi-user systems of the 1970s. I use it because it's powerful, but it's powerful because it's integrated, self-describing and intimately understandable. (Why rrix Uses Emacs ) The code is right there and you can edit nearly any part of the running system and watch it react in real time. I've been using Emacs for a decade now, the majority of my professional career and personal interest in computing outside of the single-player bedroom Gameing of my youth.

These z80 systems like the TI calculators and the MakerLisp Machine and the RC2014 are the spiritual successors of some of the first single-user systems of the 1970s. The Intel 8080 and its sibling the z80 were in the home computers from before my birth and before the IBM-PC's and DOS's explosive takeover of the mind-share and time-share of the growing computing community which would eventually eclipse and envelope and integrate even those multi-user systems which "real work" was done on for so long. These machines won't run Emacs or the CCE but they will run other interesting, influential, functional software and have a simple operating model

In the case of the ez80 MakerLisp Machine, you plug the board in and before the VGA display initializes it has displayed a nondescript > character establishing the fact that you are in the bare-metal Lisp REPL and are ready to code. CP/M boots as quickly, and both have access to more RAM than the original machines had hard disk. Rather than blocks on a floppy drive, we've developed relatively simple FAT filesystems which can be implemented by the firmware and SDHC access which can (more slowly than your phone or camera) access and store vastly more files and disk images than a room full of Trash 80s could contain. Meanwhile, the system's operating model is simple enough that one can undertake understanding it from the silicon up to the IO. The OS many of the old systems ran were developed from scratch in-house by a handful of people at most or a bodge of CP/M design standards. The MakerLisp machine is one man's hobby, with the help of a small community of helpers and one person to help by porting CP/M to the machine. The operating model was often as simple as "copy these blocks off a floppy drive, load them in to a predetermined address, and JMP to it". Compared to some of the weird machines hiding in the binary loaders on modern systems.

There's a certain bent of old white guy who gets really in to retrocomputing as a sort of pastoral whispering. I don't want to be that person who thinks we must RETVRN to the old ways, much less to proselytize that to others. It's easy to be the author running WordStar in DOSBox because that's what one wrote their first novel in and says "why would I want to learn new tools?" It's easy to believe that you're "above" that pastoralism while still lamenting the confusing new-ness of software like roam:SystemD or roam:TikTok . It's easy to think that you're "above" that pastoralism while using a text editor slash operating system. No, we should have good computers connected to an interplanetary network where any given weirdo can go find at least three or four others who share the same bend. We should have secure networks where we can share intimacies with each other, to exchange money for goods and services, for those weirdos to fade in to the cosmic background radiation of society if they so choose. Pastoralism and reactionary withdrawal is not my intent here. My intent is to scratch intellectual curiosity and boot-strap my way in to an auto-didactic understanding of computer science and computer hardware and modern systems architecture, to provide more legibility to these complex distributed systems of vibrating hot sand.

Lately, I've become interested in learning languages like roam:Forth once again and build simple interesting systems in programming languages no one would pay me to write. I was going to do Advent of Code this year in Forth but lost track of time. Maybe i'll play it on catch-up, but it's a lot to ask at this point. Forth is conceptually simple and can be implemented in a legible amount of assembly code, but it's interesting and compelling. The whole CPU runs a whole program which you can read, understand, and modify and that seems cool to me.

Setting up the Hardware

I have the whole kit: the ez80 credit card board, a GPIO expansion card, a serial to VGA adapter, and USB keyboard to serial adapter, and a wood laser-cut case. This, with a small keyboard like the Planck or Keyboardio Atreus and a VGA monitor like this one makes a whole little computer. It's best to start working with it over screen or PuTTY, I think, just to get your feet underneath you, though, maybe.

  • consult file:~/Code/makerlisp/doc/HOWTO/update.txt to set up an SDHC card with standard libraries, sample programs, and the CP/M ROM image and disk images.

  • consult file:~/Code/makerlisp/doc/HOWTO/wire.txt to wire up the VGA and USB boards -- I've only got the USB board to work with a few of my spicy keebs, and none of the small ones running "modern" QMK... hmm...

Connecting to the ez80 dev board (on Android)

If it's wired up according to the docs above, I can just type in to it, of course. but also it would be nice to have a mobile setup, especially once I get some more stuff running on it. If I want to use it Linux I can just use minicom or screen, but on Android it's a bit more complicated. My Cosmo Communicator has a whole hardware keyboard on it, and i'd like to be able to program on it on the go like I can with the CCE in Nix On Droid .

AnotherTerm was the only thing I could find that can do this; I'd prefer to just run minicom or so in t184256/nix-on-droid but USB doesn't work in there -- Termux supports USB, sort of, but only libusb based applications:

USB API is limited and can be used only with libusb-based programs. You cannot obtain permission to have raw access to serial line character devices on Android.

It works pretty nicely though!

NEXT Doing Things with MakerLisp

Doing Things with CP/M

NEXT CP/M?

flesh out; for now: CP/M forty years on -- what it was, and why it still matters and a CP/M index on the same personal site.

cpmtools on NixOS

This package allows to access CP/M file systems similar to the well-known mtools package, which accesses MSDOS file systems. It can be used for file exchange with a Z80-PC simulator, but it works on floppy devices as well.

Currently it contains:

  • cpmls - list sorted directory with output similar to ls, DIR, P2DOS DIR and CP/M3 DIR

  • cpmcp - copy files from and to CP/M file systems

  • cpmrm - erase files from CP/M file systems

  • cpmchmod - change file permissions

  • cpmchattr - change file attributes

  • mkfs.cpm - make a CP/M file system

  • fsck.cpm - check and repair a CP/M file system

  • fsed.cpm - view CP/M file system

  • manual pages for everything including the CP/M file system format

All features of CP/M file systems are supported.

NixOS doesn't ship with cpmtools and even if it did, I would need to provide the diskdefs file shipped with the MLM. Luckily it's easy to get it going. This is added to rixpkgs :

nix source: :tangle ~/arroyo-nix/pkgs/cpmtools.nix
{ pkgs, lib, stdenv, fetchFromGitHub, ... }: stdenv.mkDerivation rec { name = "cpmtools"; version = lib.pkgVersions.cpmtools.version; src = pkgs.callPackage lib.pkgVersions.cpmtools.src {}; myDiskdefs = /home/rrix/Code/makerlisp/src/uSDimage/cpm/diskimg/diskdefs; postInstall = '' cp ${myDiskdefs} $out/share/diskdefs ''; meta = { homepage = "https://github.com/lipro-cpm4l/cpmtools"; description = " Tools to access CP/M file systems"; license = lib.licenses.gpl3; maintainers = with lib.maintainers; [ rrix ]; }; }

I install cpmtools and screen as well.

nix source: :tangle ~/arroyo-nix/hm/cpmtools.nix
{ pkgs, ... }: { home.packages = with pkgs; [ cpmtools screen ]; }

Prepping disk images and loading them in to the MakerLisp Machine

Install =cpmtools= for this, make sure to put in the diskdefs if you aren't using the NixOS derivations above.

I downloaded DX-Forth 4.44 from "The Unofficial CP/M Web site" for example and shoved it in to a CP/M disk image:

shell source: 
cpmcp -f wbw_hd0 ~/Code/makerlisp/src/uSDimage/lisp/etc/cpmdiskb.img ~/Downloads/cpm/DXCPM444/* 0:

I stuck NEMESIS on another:

shell source: 
cpmcp -f wbw_hd0 ~/Code/makerlisp/src/uSDimage/lisp/etc/cpmdiskc.img ~/Downloads/cpm/nemesis/* 0:

And stuck Zork on the 4th supported disk image:

shell source: 
cpmcp -f wbw_hd0 ~/Code/makerlisp/src/uSDimage/lisp/etc/cpmdiskd.img ~/Downloads/cpm/manygame/ZORK/* 0:

MakerLisp CP/M will load these when they are copied in to the SD card FS (with lisp as the root, so e.g. /etc/cpmdiskb.img)

At that point within CP/M I can just say something like:

shell source: 
MakerLisp 62k CP/M version 2.2 Copyright (c) 1979 by Digital Research. A>B: B>DIR *.com B: 280FORTH COM : PIP COM : STAT COM : XDIR COM B: DX COM : FORTH COM : FORTH-F COM : INSTALL COM B>DX DX-Forth 4.44 2020-10-11 4 MHz Televideo 912/920/92 Software floating-point (common stack)
  • how to store more disk images on the SD card and swap between them?

Forth on the MakerLisp Machine

dx-forth is on B: -- i could also get fig-forth running on there too, i guess but for now I'll stick with dx-forth.

(can i load dxforth from MakerLisp somehow instead of jumping through CP/M?)

NEXT Going further: CollapseOS on the MakerLisp Machine

  • http://collapseos.org/

  • https://github.com/hsoft/collapseos

Some Resources and loose ends

  • DX Forth 4.44 announcement thread https://groups.google.com/g/comp.lang.forth/c/e85ts1g7tDQ

  • hforth https://github.com/nealcrook/hForth

  • VolksForth (forth 2012?) https://github.com/forth-ev/VolksForth

  • fig forth https://github.com/dimitrit/figforth

  • http://dxforth.mirrors.minimaltype.com/

  • https://github.com/z88dk/z88dk development kit including C compiler etc

  • https://github.com/larsbrinkhoff/awesome-cpus/tree/master/Z80 z80 docs

  • https://github.com/agn453/CPM-UG-Disks

  • http://primrosebank.net/computers/mtx/projects/mtxplus/data/mtxplusdatarefs.htmvarious cp/m z80 etc references

  • rc2014 is a similar modular z80 computer https://rc2014.co.uk/