Was there ever a version of Kermit/zmodem that worked on small micros? - Page 1
Forum section: electronics / general

author: e100
author_rank: Frequent Contributor
timestamp: January 03, 2023, 03:11:55 am
content: As in 2k of RAM or less.Wikipedia goes back to the early 1980s, but there seems to be a lack of information as to what protocols were used before that time period, and if microcontrollers were a target platform.

author: westfw
author_rank: Super Contributor
timestamp: January 03, 2023, 04:27:51 am
content: QuoteSpecifically WITH compression? I don't think so. I've seensome bootloaders for AVR and PIC that use XMODEMas the underlying communications protocol.Quote"before that time period" there was essentially nothing to talk to. Recall that the first EEPROM microcontroller didn't come along until 1993; before that time if you had a microcontroller you were either "uploading" to RAM (eliminating most "microcontrollers") or using a special purpose programmer.You ran your modem ($1000+) to your ASR33 tape punch ($1000+), and hoped that no errors crept in. Then you could re-connect the ASR33 to your micro and read the paper tape. Or something like that. Intel Hex format is early-70s, contains enough info for error checking, but was designed for use with paper tape (so says WikiPedia.) So you sort of tried again if there was an error reported by the "whole file" "upload."Relatively proprietary links (X.25. DDCMP, ARAPNet) existed but were pretty much confined to Services (Tymnet) and mainframe applications.hee hee. The earliest record of me on the net:https://groups.google.com/g/fa.info-cpm/c/GCa7OAG_r-M?pli=1

author: wek
author_rank: Frequent Contributor
timestamp: January 03, 2023, 04:34:32 am
content: 2kB RAM, ZMODEM/Kermit (read: RAM hungry), small micros and 80s? This doesn't sound as a match at all.8051 (mind the built in USART!) is 1980, with whopping 128B of RAM (working registers included).JW

author: IanB
author_rank: Super Contributor
timestamp: January 03, 2023, 04:43:18 am
content: Quote from: westfw on January 03, 2023, 04:27:51 amI'm not sure what to make of this? There were devices called microcontrollers since the 1970's, and by the late 70's there was an exploding interest in how microcontrollers could replace hardwired logic in designs. But I think this question is more about microcomputers, rather than microcontrollers?In the 70's, there were of course huge numbers of microcomputers emerging with keyboards and screens and modem connections to online systems. I don't recall Kermit being used then (I think X/Y/Zmodem were more typical for downloading from BBS and the like), but I'm sure it would have been useful. I do recall Kermit being used in the 80's as a preferred file transfer protocol.I would say that in the 70's, the prevalent file transfer protocol would have been Xmodem.

author: retiredfeline
author_rank: Frequent Contributor
timestamp: January 03, 2023, 05:24:56 am
content: IIRC I had Kermit on my Z80 CP/M micro in the mid-80s. But it was for file transfer, not loading into memory, so RAM footprint wasn't relevant.

author: mfro
author_rank: Regular Contributor
timestamp: January 03, 2023, 06:08:54 am
content: Kermit wasn't publicly available before 1980/81.Here isit's history (and lots of sources for different machines/platforms).

author: IanB
author_rank: Super Contributor
timestamp: January 03, 2023, 06:32:25 am
content: Quote from: westfw on January 03, 2023, 04:27:51 amAh, TOPS-10. I remember that. I also remember the ASR-33 teletype, which was the only kind of terminal where sending a string of ^G characters to it produced an interesting result. Ah, nostalgia...

