Using Kermit to Transfer files to/from SIMH HP3000

After talking to another HP3000 SIMH user who had no viable way to transfer files to the HP3000, I set out to look for something a bit easier than create a simH tape. OK, using kermit still isn’t simple, but it is a little more accessible.

Back before the internet, files were transferred between mini computers, like the HP3000, and PCs using file transfer programs such as Kermit. There were others such as xmodem, ymodem, and zmodem. I’m using Kermit because I have access to a copy that will work on top of telnet.

Forgetting for a moment about telnet, here is roughly how kermit works. From your PC, you  connect to the HP3000 over a serial or modem connection. You run kermit on the hp3000, and tell it whether to send or receive a file. You then tell the local software whether to send or receive a file. The two programs would then perform the transfer for you. Pretty clumsy by today’s standards.

The first thing you will need is Kermit for the HP3000. I found the source for an HP3000 version at http://www.columbia.edu/kermit/archive.html#hp. This link includes just the source, but I’ve compiled it for you and put it on a simH format tape so it is easy to copy to the HP3000.

Note to self: this version of kermit requires the abortsess intrinsic which is not available on the old version of MPE being used by simH. I deleted those 2 lines which really shouldn’t be a problem as I’m not anticipating needing the HP3000 to abort my session after transfer is complete.

I assume you are running HP3000 SIMH from the distribution I made available in my blog. If not, you may need to alter directory locations in the examples.

Restore Kermit on HP3000

  • To get the HP3000 binary of kermit, download this zip file which contains the simH tape:

http://www.xyfyx.com/files/kermit.tap.zip

  • Inside of the zip file you will find a single file, kermit.tap. Move it to your c:\hp3000Sim directory.
C:\hp3000Sim>dir kermit.tap
 Volume in drive C is c180104
 Volume Serial Number is D6EF-2751

 Directory of C:\hp3000Sim

08/24/2019  09:55 AM            74,360 kermit.tap
               1 File(s)         74,360 bytes
               0 Dir(s)  354,664,509,440 bytes free
  • Fire up your HP3000 emulator if you haven’t already. Then mount the tape as read only:
HP3000 / MPE V E.01.00 (BASE E.01.00). FRI, AUG 23, 1991, 4:47 PM
: <<<press control-E>>>
Simulation stopped, P: 071144 (PAUS 0)
sim> attach -r ms0 kermit.tap
MS: unit is read only
sim> go

9:31/10/Vol (unlabelled) mounted on LDEV# 7
  • Log in as manager.sys and restore kermit:
:HELLO MANAGER.SYS

CPU=1. CONNECT=1. SAT, AUG 24, 1991, 10:01 AM
10:01/#S3/16/LOGOFF ON LDEV #20

10:01/#S4/17/LOGON FOR: MANAGER.SYS,PUB ON LDEV #20
HP3000 / MPE V E.01.00 (BASE E.01.00). SAT, AUG 24, 1991, 10:01 AM
:FILE T;DEV=7
:RESTORE *T;@.PUB.SYS;OLDDATE;SHOW;KEEP
?10:01/#S4/17/IS "T" ON LDEV#7 (Y/N)?
<<<NOTE: You must type control-A here to get the '=' prompt>>>
=REPLY 17,Y
<<<The '17' matches the reply request PIN# of 17 in the request to mount "T">>>
SAT, AUG 24, 1991, 10:01 AM

  FILES RESTORED = 3

    FILE    .GROUP   .ACCOUNT   LDN  ADDRESS
    KERMIT  .PUB     .SYS       1    %275302
    JOBINFOU.PUB     .SYS       1    %277142
    JOBINFOI.PUB     .SYS       1    %252747

  FILES NOT RESTORED = 0

:LISTF KERMIT,2
ACCOUNT=  SYS         GROUP=  PUB

FILENAME  CODE  ------------LOGICAL RECORD-----------  ----SPACE----
                  SIZE  TYP        EOF      LIMIT R/B  SECTORS #X MX
