From: Dan Cross <crossd@gmail.com>
To: Paul Ruizendaal <pnr@planet.nl>
Cc: "tuhs@tuhs.org" <tuhs@tuhs.org>
Subject: [TUHS] Re: x/y/zmodem on Unix
Date: Mon, 18 Sep 2023 19:07:25 -0400 [thread overview]
Message-ID: <CAEoi9W69XgxkQbWBK3OQ3-JemxRdkeUMau6YOtfFJALemdLBSw@mail.gmail.com> (raw)
In-Reply-To: <81B4F221-C3EF-4543-84CD-78E52ABF0E67@planet.nl>
On Mon, Sep 18, 2023 at 6:31 PM Paul Ruizendaal <pnr@planet.nl> wrote:
> Last december Matt brought up xmodem and recently I needed it for an almost identical use case. Studied it a bit and in the context of Unix, it is an interesting piece of software history.
>
> Although xmodem originated on CP/M in 1977, it seems to have arrived on Unix soon thereafter. The first Unix implementation seems to have gone by the name of “rbsb” and must have originated when V7 was prevalent: it uses alarm() to simulate non-blocking I/O. Over the course of the 80’s ymodem and zmodem were added and the package became lrzsz; the source continued to have a very V7-ish feel to it at least to the early 90’s. In the mid-90’s it was converted to ansi-C and had some other modernization, but it looks like it would still have run on SysIII (apart from the ansi).The last update to the upstream source package appears to be from 1998, i.e. 25 years ago.
>
> It is still packaged today for FreeBSD and major Linux distros. On Unix it must be one the oldest code bases still in regular use, with the 1980 source still recognizable in its current incarnation. Any other contenders come to mind?
>
> I had always associated x/y/zmodem with CP/M and MSDOS, not so much with Unix. Last December Clem already pointed out that it was popular for file exchange in the Unix scene as well, along with several other similar tools. Also, the ymodem approach to file metadata is very unix oriented, suggesting it originated on Unix or at least that Unix users were an important user demographic. Yet, I could find little trace of x/y/zmodem in the TUHS Unix Tree. The search tool finds it in 2.11BSD, in Minix 1.5 and 2.0 and in V10. Kermit is in those as well, and in 4.3BSD and 4.4BSD on top.
>
> Maybe these programs were commonly pulled from a bulletin board and hence not on distribution media. Not sure how that would be bootstrapped, although the 2.11BSD files for x/y/zmodem include “minirb.c”, a 175 line implementation to receive files using the ymodem protocol. It is possible that this was transferred as plain text as a first step, or even retyped.
>
> Any recollections?
xmodem was an outgrowth of Christensen's MODEM.ASM for CP/M, and is
almost criminally simple: a small block of data coupled with a little
bit of header information, wait for an acknowledgement, and repeat.
Metadata was small (a start byte, a block number, inverse block
number, and a single checksum byte), but there was no total byte
count, so it was assumed that the final block would be padded with a
throwaway character.
Chuck Forsberg did YMODEM and ZMODEM; YMODEM is sort of a
super-XMODEM: it adds a 16-bit CRC, increases the block size, and adds
a "0 block" with some metadata (total file size and file name); thus,
it no longer needed a padding byte removed from the final packet.
Otherwise, it retains most of the overall structure of XMODEM.
ZMODEM was, as I understood it, designed for transfers across telenet,
which was pretty reliable; instead of the highly synchronous
send/wait-for-ack cycle of xmodem and ymodem, zmodem relies on error
detection and correction and is basically a streaming protocol: a
packet in a sliding window could be NAK'ed, thus rewinding the
transfer, but otherwise it basically just sends data until done.
lrzsz came kind of later; I remember Forsberg's rzsz package on Unix
back in the day, and then there was a GNU reimplementation. For a
while, the Omen Technologies BBS was listed in the BSD phone numbers
files.
xmodem lives on in a lot of embedded applications because of its
overall simplicity. We used it to bootstrap kernels onto Oxide
computers, for example, while we were doing active development.
- Dan C.
next prev parent reply other threads:[~2023-09-18 23:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-18 22:31 [TUHS] " Paul Ruizendaal
2023-09-18 23:07 ` Dan Cross [this message]
2023-09-19 2:04 ` [TUHS] " Theodore Ts'o
2023-09-19 9:47 ` Michael Stiller via TUHS
2023-09-19 3:58 ` John Cowan
2023-09-19 2:46 ` Jonathan Gray
2023-09-19 3:42 ` Serge Burjak
2023-09-19 6:10 ` Serge Burjak
2023-09-19 6:37 ` Dave Horsfall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAEoi9W69XgxkQbWBK3OQ3-JemxRdkeUMau6YOtfFJALemdLBSw@mail.gmail.com \
--to=crossd@gmail.com \
--cc=pnr@planet.nl \
--cc=tuhs@tuhs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).