Using Kermit to transfer files (yay!)

687 views
Skip to first unread message

Len

unread,
Dec 24, 2016, 2:31:34 PM12/24/16
to PiDP-8
My son and I have had some luck using kermit between a Debian Linux PC
and a PiDP-8 - hopefully this will be useful, even if only as a good
starting point to do the same thing on your own system - the exact
commands (and what you see) will probably vary:

Notes
-----

* These instructions apply to OS/8, I'm not sure how they'll work with
  any others - we haven't tried this with TSS/8, but it will probably
  work differently since the OS has control of the TTI/TTO devices.

* My PiDP-8 is using a Pi Zero, therefore both SIMH and the front
  panel control thread run on the same core. This slows the PiDP-8
  down enough to allow this to work (or, at least it has for all of
  the cases we've tried). We tried this using the most-recent beta
  release of SIMH on several i7-based machines and had to slow it down
  using "SET THROTTLE 333K" or "SET THROTTLE 500K" in the boot script
  to prevent timeouts. I suspect you'll either have to do something
  similar on a multi-core Pi (setting the throttle speed) , or force
  all of the PiDP-8 related threads using a "taskset" command
  somewhere in the startup script.

* When you want to transfer files from the server to the PiDP-8,
  you'll have to make sure they're named in all uppercase on the
  server side.

* It's also possible to run Kermit more "manually" (instead of running
  as a server) on the non PiDP-8 side, but there's more work
  involved. We're not going to discuss that here.

Bootscript changes - my 0.script looks like this
------------------------------------------------

reset
set cpu 32k
SET CPU NOIDLE
att ttix 4000
set ttox0 8b
att rk0 ../imagefiles/os8/os8.rk05
boot rk0

Note that you don't have to use port 4000.

Putting it all together
-----------------------

Fire up your PiDP-8, so that the network connection is running.

On the Linux side, in the directory you want to transfer files
to/from, run this from the command line:

  kermit (or ckermit, this will depend on your distribution)

When Kermit starts up, you'll see a prompt that ends with something
like:

  C-Kermit>

Connect to the PiDP-8 by entering the following:

  telnet /nowait {ip_address}:{port}

Substitute your PiDP-8's IP address for "{ip_address}", and the
appropriate port number for "{port}". You should see something like:

  Connected to the PDP-8 simulator TTIX device, line 0

We haven't tried this with any line other than 0, we're not sure if it
will work (it probably depends on how both the TTI/O-device
multiplexing and kermit work). Return to the kermit prompt by typing
Ctrl-\ C. Type:

  server

You'll probably see a nice ASCII status display. On the PiDP-8 side,
at the prompt enter:

  R K12DJG

This version of Kermit has apparently been patched to use TTI/TTO - we
didn't have any luck using the standard kermit, which may try to use
the console as the transfer device. You'll see a prompt like:

  KERMIT-8/E>

Entering "HELP" will get you a bit of information about the available
commands. We were able to successfully use "SEND" to send a file to
Linux, and "GET" to receive one (note again that the file on the Linux
side must have an all-uppercase name to be able to get it). When
you're done transferring, type the EXIT command.

We were seeing a transfer rate of about 1400-1500 characters per
second, yours might be different.

To exit on the server (Linux) side, type ctrl-C (that works on ours at
least), and "exit". You may be asked to confirm.

Good luck!

-Len and Josh

Remy van Elst

unread,
Dec 25, 2016, 3:17:47 AM12/25/16
to Len, PiDP-8
Yay! Awesome of you to research this more!

I'm able to SEND files to my host OS. Suprising how small things are:

$ ls -la basic.sv
-rw-r--r-- 1 remy remy 67 Dec 25 09:09 basic.sv

$ hexdump basic.sv
0000000 037f 007c 0440 0000 3605 1f00 2a0b 2224
0000010 363e 0066 0000 0932 3f0f 0132 3e03 1318
0000020 3d0f 3c03 0a39 0a39 1308 3b17 3a0b 003d
0000030 0b2a 390b 0639 0638 0638 381f 0932 370f
0000040 0132 0001                             
0000043

I'm having trouble with the GET however:

KERMIT-8/E>GET TEST
?UNABLE TO RECEIVE LATEST PACKET

ckermit on the host just says this:


Connected to the PDP-8 simulator TTIX device, line 0

# N3EST<


File does exist on the host, in the folder where ckermit is running and where the SEND file are placed:

$ cat TEST
10 PRINT TEST

20 PRINT PI


10 LET PI="3.14 BLA"



Any tips?