KERMIT    PROG    128W  FB         221        221   1      222  1  1

:LISTF JOBINFO@,2
ACCOUNT=  SYS         GROUP=  PUB
FILENAME  CODE  ------------LOGICAL RECORD-----------  ----SPACE----
                  SIZE  TYP        EOF      LIMIT R/B  SECTORS #X MX
JOBINFOI           72B  FA          18         18  18       12  1  1
JOBINFOU  USL     128W  FB          54        400   1      201  1  2

Test Kermit

Unless you’ve already installed the JOBINFO intrinsic, kermit will fail:

:RUN KERMIT
UNRESOLVED PROG EXTERNAL JOBINFO
SL BINDING ERROR (LOAD ERR 27)
UNABLE TO LOAD PROGRAM TO BE RUN. (CIERR 625)
:

That just means that kermit is trying to access the jobinfo intrinsic which is not part of this old version of MPE. Fortunately, Keven Miller wrote a freeware version we can install.

:SEGMENTER
HP32050A.01.08 SEGMENTER/3000 (C) HEWLETT-PACKARD CO 1985
-USL JOBINFOU
-SL SL.PUB.SYS
-ADDSL JOBINFO
-EXIT

END OF SUBSYSTEM
:

and now kermit will run:

:RUN KERMIT

HP 3000 KERMIT VERSION: 12 JULY 1994
Works best with PC Kermit V2.31 or newer.
You can now use PARM= on RUN stmt to specify TAKE file.

KERMIT3000>EXIT

END OF PROGRAM
:

Installing Kermit on Your PC

I found a version of Kermit that will run on top of telnet here:

http://www.kermit.wwarthen.com/Download.htm

If that link ever goes away, I kept a copy of the 32bit zip version here:

http://www.xyfyx.com/files/kw32v085.zip

My preference was to copy the zip file and unzip it into c:\kermit.

After installing, start the PC kermit and it will look like this:

Configure Kermit on Your PC

Kermit needs to be configured to use TCP/Telnet to access the host. This example assumes that you have the hp3000Sim on your local host and are using port 1054 for telnet access to the simulator.

  • In the menu, go to Configure | session and set the connection to tcpip:

  • Go to Configure | Communications and set host to localhost (or the proper value) and port to 1054:

  • Now go to Session | Connect. This should connect to the HP3000 and you will see
Connect to the HP3000 simulator ATCD device, line <n>
  • Press the Enter key a few times and you should get a ‘:’. In kermit, I suggest you always logon using term type 18:
:hello manager.sys;term=18

Term=18 tells the HP not to use the its proprietary flow control.

Now that the settings are correct, I saved mine using File | Save As and saved them as kermitsettings.krm for future use.

Test Download of A File

Let’s download a file from the HP3000 to verify everything works.

  • In Kermit for PC, type
:run kermit.pub.sys

HP 3000 KERMIT VERSION: 12 JULY 1994
Works best with PC Kermit V2.31 or newer.
You can now use PARM= on RUN stmt to specify TAKE file.

KERMIT3000>
  • We are going to download a file called dumpmini, so we tell Kermit for HP to SEND that file:
KERMIT3000>send dumpmini.pub.sys
Escape back to your local KERMIT and enter the RECEIVE command
  • The HP is now ready to send the file, so on kermit for PC, we select Kermit | Receive and the transfer occurs:

Note: When you type EXIT into the kermit for HP3000, you will see nothing. This is because Kermit has turned off echo.

On old character mode operating systems such as MPE, every character you type is sent to the HP3000 and then the HP3000 echos it back to the monitor so you can verify it was received properly. On an old 300 baud modem, noise sometimes garbled terminal I/O so this was a way for you to verify your input.

Echo during a file transfer would be bad, so it gets turned off. Oddly, kermit doesn’t turn it back on. No worries, just type ESC+: and echo is turned on. ESC+; turns it off.

