Tutorial: How playing Zork taught me how to use the MITS disk operating system

121 views
Skip to first unread message

John Kennedy

unread,
May 14, 2019, 1:40:01 AM5/14/19
to Altair-Duino
I was typing this up for my Altair-Duino fan-boi page, and thought I would share in case it's useful to anyone.
For a while I was treating the switch patterns required to load Zork as a magic spell, but after actually reading the instructions I thing I get it now.
If there any mistakes, please feel free to let me know!


Saving Zork Game Progress


Or “How playing Zork taught me how to use the MITS disk operating system”


In this brief tutorial I'll go over using the virtual disks the Altair-Duino supports. I'll assume that you have a display (a serial terminal, or a serial link via the USB or Serial ports using a serial terminal on your computer) connected to your Altair, so you can see text and enter commands.


Do you have the Altair-Duino with a SD Card of goodies, including some CP/M copies of the Zork adventure games? Great! However, if you start playing Zork you’ll find you can’t save your progress as the ‘Save’ command will fail. Why? Turns out with all three Zork games on one virtual disk, there isn’t enough room to save the progress file. What to do?


Option 1. Delete the Zork2 and/or Zork3 files to make more space on that disk. 


But I might want to play Zork2 or Zork3! Next option.


Option 2. Copy Zork2 and/or Zork3 to another, different, virtual disk and so make room.


Excellent. But where can you get another disk?


You will need to mount a new virtual disk. I initially tried this with the Tarbell disk controller, as it was first in the excellent David Hansel manual, but depending on how you or someone else created your Altair-Duino firmware, there may not be support for the Tarbell floppy disk emulation activated. So instead let’s use virtual floppy drives with the MITS Disk Controller. You have probably accessed a virtual drive in this way if you have played the Zork CP/M disk in the first place, but hopefully by the end of this tutorial it will be more than some random switch settings for you.



What are drives and disks in this context?


A drive is the (virtual) disk drive you can imagine connected to your Altair. Your system is probably set up to support at least four drives : A:, B:. C: and D:. 


A disk is a (virtual) disk that is “inserted” into one of those drives. Disks can be inserted, accessed and then removed.


By using combinations of the A15-A0 and the AUX 1 and 2 switches, the Altair-Duino software can select drives, and insert disks. Once you understand it a little, it stops being a random pattern of switches and starts making some sense. 



Here’s the plan.


  1. Boot from the CP/M disk in drive A.
  2. Insert the Zork disk (this is drive B)
  3. Insert an empty disk, and format it (this is drive C)
  4. Use the CP/M command “PIP” to move the app Zork3 from drive B to drive C
  5. Delete Zork3 from drive B


Yes, you might be thinking this is rather like an adventure in its own right. I can’t argue, so here’s how to do it, step by step.


Here are the disks we’ll need to use:


Disk 01 - CP/M

Disk 08 - Zork

Disk 1F - An empty disk we’ll create


If you were to take the SD card and read it in a computer, you would see a list of these disks, each stored as a file named DISKxx.DSK., where xx is a two digit hex number (e.g. 01, 0f, 20 etc).  You can’t read the files easily on a computer, but you can copy them, email them, back them up etc etc.



So many switches


The trick to controlling things with the A15 to A0 switches is as follows:


First set the switches to enable the MITS Disk Controller. We use A15 to A12 for this, set to 0001.

That is:  A15 = Down, A14 = Down, A13 = Down, A12 = Up


Now we select the drive (A: B: C or D:) using the next four switches, A11 to A8, as follows:


0000 = Drive 0 = A:

0001 = Drive 1 = B:

0010 = Drive 2 = C:

0011 = Drive 3 = D:


The last set of eight switches, A7 to A0 specify the number of the virtual floppy disk that will be popped into the virtual drive. Several pre-loaded floppy drives are included (the CP/M and Zork ones for example), but you can create your own just by picking a number that isn’t used.


To select the CP/M disk, set A7 to A1 down, and A0 up


00000001 = Disk 1 = DISK01.DSK = CP/M


So, to load CP/M into drive 0 set the switches like this:


A15 -> A0

0001 0000 0000 0001


Now we can tell the Altair-Duino to mount it, by pressing AUX 2 down.


If you do this, you should see a message like:


[mounted disk image 'DISK01.DSK: CP/M (63k)' in drive 0]


If you see a different message about a disk image has been mounted, but it doesn’t say CP/M, then either your switches are in the wrong position, or the SD card is missing, corrupt, or doesn’t have CP/M stored in the DISK01.DSK file.


Assuming it did mount as expected, we can continue to boot the disk. This will load part of it into memory and execute the code there, effectively starting CP/M.  To do this, we need to engage the Altair’s Disk Boot ROM (a special program that your Altair-Duino includes as if you had installed a floppy disk controller with a ROM in a real Altair). There is using another special switch combination:


A15 -> A0

0000 0000 0000 0100


And press AUX 1 down.


You should see:


[Running Disk boot ROM]


..and then the CP/M prompt.


If you just see a load of random characters scrolling by, the SD card isn’t installed or is corrupt.


Congratulations! You’ve just booted CP/M.



Loading Zork


Now we need to mount disk 8, into drive 1. Can you work out the switch pattern?


0001 = MITS DIsk Controller

0001 = Drive 1 = B:

00000100 = Disk 08


So set the switches like this:


A15 -> A0

0001 0001 0000 0100


And press AUX 2 down to mount it.


Now, at the CP/M prompt, you can enter:


DIR B:


And you’ll see the Zork files listed. 



Mount a new drive and format it


