Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ESP32-VGA Altair8800 FabGL - CP/M - my experience so far

547 views
Skip to first unread message

Richard Deane

unread,
Aug 11, 2019, 5:52:18 PM8/11/19
to

FabGL - Altair 8080 CP/M notes (by Richard Deane)

The ESP32 VGA FabGL Altair 8080 CP/M emulation is a functional CP/M computer with the equivalent of 4 floppy drives (using Altair 338kb dsk images) compatible with images from the altairclone.com site.

The console is by default assigned to the physical VGA monitor and keyboard attached to the TTGO ESP32 VGA but can be redirected to the USB port (serial) via the cp/m command STAT CON:=UC1: .

By default the system is configured with two pre-populated disk images on A: and B: which are read-only (I assume that is because of limitations imposed by the memory used for storage - I shall investigate this further)

I thought, from browsing the code of the altair8800 sketch, that drives C and D would be populated by default, but I have not achieved that yet. These drives are read-write and exist in SPIFFS storage within ESP32.

I have identified two ways to populate C and D drives:
1. use the tools provided by FabGL - the python “transdisk” tool and the menu option on the cp/m emulator under ESP32-VGA (invoked by Pause-key then S or R) to transfer 338k Altair disk images. I had problems getting python serial working under Mac OSX and Windows, but worked fine under Raspberry Pi 4. This can transfer disks in both directions.
2. Use the plug-in tool ESP32FS (https://github.com/me-no-dev/arduino-esp32fs-plugin/releases) which puts a tools option in Arduino IDE (ESP32 Sketch Data Upload). Place the required disk (dsk) images in a “data” folder under the Altair880 folder of FabGL-master and ensure the names match that in the Altair880 sketch (diskC.dsk and diskD.dsk). This transfers the files into the emulator, but does not allow export back to the host pc.

The supplied cpm22 system (drive A) does not support generic kermit so I assume that IOBYTE is not implemented. I was able to replace this by creating a same-named image cpm22_dsk.h but derived from kermit.dsk from Altairclone.com (converting from dsk to h format using linux or OS X command xxd with -I option and then editing the data type, see details below. The xxd with -i command cannot convert back from h to disk format, and once mounted as drive A it is read only, so to create a disk you may need to create it as read/write on C or D before exporting as dsk, converting to h, and rebuilding via Arduino IDE as drive A.

To date I have only used CP/M 2.2 and not yet tried CP/M 3.

It has been fun, with a lot of learning (for me) of Arduino IDE. First impressions are good and system seems solid, but I've run no in-depth application usage yet. I have launched Supercalc2 to check screen config, and same for Wordstar. It is a very cost effective system if you want an introductory CP/M standalone system - cost me £15 inc shipping from Ali Express.


The following is based on information from the author, Fabrizio Di Vittorio.
The implementation of Altair 8080 is just a demo of FabGL usage and not a final product.

Transferring files:

USB link is attached to SIO2. You can transfer a file using the PCGET.COM command on the CP/M side. Just execute this:
PCGET filename B
"B" indicates to use SIO2. Replace "filename" with the name of the file you are receiving. PCGET uses XMODEM protocol, so you can use every tool that supports this protocol on the PC side. Just make sure the speed is 115200.
The author has built a python tool (in "tools" folder) named "TRANSFILE.py”.
Just launch:
PCGET MBASIC.COM B ....on the Altair side, and...
python transfile.py MBASIC.COM to /dev/cu.SLAB_USBtoUART ...on the PC side....
(Replace "MBASIC.COM" and "/dev/cu.SLAB_USBtoUART” parameters with those of your configuration).
Make sure you are executing PCGET.COM on a writable disk (C or D).
You can also transfer disk images, for this use "transdisk.py". On the Altair side press “Pause” key and activate "Get Disk from Serial" option.

Creating Disks:

You can create an ".h" disk image from "dsk" format. The dsk format must be 77 tracks by 32 sectors (8'' inches standard) or minidisk 35 tracks by 16 sectors. This is the most common format you can find on the net.

To convert a dsk to header you can use "xxd" linux command (or MacOS, and now even with last release of Windows 10):
xxd -i myimage.dsk >myimage.h
It will create myimage.h. Now open it and change the first line from...
unsigned char myimage[] = {
...to...
const uint8_t myimage[] = {
That change is necessary to store the header in Flash (not in SPIFFS) instead of RAM.

Inside Altair8800.ino you have to include the just created file adding:
#include "disks/....whereyouplacedthedisk.../myimage.h"
..and finally you can assign it to A or B with (line 106):
#define DRIVE_A myimage // A: read only
Actually you can assign any image to any drive. From line 342 up to 349 is where actually drivers are linked to disk images.
With...
diskDrive.attachReadOnlyBuffer(0, DRIVE_A);
...you are specifying a header file (a const buffer stored inside the code). Of course you can directly replace DRIVE_A with "myimage" that you just created.
With...
diskDrive.attachFile(2, DRIVE_C);
...where DRIVE_C is just a filename inside SPIFFS, you are specifying a Read/Write disk image. It must be formatted inside CP/M before used.

Lawrence Woodman

unread,
Aug 14, 2019, 2:05:11 AM8/14/19
to
On Sun, 11 Aug 2019 14:52:16 -0700, Richard Deane wrote:

> FabGL - Altair 8080 CP/M notes (by Richard Deane)
>
> The ESP32 VGA FabGL Altair 8080 CP/M emulation is a functional CP/M computer with the equivalent of 4 floppy drives (using Altair 338kb dsk images) compatible with images from the altairclone.com site.

Thanks Richard for the report. I've seen a few things now about this
micro-controller, both on c.o.c and elsewhere and it looks really good.
I see that Arduino IDE supports it and as it's so cheap I'm really
tempted to make the time for it.

Your report may have just helped me decide to take the plunge.


Lorry

---
Backgammon: The Peelgrunt Game of Gammon IV on CP/M
https://www.youtube.com/watch?v=i5T76oSa62o
0 new messages