The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Dan Cross <crossd@gmail.com>
To: Steve Nickolas <usotsuki@buric.co>
Cc: "Michael Kjörling" <e5655f30a07f@ewoof.net>, tuhs@tuhs.org
Subject: [TUHS] Re: Stdin Redirect in Cu History/Alternatives?
Date: Sun, 11 Dec 2022 10:04:54 -0500	[thread overview]
Message-ID: <CAEoi9W7neRTHkzo7RkOJzuLBgD0x=ZWLObD-FSVCr0dWNxvSBg@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2212110926530.17258@sd-119843.dedibox.fr>

On Sun, Dec 11, 2022 at 9:28 AM Steve Nickolas <usotsuki@buric.co> wrote:
> On Sun, 11 Dec 2022, Michael Kjörling wrote:
> > On 10 Dec 2022 19:22 -0500, from clemc@ccc.com (Clem Cole):
> >> My memory is there were also a bunch of two
> >> letter programs, rx/sx and rz/sz and the like.  Frankly its been so long
> >> since I had any use for them, I've forgotten.
> >
> > I remember at least sz/rz from my early (for me) forays into UNIX,
> > back when ZModem was pretty much state of the art at least on micros
> > and I had files locally that I wanted remotely or vice versa. The
> > mnenomic being s(end)/r(eceive) z(modem); "send" and "receive", of
> > course, being local to the remote host, so the opposite sense of what
> > one would do with the terminal emulator program that one interacted
> > with locally. So "sz <some file>" at the prompt, then activate the
> > "receive ZModem transfer" function locally; or "rz <some file>", then
> > activate the "send using ZModem" function locally.
> >
> > I think the host I was on at the time (which appears to have been some
> > Solaris) also offered XModem and YModem variants as [rs][xy], but I
> > never used those because someone had at some point told me that ZModem
> > was better. :-)
>
> Kind-of a pain to type as I'm SSHing in from my phone, but they still
> exist and I have "lrzsz" installed on my Debian box.

And as I mentioned earlier, they're still very much used.