Review the Downloaded File

Kermit for PC doesn’t have a way to specify where files are downloaded on the PC. If you manually set the configuration, files will get downloaded to the c:\kermit directory. If you open a settings file (.krm), then the files are downloaded to that directory. Crazy! When I figured this out, I put a copy of my krm file in c:\tmp, so files would download there.

Let’s take a quick look at the file downloaded to verify it looks right. Since I downloaded dumpmini.pub.sys, the file will be found in c:\tmp\dumpmini.pub.sys:

What the??? What are those numbers to the right? Welcome to the age of punched cards.

In MPE, ASCII files can be numbered or unnumbered. Source code for programs were almost always numbered. Most of the computer languages for the HP3000 allowed you to use columns 1-72 for code and then columns 73-80 contained a sequence number. This sequence number came directly from the days of punch cards and was held over on disk files. COBOL was a little different. The sequence number was in columns 1-6, giving you columns 7-80 for the program.

Sequence numbers on punched cards could sometimes be very handy if you dropped the card deck. You could run the cards thru a sorter to resequence the deck. Not that that was a particularly fast operation as you could only sort on one column at a time.

HP editors took sequence numbers into account and would display them in a nicer format:

/t dumpmini
  File numbered
  Record length: 80    bytes
  Number of records: 79
  File code: 0
/l all
    1     !JOB FIELD.SUPPORT,PUB
    2     !EDITOR
    3     S SHORT;AQ
    4                                                       S.O. Ref.#____________
    5
    6                             HP SERVICE REQUEST FORM   SR #_________(HP only)
    7
    8     ************************************************************************
    9     Customer report no.________________                     Date__________

Downloading Multiple Files from the HP3000

You can use kermit’s SERVE mode to download multiple files.

  • On kermit for HP3000, type SERVE:
KERMIT3000>serve
Entering SERVER mode - escape back to your local KERMIT
  • Now, in kermit for PC, select Kermit | Get. This brings up a window where you can type in a file name, or use a wild card such as jobinfo@

Note: In the Get windows, you cannot specify group/account name (e.g. jobinfo@.pub.sys). This means you must be logged into the group where the files reside to use the get command.

MPE’s File Structure

Before we can transmit files to the HP3000, you need to have a basic understanding of the file structure because it is very different from Linux/dos.

In Linux/dos, you only specify if a file is ASCII(text) or binary. Even that distinction is just a convention. In Linux an ASCII file is read sequentially and <LF><CR> indicates the end of the line.

On the HP3000, you specify if the file is ASCII or binary, and the length of each record. You can also specify how many records there are per block, the maximum number of records.

Further, a file must be built via the BUILD command, specifying all of these options before it can be accessed. Sometimes the program will do this for you, but it must be done.

A BUILD command with all options looks like:

                                                         F   BINARY
    :BUILD filereference[;REC=[recsize][,[blockfactor][,[U][,      ]]]]
                                                         V   ASCII

          [;DISC=[numrec][,[numextents[,[initalloc]]]]]

A normal ‘text’ file in MPE (such as for source code) would contain 80 byte fixed length ASCII records. Fixed length records are almost always used. Most editors work better with fixed length records. To build such a file with 1000 records, I would use:

:BUILD myfile;REC=-80,,F,ASCII;DISC=1000

As seen above, text records are normally a fixed length of 72 or 80 bytes. To get a Linux/DOS type file where the records are variable length, you could use:

:BUILD myfile;REC=-254,,F,ASCII;DISC=1000

Using Kermit Options to Specify File Structure Automatically

Fortunately, the writer of Kermit for HP3000 took into account this complexity and came up with a few standard formats you can automatically use:

KERMIT3000>set receive ?

The SET RECEIVE parameter is used to alter the
default conditions regarding file reception.
The various options are:

