After multiple experiments, now have Kermit working for file transfers on CP/M computers. Attached is a "Generic" Kermit. It has been tested with Teraterm on a PC.
Many thanks to Andrew Quinn for helping getting this working. The secret lies in some simple changes to the CP/M bios. Kermit changes a byte in ram at location 0003 (called iobyte). If this byte is zero, data is directed to the default port (TTY, which is the normal keyboard and display).
In Kermit, you can run the command SET PORT ? and this displays the available ports. Not all of these seem to work but CRT and UC1 do.
CRT changes iobyte to 85, and UC1 changes it to 87, so this can be used to redirect data to various physical ports.
The CP/M bios needs to modified to redirect this data. In simple terms:
read iobyte at location 0003 in ram
if 0, send to normal port
if 85, send to CRT port
if 87, send to UC1 port
In the spirit of CP/M, you modify the bios for your particular hardware, and then all CP/M software should then run on your particular system.
Any changes to CP/M bios are backwards compatible. At bootup, if CP/M sets iobyte to TTY (0) and the changed bios checks iobyte and if zero, sends to the TTY serial port, then everything works as per normal.
Having got it working, it is now possible to understand this iobyte description https://www.seasip.info/Cpm/iobyte.html There are 2 bits for the CONSOLE device in CP/M, and if we look at that 4th column, these are 00 = TTY, 01 = CRT, 10 = BAT and 11 = UC1. Looking at what kermit changes with SET PORT and masking off the high 6 bits, we get 00 for TTY, 01 (85 = binary 01010101) for CRT and11 (87 = binary 10010111) for UC1. And SET PORT BAT gives an “unrecognized command” in Kermit so you can only use three ports, not four.
As an aside, other programs can modify iobyte as well. Eg STAT RDR:=UR2: change it to (I think) 12. STAT DEV: will print out what physical devices are linked to what virtual devices. What this means is that if I write a little program in C or Basic or assembly on my computer and every IN or OUT command is replaced with a bios call and /or a modification to iobyte, then that program will work on another CP/M computer that has completely different port assignment. So one can think of a 'generic' xmodem, for instance. Also, just as a little experiment, any port assignments done by STAT are overwritten by Kermit.
Kermit is a very flexible file transfer system. Hopefully this is of use to someone.
James Moxham
Adelaide, Australia
Hi Phillip, I've taken a look at Grant's bios code and the good news is this should all work fine with Kermit on the RC2014 without any further bios changes. Run Kermit and, depending on which serial port is TTY and which is CRT, either type SET PORT TTY or SET PORT CRT.
All good fun!