author: westfw
author_rank: Super Contributor
timestamp: January 03, 2023, 07:33:02 am
content: QuoteQuoteI guess, sort of. The Altair 8800 (which I'd consider the start of "amateur PCs") came out in 1974, Intel's MCS-48 (their first microcontroller) came out in 1976 (General Instruments' PIC1650 came out the same year.) That's a good "half" of "the 70s" with "no microcontrollers."The MCS48 was 2k of ROM and 128bytes of RAM, and while manufacturers may have been interested in using ROM-based chips as logic replacements, those were pretty useless to hobbyists or small manufacturers and hobbyists. Skimming the December issues of Popular Electronics, the 8748 first shows up in 1981, for about $70, compared to about $10 for a Z80A. And I'm pretty sure it required a "professional device programmer" to load any code into it.I'll stand by my statement that there were "no microcontrollers" that anyone was interested in using something like XMODEM to talk to, prior to, say, 8051AH-BASIC in the mid-1980s.Also, consider that the Hayes SmartMoDem (300bps) came out in 1981 ($300), and as far as compression is concerned, the original LZ compression paper was published in 1977.QuoteWhat? I remember trying to get the "Close Encounters of the 3rd Kind" theme by sending ^Gs to the variety of terminals in the university "terminal room." (It didn't work, although the variety of different toneswas"somewhat entertaining.")

author: jfiresto
author_rank: Frequent Contributor
timestamp: January 03, 2023, 09:13:17 am
content: I have a silly question to the original question: have you looked atthe source?

author: IanB
author_rank: Super Contributor
timestamp: January 03, 2023, 09:59:47 am
content: Quote from: westfw on January 03, 2023, 07:33:02 amYou can go earlier than that. In 1978 I was using a desktop microcomputer (the Research Machines 380Z) which either could boot a BASIC interpreter locally, or could run a terminal emulator to connect to a remote mainframe (such as a DEC PDP-10 or PDP-11) over a modem at 300 bps. Given a terminal emulator, a modem, and a computer with local storage, there was definitely an interest in file transfer. In those days the simplest way of downloading files was to print them to the terminal and then capture the output on a paper tape punch. Uploading was accomplished by reading the paper tape back in as if it were keyboard input. (Note that the Bell 103 modem standard had been available with 300 bps since 1962, long before Hayes.)QuoteI mean that since the ASR-33 had a mechanical bell, it was the only device that would actually go "ding-ding-ding-ding-ding" when you sent BEL characters to it. Other electronic terminals would just make a boring monotonous "beeeeeeeeeeeep".

author: iMo
author_rank: Super Contributor
timestamp: January 03, 2023, 10:04:19 am
content: Long time back I messed with zmodem on pic32MX/MZ mcus, under retrobsd (bsd2.11), and tried with stm32duino as well (f407), built from sources. I did also zmodem and kermit with pdp-8 and pdp-11 (both on fpga). Always abigpain to use it, however, unless your serial drivers are almost perfect (big buffers/fifos) and mcus fast.. It worked somehow with slower speeds (like 9k6..38k4), but definitely not reliable, at least in my cases..There are some ports for arduino/teensy afaik..PS: in my above cases the micros were not "small", though..

author: IanB
author_rank: Super Contributor
timestamp: January 03, 2023, 11:02:41 am
content: Quote from: imo on January 03, 2023, 10:04:19 amI found the key to reliability was to use hardware flow control (RTS/CTS) if available, but at least use XON/XOFF flow control otherwise. Using no flow control never worked reliably.

author: rstofer
author_rank: Super Contributor
timestamp: January 03, 2023, 05:26:28 pm
content: Even today, something like Kermit is required. Suppose you find the CP/M executables, you download them to your PC and now you have to get them transferred to an 8" floppy.One solution is to use Kermit to transfer the files as it is available for small microcomputers such as the Altair 8800.I have forgotten how I got Kermit onto a CP/M floppy but it wasn't very complicated. Probably a direct write to the floppy as the only executable file. The BIOS boot PROM knew perfectly well how to do a coldstart load.We did a lot of file load/transfer using the Intel Hex format because it was well suited to paper tape from ASRs and such. We even used audio tapes for a short time. I never had a fully functioning paper tape punch although I did have a reader. Various versions of BASIC for the Altair 8800 were distributed on paper tape because no standard OS was available until later. Load memory with executable from paper tape and go to work.

author: artag
author_rank: Super Contributor
timestamp: January 03, 2023, 09:17:04 pm
content: Kermit is actually more suitable for micros with very small memories as it has variable-sized packets. The ?modem variants have 128 to 1024 byte packets. It was discounted by many people at the time as it was slower, but it's a good deal more flexible and reliable than the faster alternatives.I see there's an 8051 version in the kermit archives.

author: iMo
author_rank: Super Contributor
timestamp: January 03, 2023, 09:31:14 pm
content: Quote from: IanB on January 03, 2023, 11:02:41 amYep, that also should be added to my "almost perfect" definition. HW flow control seems to be absolutely essential, xon/xoff did not work reliably with me too..

author: brucehoult
author_rank: Super Contributor
timestamp: January 04, 2023, 12:42:52 am
content: Quote from: IanB on January 03, 2023, 04:43:18 amI compiled Kermit on a DEC Rainbow in 1984, using Turbo Pascal 1.0, to talk to the university VAX. I have no idea of the code or RAM requirements! Less than 64k, obviously (I was using z80 mode).XMODEM was late 70s (1977). Kermit was I think 1981. YMODEM and ZMODEM were 1985-1986 -- YMODEM is backwards compatible with XMODEM on the other end, ZMODEM is a fresh start.I can't see any reason why the code for any of these wouldn't fit into a couple of KB if you really needed it to. CRC calculation might be one of the biggest parts, especially CRC32 on an 8 bit CPU.The needed buffers is another thing. Original XMODEM only uses 128 bytes at a time, which is ACKd before the next 128 bytes are sent. Faster versions, including YMODEM, use larger buffers and/or sliding windows, both of which will eat RAM.

author: westfw
author_rank: Super Contributor
timestamp: January 04, 2023, 03:28:10 am
content: QuoteHa ha. When X/Y/ZMODEM and KERMIT were at their peak usage, a 9600bps link was considered "quite fast."I'm not surprised that they had trouble with higher speeds; writing anything to storage was quite slow compared to a fraction of a millisecond until your two-byte UART buffer was full, back when OSes and Drivers were very primitive. I remember when 56k modems first came out, and the vendors started shipping them with "free" FIFO-capable Serial cards, because most DOS/Windows tools just couldn't keep up.KERMIT was designed with "difficult" communications paths (Muxes, TIPs and TACs, 7-bit only, high-delay network connections. weird flow control characters and lack of data transparency, etc. It was a real step forward, for the situations that existed at the time.)Some other "historical" MODEM implementations (X and maybe Y - no ZModem.)TOPS20 X/YMODEM(as used on Simtel-20!)IBM PC (original!) BASICA XMODEM- BASICA had the "honor" of including a MUCH better Serial Port Driver than the PC's DOS/BIOS.

author: amymcneil
author_rank: Contributor
timestamp: January 04, 2023, 03:52:42 am
content: I wrote a Zmodem up/download library for a proprietary product that used the the 8051 back in 1995 that I did the code for. It's all in assembler, the original C code was used in the comment sections. It didn't support compression but it did support the rest of the main Zmodem features. Serial port on the 8051 ran at 57.6k baud without issues.Looking at the C code today, it shouldn't be hard to port it to any modern microcontroller.

author: westfw
author_rank: Super Contributor
timestamp: January 04, 2023, 06:34:17 am
content: QuoteNeat. I agree that it ought to be pretty easy if your 8051 has enough program space and RAM.Do you happen to have numbers for the resource consumption of your version?BTW:XMODEM/MODEM2: 128byte binary blocks, 8bit checksum, single file.YMODEM: (up to) 1024byte binary packets, 16bit CRC, bulk/wildcard file transfers.ZMODEM: Sliding windows, 32bit CRC, restart capability, control-character quoting. (Despite the name, and my mis-remembering, compression didn't show up until "ZMODEM-90." (Didn't really matter, since files tended to be compressed beforehand by then, and Modems started doing their own compression.)

author: amymcneil
author_rank: Contributor
timestamp: January 05, 2023, 03:36:20 am
content: The code used just under 1600 bytes of ROM, 1K bytes of external RAM (the 87C51FA only had 256 bytes of internal ram) and required a few variables in internal RAM - 3 bytes, 4 16 bit words and 2 32 bit words. The 32 bit CRC was handled with table lookups, the tables are included in that 1600 bytes of ROM space. The sliding window feature stopped at 1K, limited by available external RAM space.One big reason for using Zmodem rather than the simpler X or Y versions was the file name handling which made it easier to manage which file was being uploaded. The files were 32K binary dumps of the flash memory chip that was also external to the 8051.

author: Njk
author_rank: Frequent Contributor
timestamp: January 09, 2023, 02:29:21 am
content: BTW xmodem is still alive. In certain ARM Cortex application processors, the boot ROM uses it when booting over Ethernet

author: SL4P
author_rank: Super Contributor
timestamp: January 09, 2023, 05:05:04 am
content: Just to add to the confusion…I’ve always separated as below.MICROPROCESSOR- 8080, 2650, 8085, Z80, 6800, 6502 etc, as the early programmable core components.MICROCONTROLLERS- have some or many onboard peripherals (serial, timers etc) on chipMICROCOMPUTERS- hang external peripherals and power supplies to make a box that does things.

author: brucehoult
author_rank: Super Contributor
timestamp: January 09, 2023, 11:23:03 am
content: Quote from: SL4P on January 09, 2023, 05:05:04 amI would say more about onboard ROM, RAM and GPIO.The MOS 6530 "RRIOT" gave you all of those (and a timer) and, combined with a 6502, gave effectively a 2-chip microcontroller in 1976.It, or the 6532 (which doubled the SRAM to 128 bytes but doesn't have the 1k ROM), was used in SBCs such as the KIM-1, Rockwell AIM65, the Atari 2600 console and a number of arcade games and pinball machines, and Commodore floppy disk drives.

author: westfw
author_rank: Super Contributor
timestamp: January 10, 2023, 02:47:09 am
content: QuoteI agree. There were a bunch of chips with on-chip "peripherals", but not memory. Start with the 80186 and add the MC683xx chips, which were useful but definitely in the "microprocessor" category rather than "microcontroller."Maybe it's a matter of extending the buses off-chip. an 8051 extends memory buses, but not peripheral buses. An AVR can extend a data bus, but not a program memory bus. Can you think of a device that is considered a microcontroller that extends all of the relevant internal buses?

author: Njk
author_rank: Frequent Contributor
timestamp: January 11, 2023, 11:21:12 pm
content: Check Intel MCS-48 family user's manual