SET RECEIVE DEVICE
SET RECEIVE FCODE
SET RECEIVE BINARY
SET RECEIVE RECLEN
SET RECEIVE FIXREC
SET RECEIVE BLOCKF
SET RECEIVE MAXREC
SET RECEIVE MAXEXT
SET RECEIVE SAVESP
SET RECEIVE PROG
SET RECEIVE TEXT
SET RECEIVE TXT80
SET RECEIVE BIN128
SET RECEIVE EXPTAB

Before transmitting the file to the HP3000, you can specify one of these options to create the appropriate structure:

  • TXT80 – files are received in ASCII, fixed 80 byte record lengths. The normal format for HP text editors. Lines > 80 characters are truncated! If that is an issue, use TEXT.
  • TEXT – files are received in ASCII, variable record lengths (max 254). If you are sending a PC text file with long line lengths, this is the best format.
  • BIN128 – upload file as binary, variable 128 word (256byte) record lengths. This would allow transfer of binary PC files to the HP3000.
  • PROG – if you are trying to transfer a program between HP3000’s, you would download it from the source HP to the PC in binary form. Then upload it to the destination PC using the SET RECEIVE PROG option so the file is properly setup as an executable file.
  • MAXREC – specifies the maximum # of records. If the default (5000) results in a failure because the file is too small, increase the max using this setting.

Upload a File to HP3000

In this example, I’m going to upload source code for a pascal program that simply prints “Hello World” on my PC to the HP3000, then compile it on the HP3000.

To do the transfer, start Kermit for PC, open the settings file for TCPIP settings, login as manager.sys,tmp (we want the source code in the TMP.SYS group, not PUB.SYS which is meant for system files), and start kermit on the HP3000.

We will use SET RECEIVE TEXT to allow uploading of a normal PC file which may have line lengths > 80 bytes. Finally, tell Kermit for HP3000 to RECIEVE world.tmp:

Now use Kermit | Send to send the source file that is on the PC.

The file has been uploaded properly:

:listf world,2
ACCOUNT=  SYS         GROUP=  TMP       

FILENAME  CODE  ------------LOGICAL RECORD-----------  ----SPACE----
                  SIZE  TYP        EOF      LIMIT R/B  SECTORS #X MX
WORLD             254B  VA           8       5000   1      314  1 32

Because the file is in variable record format (VA as type in above example), I would like to convert it to fixed format using EDIT/3000 so my editor of choice, QUAD, will work.

I use EDIT/3000, which can handle variable length records, to convert from variable to fixed, set the record length to 72, and then keep it as a numbered file. I do this using SET FORMAT=DEFAULT.

I know my longest line is <= 72 bytes. If it were longer, after using SET FORMAT=DEFAULT I could then set the length using SET LENGTH=nn.

:editor
HP32201A.7.16 EDIT/3000 SAT, AUG 24, 1991, 1:57 PM
(C) HEWLETT-PACKARD CO. 1984
/t world
FILE UNNUMBERED
/set format=default
/set fixed
WARNING - 'LENGTH' 254RESET TO 72
WARNING - 'RIGHT' 254RESET TO 72
*** WARNING *** DEFAULT VALUES SET FOR LENGTH, RIGHT, FROM, DELTA, REAR.
/verify all
1 program world;
^(1 )
LINES = 60
POLL = TRUE (I.E. BATCH = FALSE)
REAR = TRUE (I.E. FRONT = FALSE)
DELTA = 1
CURRENT DEPTH = 0, THE DEPTH LIMIT = 10
RIGHT =72
LENGTH = 72
LONG = TRUE (I.E. SHORT = FALSE)
TIME = 50
TOTAL NUMBER OF CURRENT LINES = 8
FROM = 1
LEFT = 1
FIXED = TRUE(I.E. VARIABLE = FALSE)
SIZE = 0
DISPLAY = TRUE (I.E. QUIET = FALSE)
FORMAT=DEFAULT
NO TABS USED
FILES:
WORK: K2361357
KEEP:
TEXT: WORLD.TMP.SYS SAT, AUG 24, 1991, 1:57 PM
JOIN:
/k world2
/e