I recently wrote the initial bootstrap program that runs when the x86
cores on our machine come out of reset
(https://github.com/oxidecomputer/phbl/). However, that's for
production use; for internal engineering use we have _another_ tool,
also written in Rust, that is an interactive standalone program. This
lets us do things like poke at physical memory, read/write MSRs, and
all of that fun stuff, before loading an operating system. So how does
one load the OS? Our machine has a part that includes a 3
MBAUD-capable UART, and we use xmodem to transfer the kernel (and a
ramdisk image!) over that, where the engineering tool can load and
jump into it. The standalone program implements xmodem internally,
whereas we use `sx` on the dev host side. Basically, there is a
built-in commands to perform the transfer, another that effectively
says "there's an ELF image in physical memory $here: load it and
return the entry point" and finally another command that can jump to
an arbitrary virtual address (yes, we load the host OS in 64-bit mode
and treat the kernel like any old "normal" ELF binary).

As the ramdisk image has grown (more and more debugging tools are
included as we move ever forward in the bringup and development
process), latency here is annoying. I added support for compressed
kernel and ramdisk images, which gave a 2.5x speedup (directly
proportional to the usual compression ratio we see on these images)
which ameliorated but did not eliminate the pain. We briefly tossed
around the idea of implementing zmodem, but decided it wasn't worth
it. We _could_, in theory, make use of the enhanced kermit with
sliding windows and so on, but again decided it wasn't worth the
effort for an engineering tool.

Incidentally, my colleague Matt Keeter ran into performance and
reliability issues with xmodem over the USB serial driver in macOS,
and wrote a small shim that side-stepped the host OS device. He did a
nice write-up of it here:
https://www.mattkeeter.com/blog/2022-05-31-xmodem/

I think this is in line with Larry's question about non-legacy
use-cases for these ancient serial transfer protocols in late 2022.

        - Dan C.

  reply	other threads:[~2022-12-11 15:06 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-10 19:38 [TUHS] " segaloco via TUHS
2022-12-11  0:22 ` [TUHS] " Clem Cole
2022-12-11  2:37   ` segaloco via TUHS
2022-12-11 13:59   ` Michael Kjörling
2022-12-11 14:28     ` Steve Nickolas
2022-12-11 15:04       ` Dan Cross [this message]
2022-12-13  1:54         ` Larry McVoy
2022-12-11 17:18     ` Adam Thornton
2022-12-11 18:54       ` Michael Kjörling
2022-12-11 19:55         ` Dave Horsfall
2022-12-11 20:03           ` Larry McVoy
2022-12-11 23:22             ` segaloco via TUHS
2022-12-12  2:15             ` [TUHS] Clever code (was " Bakul Shah
2022-12-12  2:44               ` [TUHS] " Steve Nickolas
2022-12-12  3:09               ` Andrew Warkentin
2022-12-12  3:34                 ` Larry McVoy
2022-12-12  5:00                   ` Kevin Bowling
2022-12-12  5:26                   ` Andrew Warkentin
2022-12-12 15:02                     ` Larry McVoy
2022-12-12 15:29                     ` Clem Cole
2022-12-12 15:39                       ` Dan Cross
2022-12-12 16:04                       ` Larry McVoy
2022-12-12 16:26                         ` Clem Cole
2022-12-12 22:20                         ` Liam Proven
2022-12-12 23:10                           ` segaloco via TUHS
2022-12-12 23:24                             ` Larry McVoy
2022-12-13  2:00                       ` Andrew Warkentin
2022-12-13 13:37                         ` Larry McVoy
2022-12-13 23:00                           ` Andrew Warkentin
2022-12-14  1:05                             ` Larry McVoy
2022-12-14  1:40                               ` segaloco via TUHS
2022-12-14  6:32                                 ` Rich Morin
2022-12-14  2:01                               ` Andrew Warkentin
2022-12-14  7:49                                 ` arnold
2022-12-14 11:54                                   ` Brad Spencer
2022-12-14 12:08                                     ` [TUHS] Re: (TUHS -> COFF?) Re: Clever code Michael Kjörling
2022-12-14 15:14                                     ` [TUHS] Microware's OS-9 (was: Clever code) G. Branden Robinson
2022-12-14 22:41                                       ` [TUHS] " John Cowan
2022-12-14  9:46                               ` [TUHS] Re: Clever code (was Re: Re: Stdin Redirect in Cu History/Alternatives? Harald Arnesen
2022-12-15 18:33                                 ` Liam Proven
2022-12-16 10:42                                   ` Harald Arnesen
2022-12-18 14:05                                     ` Liam Proven
2022-12-18 15:08                                       ` Stuff Received
2022-12-19 11:47                                         ` Liam Proven
2022-12-20  8:30                                       ` Andrew Warkentin
2022-12-20 11:57                                         ` Liam Proven
2022-12-15  0:29                 ` Bakul Shah
2022-12-15  2:54                   ` Larry McVoy
2022-12-15  5:36                     ` Bakul Shah
2022-12-15 14:02                       ` Dan Cross
2022-12-15 14:06                         ` Larry McVoy
2022-12-15 14:18                           ` Dan Cross
2022-12-15 14:02                       ` Larry McVoy
2022-12-15  8:01                     ` Andrew Warkentin
2022-12-12  9:48               ` [TUHS] Re: Clever code Michael Kjörling
2022-12-12 21:34             ` [TUHS] Re: Stdin Redirect in Cu History/Alternatives? Dave Horsfall
2022-12-12 21:46               ` Chet Ramey
2022-12-11  0:42 Nelson H. F. Beebe
2022-12-11  2:16 ` Larry McVoy
2022-12-11  2:26   ` Warner Losh
2022-12-11  2:32     ` Larry McVoy
2022-12-11  2:33       ` Warner Losh
2022-12-11  2:39         ` Larry McVoy
2022-12-11  2:49           ` Bakul Shah
2022-12-11  3:10           ` Phil Budne
2022-12-11  4:17           ` Dan Cross
2022-12-11  4:45             ` Will Senn
2022-12-12 17:06           ` Doug McIntyre
2022-12-12 17:42 Nelson H. F. Beebe

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='CAEoi9W7neRTHkzo7RkOJzuLBgD0x=ZWLObD-FSVCr0dWNxvSBg@mail.gmail.com' \
    --to=crossd@gmail.com \
    --cc=e5655f30a07f@ewoof.net \
    --cc=tuhs@tuhs.org \
    --cc=usotsuki@buric.co \
    /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).