Let’s add a brand new virtual floppy. By default, disk 15 (hex) doesn’t exist, so let’s create that. First we mount it, this time in drive C: like this:


0001 = MITS DIsk Controller

0010 = Drive 2 = C:

000010101 = Disk15


Set the switches to be:


A15 -> A0

0001 0010 0001 0101


And press AUX 2 down to mount it.


You should see:


[mounted new disk image DISK15.DSK in drive 2]


If you were to enter DIR C: right now, bad things would happen, as the disk is not formatted or ready to use. This is because the file DISK15.DSK hasn’t been created yet.


Were you able to resist typing DIR C:? Did you see 


Bdos Err On C: Bad Sector


And now you can’t do anything? Don’t worry, press the Altair Reset switch up and CP/M will restart.


You need to format drive C: to cause it to spring into existence. To format it, enter:


FORMAT


You’ll see the prompt


*** DISKETTE INITIALIZER ***


DISK DRIVE (A-P)? 


Type:


C <return>


And when you see the COMMAND: prompt, enter:


FULL <return>


And press C to continue.


You’ll see a PROCESSING TRACK #x message count up to 77. The first time you do this, the verification will probably fail, so repeat it. Then enter STOP to leave the FORMAT program.


Now when you enter


DIR C:


..you won’t see any errors, but of course you won’t see any files either.



File copying


To copy files, we’ll use the CP/M command PIP. To copy ZORK2’s files from B: to C: enter this:


PIP C: = B:ZORK2.*


And this will copy ZORK2.COM and ZORK2.DAT to drive C:


Now you can erase them from drive B:. like this:


ERA B:ZORK2.*



Conclusion


Alright! Now you have created a bunch of space on the Zork disk, and finally you can save a game from within Zork (by typing SAVE), and recover it later (by typing RESTORE)


As you continue to play with the Altair-Duino, you should look at some of the other virtual floppy disks that have been included. Some of the more fun ones include:


DISK10.DSK: Hitchhikers Guide to the Galaxy

DISK11.DSK: Planetfall

DISK12.DSK: Colossal Cave Adventure


There are also hard disk images, and these include other adventure games and CP/M versions - but we’ll save that for another time.


Charley Jones

unread,
May 14, 2019, 2:11:15 AM5/14/19
to John Kennedy, Altair-Duino
Beautifully written.
Formatting was a little rough.
At least on iphone.
I might suggest a larger font and formatting as a pdf.

Sent from my iPhone 7!
--
You received this message because you are subscribed to the Google Groups "Altair-Duino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to altair-duino...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/altair-duino/643fe1c1-96c3-446c-9931-7089edebc8e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tom Lake

unread,
May 14, 2019, 4:54:41 AM5/14/19
to Altair-Duino
You have:

000010101 = Disk15

Shouldn't that be

00010101 = Disk15

?

Tom L

John Kennedy

unread,
May 14, 2019, 11:05:39 AM5/14/19
to Altair-Duino
Thanks Tom, good catch!

John Kennedy

unread,
May 14, 2019, 11:06:36 AM5/14/19
to Altair-Duino
Thanks Charley. If the details are mostly correct, I am going to write it up nicely with some pictures and better formatting and host it on altair8800.space. Thanks!
To unsubscribe from this group and stop receiving emails from it, send an email to altair...@googlegroups.com.

John Kennedy

unread,
May 15, 2019, 12:05:38 AM5/15/19
to Altair-Duino
Thanks all. I updated the tutorial on the website and fixed the many errors it contained as I went.

Frank P.

unread,
May 16, 2019, 11:08:08 AM5/16/19
to Altair-Duino
John, I certainly appreciate the learning experience that playing around with swapping floppys and copying files can provide, taking you back to the "grand-ol-days" of personal computing. The tutorial is great for someone learning how to do the equivalent on the AltairDuino.

Note that your tutorial assumes that DISK08.DSK contains only the 3 Zork games, but in reality it also boots to CP/M directly without having to mount a separate floppy to do that.

You mention saving Hard Disks for another time... If all you want to do is play Infocom text adventure games and save games galore, you can't beat using a Hard Disk. Quite a while ago I put together a Hard Disk image with 24 Infocom games (including the 3 Zorks) and posted it here:


Pay particular attention to the file ICFILES.TXT

You can name it something other than HDSK03.DSK to keep your CP/M Hard Disk pristine. See the last 5 or 6 posts in this topic: https://groups.google.com/forum/#!msg/altair-duino/Tw6CJj5vH5Y/SgBobId0AwAJ for details.

John Kennedy

unread,
May 16, 2019, 11:39:21 AM5/16/19
to Altair-Duino
Hi Frank

Yes, indeed DISK08.DSK does include enough CP/M to boot - however, it doesn't include PIP or FORMAT, so although you can boot it to play, you can't move the files or prepare the new floppy. That's why I went with booting the CP/M Disk 1 first. I should mention that in the instructions (or if you have a workaround...)

I have that hard drive image! It is so packed! There are years of games on that one!

To be honest, the tutorial was written as I had puzzled out why the floppy Zork wouldn't save, and that was an adventure in itself.

Hard drive one is next :-)

thanks, -John 

Frank P.

unread,
May 16, 2019, 12:26:30 PM5/16/19
to Altair-Duino
You are correct, you need the 3rd floppy for the CP/M utilities if you want a pure CP/M solution to this.

If you want to cheat a little, you can use the emulator's File Manager in the configuration menu to copy DISK08.DSK to DISK15.DSK, then boot up DISK15.DSK and erase all but ZORK1.COM and ZORK1.DAT.
Reply all
Reply to author
Forward
0 new messages