--
You received this message because you are subscribed to the Google Groups "PiDP-8" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pidp-8+unsubscribe@googlegroups.com.
To post to this group, send email to pid...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pidp-8/6e8364e2-2e47-42f9-85e1-05b585215480%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Len

unread,
Dec 25, 2016, 1:39:42 PM12/25/16
to PiDP-8, pdp...@gmail.com
Hmm ... that sounds like the server wasn't still running on the non-8 side when you tried to get a file from it.

The .SV file on the server side sounds too small also, we're going to try to transfer one 8->server->8 and see what happens. My son is seeing errors when he tries that - there may a parameter we have to change somewhere, or just just use the encoder/decoder.

Len

unread,
Dec 25, 2016, 2:24:59 PM12/25/16
to PiDP-8, pdp...@gmail.com
More info - it turns out you need to encode binary files on the 8 side before you send them, and decode them when you receive them (assuming that you have them in encoded form, of course). Use K12ENC.SV:


to encode, and K12DEC.SV:


to decode them - they're both already on Oscar's OS/8 RK05 image, I'm guessing on Warren's as well.

My son is considering writing versions of those programs for use on the non-8 side, if he doesn't find that they already exist - the encoder would certainly be a useful adjunct to the palbart cross-assembler:


-Len

clasystems

unread,
Mar 11, 2017, 9:04:51 AM3/11/17
to PiDP-8

I am the author of Kermit-12 [some of you might know me].

The STANDARD version of Kermit-12 uses the 03/04 console as ONLY the console and requires another serial port that is compatible with such as the PT08 or KL8 interfaces.  From the release copy, the standard external port is 40/41, and apparently some have gotten some success with SIMH on various machines using the standard release binary.

A word of caution:  The RELEASE binary is NOT merely assembling the main source code in the file released as K12MIT.PAL which you might rename in OS/8 as K12MIT.PA; those release names are TOPS-10 file name conventions, and in the case of PAL source files, this is commonly done, etc.

In any case, this is how to create what is in the release from the source files [this information is in K12MIT.PAL, but so many people are too damned much in a hurry.  Read the first about 20-odd pages, it is chock full of good info@

The "bare" file is NOT suitable for the obvious install because the Kermit-12 project was NOT started by me, I 'inherited a turkey of a failing program written by a bunch of people all of whom had some modest input to the project, and it wasn't even called K12mit-12 !  It was non-functional and called K08MIT because that is their naming convention and they ASSUMED that it worked.  It was quite NON-FUNCTIONAL so I had my hands full then, etc.  Long story short, I had to work with these people [minimally] and thus, to keep peace in the valley, I had to dignify what they had done, so much was this insufferable, I had to add a patch done by one of them that was a BAD fix to an EXISTING bug.  It in fact did not fix it, it made it DIFFERENTLY non-functional!  I guess the notion of ACTUALLY TESTING THE CODE was above their paygrade, etc.

Thus, I creates a very "professional" edit history, and backed it all the way to the beginning, and gave overly forgiving "credit: to all that came before me.  One of them thanked me for taking it over because he admitted he was nearly clueless, but it was helpful for his job, etc.

So, long story short, there are a  few "pet frills" in the code to accommodate this, and the code was 100% unchanged until I believe 1997.

In any case, you should use the copy from the release, which is in Kermit ENCODE format, and for that you need the source code in the package K12DEC.PAL and if you want to create your own similar files the companion K12ENC.PAL.  I deliberately used some slightly oversimplified source code conventions so that just about any lame and/or buggy version lf PAL8 could at least assemble the K12DEC.PAL source code into binary; the instructions on how to create the DECODE.SV [or K12DEC.SV if you wish] is all in the source file, again READ THE SOURCE CODE; OS/8 assembly and loading and saving REQUIRE OPTIONS TO BE SET!

Then, once you have DECODE.SV available, you can do all of the following:

1) You can get from the package PAL8.ENC and CREF.ENC.  Not only are these at least good enough for this purpose, they are better than that!  These are the PAL8.SV and CREF.SV from OS/278 V2, the last DEC release of PAL8 and CREF.  I have personally checked to make sure there is no model-dependent code in them; that's unfortunately a rarity and in general, I do not recommend you use anything past OS/8 V3D (3Q) with SIMH other than a few minor patches, such as the patch to bring PAL8 V10A to V10D'.  But that is all moot in this case as these two fix all known FIXED bugs.  [No, there are of course additional bugs; I will be glad to discuss them if anyone wants to know; some of these bugs are actually discussed in those twenty-odd first pages of K12MIT.PAL; I said there is a LOT in there above!

Regardless, there is no reason not to use PAL8 version B0 and CRED version B0 [note:  OS/278 version numbers are backwards!].  I use these daily in SIMH as I am perhaps the only, but in any case profusely active PDP-8 code developer currently.

So, do yourself a favor and get these from where those Kermit-12 files come from.  If you need a copy from my archive, they are available here:

http://www.ibiblio.org/pub/academic/computer-science/history/pdp-8/kermit/k12/

2) You can grab K12MIT.ENC and use the DECODE program to produce the intended release of Kermit.12 from me.

