Bottoms up delivers a bubbling MPE future
Open source enables MPE enhancements

Community experts explore Opening SSH

A little way back in July, we reported that the OpenSSH software on the HP 3000 was still somewhat short of full open source functionality. It could be completed, with some extra help from community experts and some testing. Brian Edminster of Applied Technologies looked into what was needed to create a OpenSSH interactive client that would run under MPE/iX.

For anybody new to OpenSSH, it supplies services for encrypted communication sessions. Secure file transfers are the prize here. This would be one way to use the 3000 as an SFTP server, not just a client.

Edminster said, "The fact remains that SSH cannot connect to a remote system and execute commands that produce any output. Ken Hirsch did the original port, but he only really needed the SFTP client -- so the issue with ssh wasn't addressed."

Hirsch had asked years ago "if anybody knows a way to actually write to a terminal while there is a read pending, then I could use OpenSSH as a server on the HP 3000. Apparently there are undocumented MPE/iX sendio() and rendezvousio() calls. There are also tread()/twrite() routines in libbsd.a that I think are intended for this, but there's no documentation for these, either." 

As of this week, the community is looking into connecting these dots and producing documentation.

We asked out on the 3000 newsgroup if anybody with access to source code or inside knowledge of these routines might help. First, Keven Miller of 3K Ranger looked into the MPE routines.

Long ago I looked at the libbsd contribution, and was sad that it didn't come with the sources. Just include files. So, with Ron's request, I started playing with it. So, here are some details of my testing....

 1. I extracted the OIO module from libbsd.a (NMRL), which contains tread,twrite.

 (I had to manipulate the libbsd.a file some, in order to access it)

 2. I created this C test program

#pragma intrinsic FOPEN
#pragma intrinsic FCLOSE
proc int main ()
 int R, n;
 short f;
 char buf [40];

f = FOPEN ( "TTY", 0644, 00004 ); /* cctl,und,stdin,ascii r/w */
printf ("tread 5>");
fflush (stdout);
memset (buf, '*', 10)
buf [10] = 0
R = tread (f, buf, 5)
printf ("tr %d [%s]\n", R, buf);

n = sprintf (buf, "-twrite-")
R = twrite (f, buf, n);
printf ("tw %d\n", R);

R = tread (f, buf, 0);
printf ("Done\n");
FCLOSE ( f, 0, 0 );
return 0;


So it appears to run okay.

  • tread acts like a binary read. It must read the count characters. i.e., 5 in my code.       
  • Return does not terminate the read.   
  • tread returns the number of characters read. It uses an MPE file number.   
  • twrite returns the number of characters written.

Next, I need to test as two processes or two threads to have them both active.

However, the problem is it leaves the terminal in some odd state. Once the program ends, I get the CI prompt. But when I hit return, it appears to be hung. It can receive TELLs. If from another session, I do abortio on its stdlist device, it shows SOFTWARE ABORT, then get the CI prompt. But hung again.

After aborting the session, (in Reflection NSVT), I can log back in and have a normal TTY.

Oh, and the program requires PM. Underneath tread/twrite, it calls sendio and rendezvousio. I did try FOPEN with nowait-io set. tread didn't read (no echo of characters) and could not complete the read.

Stan Sieler of Allegro took on the task next, but he issued a caveat about working with the deep-inside routine. (Allegro has licensed source code for MPE/iX, but there's no obvious path between that source and Sieler's testing). He addressed the need to use the tread and twrite calls.

Yes and no, it depends.  (There's some terminology and background needed to explain.)

So, in brief... "genmsg", an undocumented routine in the kernel of MPE/iX (and MPE V), has the ability to do "non-preemptive," "soft preemptive" and (allegedly) "hard preemptive" writes to terminals, including network terminals

(However, it's not clear if true (MPE V style) "hard preemptive" writes were ever implemented on MPE/iX.)

But genmsg requires privileged mode, and the routine is capable of aborting the system if called incorrectly. I usually hesitate to post information about potentially dangerous routines.

This doesn't conclude the quest to finish up OpenSSH for the 3000 user, so a server as well as a client is available. But now the ball is rolling, thanks to this notice from some other MPE experts.

It's not clear if enabling the server aspect of OpenSSH would be considered an MPE/iX enhancement by Hewlett-Packard -- or just a repair of a bug report, and then a workaround for anybody who'd like complete OpenSSH on their MPE system.