END OF SUBSYSTEM
:

Here is a look at the cleaned up file, using QUAD:

:t world2

QUAD -- JHK, Quest Software, KWS, Summit Information Systems, June, 1991

/TABS 8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72; T *QTEXT
/T *QTEXT
File numbered
Record length: 80 bytes
Number of records: 8
File code: 0
/l all
1 program world(input, output);
2
3 begin
4
5 writeln('Hello World');
6
7 end.
8
/e

END OF PROGRAM
:

Finally we will compile and run it. For MPE there are 3 steps to go from source to running a program: compile, prep (link in other O/Ses), and run. These can all be combined into a single command, PASCALGO:

:pascalgo world2

PAGE 1 HEWLETT-PACKARD HP32106A.01.32 PASCAL/V (C) HEWLETT-PACKARD
CO. 1985 SAT, AUG 24, 1991, 2:12 PM

0 1.000 0 program world(input, output); 
0 2.000 0 
0 3.000 1 begin 
0 4.000 1 
0 5.000 1 writeln('Hello World'); 
1 6.000 1 
1 7.000 1 end. 
1 8.000 0

NUMBER OF ERRORS = 0 NUMBER OF WARNINGS = 0
PROCESSOR TIME 0: 0: 0 ELAPSED TIME 0: 0: 0
NUMBER OF LINES = 8 LINES/MINUTE = 48000.0

END OF COMPILE

END OF PREPARE

Hello World

END OF PROGRAM
:

Works! My last step for this section is to save the executable program to disk because I’m going to want it again in the next section:

:save $oldpass,worldp
:listf worldp,2
ACCOUNT=  SYS         GROUP=  TMP
FILENAME  CODE  ------------LOGICAL RECORD-----------  ----SPACE----
                  SIZE  TYP        EOF      LIMIT R/B  SECTORS #X MX
WORLDP    PROG    128W  FB           7          7   1        8  1  1

Copying a Program Between Two SIMH HP3000’s

The last procedure I’d like to document is how to move a program file from one SIMH HP3000 to another. In this example, I’ll use the same SIMH HP3000 as source and destination, but you will get the idea. I will copy the WORLDP program I just compiled above.

Get Kermit running on your PC and on the HP3000. On Kermit for HP3000, type

KERMIT3000>send worldp.tmp

On kermit for PC, do a kermit | receive from the menu.

The worldp executable program is now in c:\tmp:

C:\tmp>dir worldp.tmp
Volume in drive C is c180104
Volume Serial Number is D6EF-2751

Directory of C:\tmp

08/24/2019 02:22 PM           1,792 WORLDP.TMP
           1 File(s)          1,792 bytes
           0 Dir(s) 354,643,628,032 bytes free

I will now upload the file to the same HP3000, renaming it WORLDX.

In Kermit for HP3000, type

SET RECEIVE PROG
RECEIVE WORLDX.TMP

In Kermit for PC select Kermit | Send from the menu.

Once done, you can check the download occurred. WORLDX should have the same characteristics as WORLDP:

:listf world@,2
ACCOUNT=  SYS         GROUP=  TMP       
FILENAME  CODE  ------------LOGICAL RECORD-----------  ----SPACE----
                  SIZE  TYP        EOF      LIMIT R/B  SECTORS #X MX
WORLD             254B  VA           8       5000   1      314  1 32
WORLD2             80B  FA           8          8   3        4  1  1
WORLDP    PROG    128W  FB           7          7   1        8  1  1
WORLDX    PROG    128W  FB           7          7   1        8  1  1

Finally run it as a test:

:run worldx

Hello World

END OF PROGRAM

 

This entry was posted in c-retro, Uncategorized and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.