To create it yourself from the source FILES in the archive, you need several files:

a) PARAM.PAL.  The assembly is meant to be initialized with this file, or an equivalent, or by editing the standard source file, but in the process it breaks the release as it was meant for those other early developers.  [Yes, they no longer matter, but put yourself in my position back in the day, I had to work on THEIR hardware by THEIR rules!]

b) K12MIT.PAL again the one from the release.

I know there are copies of an ALLEGED K12MIT.SV or perhaps KERMIT.SV that are NOT my authorized versions.  Invariably someone didn't take the trouble to read how to assemble it!  Follow the directions and you can reproduce it fine, or just decode it as is, either way you get the same exact thing if you don't screw up like clearly some other well-intended ignoramuses have.

This is how you get K12MIT.BN, but not quite the RELEASED K12MIT.SV.  You can make something close enough to use, but a valid discussion is what is different from the now corrected near-obvious and what is in the actual release?

The ENCoded versions of the release files that are binary .SV files have been CLEANLY loaded and saved using the documented instructions EXCEPT you MUST also load
in the command to ABSLDR BEFORE the appropriate binary, the file Z4K or Z8K depending on the exact file.  [Again, all the sources tell you which one.  In general,the Kermit file needs Z8K and the other utilities need the Z4K.

What is in those tiny source files on the release is this:

FIELD 0
*0
ZBLOCK 7600-.

That's all that is in the Z4K.PAL file, the Z8K file is all of that AND also

FIELD 1
*0
ZBLOCK 7600.-

What this does is create a "clean" core image in the sense that all unloaded areas in memory instead of OS/8 leaving behind junk, instead they contain 0000; non-zero words are the code and data loaded from the assembled binary of the source file in question, etc.

The net result is identical to the normal way, except that any and all unused spaces in memory contain 0000.  Why does this matter?

Because if you ENCode that clean binary, the resultant .ENC file is MUCH SMALLER.

One of the features of the ENCoding program is called run-length repeat compression.  When the program encounters a 0000- word in the unencoded file, it then starts a process to fine additional 0000 words adjacent to that one.  In terms of the innards of the encoded file, any length of 0000 in a row is representable by only TWO WORDS even if the actual binary loaded an entire field of memory.  Thus, you get nice clean core images and much smaller ENCoded files as well, just by using that extra tip in the ABSLDR command line, etc.

Thus, chose your own method, but that is exactly what I did to create the release.  If you want to make custom changes READ THOSE TWO DOZEN or so PAGES AT THE FRONT of K12MIT.PAL; read and understand and you can customize it like a champ.

Now onto the K12DJG file.  This was done without my knowledge by a user who did not obey my source file conventions, thus in many ways it "breaks" the source needlessly. He was not concerned and his motives was an expedient way to make there not be the need for a second serial port because on some machines this is quite difficult, so for him, this made sense.  When I get some time to do some cleanup, I have a couple of other to-do list items to update Kermit-12 on other issues, and I will update the first 20 or so pages to include what gets done at that point.  That way, one NEWER source file works for all [and I will likely add a parameter so that IF you use PARAM.PAL or equivalent, you have to set the parameter to accept it and the NEW default will be to NOT use it, etc.  And the change he made will be integrated in properly.

The DJG version is only useful if the device that acts as the 03/04 console input to the PDP-8 session is ALSO a Kermit protocol aware terminal emulator.  Needless to say, there are terminal emulators that can also become Kermit-aware.  This goes back to the original terminal program in Windows 95 and certainly that wheel has been re-invented many times.

In fact. I once contemplated this myself [but never had the time:.  I wanted Kermit-12 for say a DECmate III to be the console on a PDP-8/E.  With this escape-back feature, then the PDP-8 could Kermit-transfer to the DM III, its own console.  But I never did and besides, that 8/E system had a 40/41 interface in it already, and that's the universal default serial port for all PDP-8s in most instances.  I can't say I invented the convention, but I have certainly been using it for well over 40 years, etc.

Thus, in short:

Use the release version if you can have a second serial port.  Use the OFFICIAL one, please, the one I support and if you must reassemble it, read the documentation to do it right.

And if you can put up with the unofficial changes I cannot be responsible for, then by all means use the DJG version until I can release a newer-still version.  I cannot say when, I am quite busy on several other much larger PDP-8 12-bit projects currently, some of which I may be announcing fairly soon, perhaps next month even.  But I only got two hands and one head/breain!

Hope this makes it crystal clear what you are dealing with and how to avoid pitfalls created by others, no matter their intentions.

cjl

clasystems

unread,
Mar 11, 2017, 9:15:36 AM3/11/17
to PiDP-8, pdp...@gmail.com


On Sunday, December 25, 2016 at 2:24:59 PM UTC-5, Len wrote:
More info - it turns out you need to encode binary files on the 8 side before you send them, and decode them when you receive them (assuming that you have them in encoded form, of course). Use K12ENC.SV:


to encode, and K12DEC.SV:


You are essentially correct; see ,my comprehensive post elsewhere in the PIPD=8 forum as I am quite the newcomer here, but I am the resident expert on all things PDP-8 other than ANYTHING about the PIPDP-8, I don't even have one, but I am willing to learn if someone can get me started.  I've got nothing on one subject and EVERYTHING on the other subject.


to decode them - they're both already on Oscar's OS/8 RK05 image, I'm guessing on Warren's as well.

From what I gather, the former is where some of the DEFECT\IE core images are; see my other post here.  [Warren Stearnes?  If so, he knows me personally.]
 

My son is considering writing versions of those programs for use on the non-8 side, if he doesn't find that they already exist - the encoder would certainly be a useful adjunct to the palbart cross-assembler:

There is no point in supporting an incompatible assembler.  That's WHY we have SIMH to avoid the obvious problems.  It appears no one has the discipline to take the trouble to find out what matters; avoid the grief and just use SIMH!  If someone wants to hear some laundry list items, I can perhaps tell you why that item is quite incompatible.  I have noticed that a lot of people who do not INTIMATELY know PDP-8 assembly language sloppily write mediocre code.because frankly, they are not serious about the process.  I "pre-date" all of you and I have yet to see anything completely acceptable.  That's why SIMH is so great, etc.

Now that said, you can look at my source code for the DECODER and the ENCODER and the associated format .DOC file in the release.  It's all in there, and if you cannot understand every aspect of the specification, don't bother; if you can master all of that, I will help you get it right.

But also remember that because all the Kermit-12 utilities exist, you can create any archive of any PDP-8 files properly in the encode format NOT WRITING A LINE OF CODE and just intelligently using what I wrote over 30 years ago!

cjl

John D.

unread,
Jul 30, 2017, 2:13:05 AM7/30/17
to PiDP-8, pdp...@gmail.com
Hi Remy,

I was experiencing the same problem as you - could send files but getting the "?UNABLE TO RECEIVE LATEST PACKET" error when trying to receive. I was able to fix that by adding "set throttle 333k" to my pdp8.ini file. So a timing issue maybe? Anyhow, I can now send and receive successfully from within OS/8, using K12DJG. 

For the record, the setup I'm using is similar to Len and Josh's setup, but with a couple of possibly significant differences:

I'm not actually running this on the pidp 8 at this point. My testing setup is entirely on my ubuntu linux laptop. So I've got simh running a PDP 8 instance, which communicates with the host computer via an emulated null modem (tty0tty). The file transfer program on the host side is, not surprisingly, c-kermit. 

My pdp8.ini file looks like this:
set cpu 32k
set cpu noidle
set throttle 333k
attach ptr ptr.txt
attach ptp ptp.txt
set lpt enable
attach lpt lpt.txt
attach ttix Line=0,Connect=/dev/tnt0;9600-8n1
set ttox0 8b
attach rk0 systemdisk.rk05
boot rk0

... /dev/tnt0 being one of the null modem ports created by tty0tty. It is paired with /dev/tnt1, so the Kermit on the unix/host side has to SET PORT /dev/tnt1 before anything else is set. All of the other kermit settings are fairly standard (8N1).

I believe this setup can now be replicated on the pidp8; I'll just need two null modem USB cables - one for the console, and one for ttix. I will advise if I am successful.

John

William Cattey

unread,
Oct 28, 2020, 5:21:36 PM10/28/20
to PiDP-8
 I'm reactivating this thread after all this time because I'm doing the work to put "Build from Source" into the pidp-8/i development tree.

I've not used kermit.

I think I've used the decoder code once.

cjl is no longer with us.

Is there anyone monitoring this thread who would be willing to test the binaries I build from the distribution source?

-Bill
Reply all
Reply to author
Forward
0 new messages