Connecting a Hewlett-Packard HP-48SX to an Apple PowerMac G4 running Mac OS X 10.2.5 “Jaguar”

(Wolfgang dot Husmann at huswelt dot de <2003-04-25/11:00:28>)

Background: I own a Hewlett-Packard HP-48SX pocket calculator which is able to communicate with a remote host computer by the Kermit protocoll. I used this communication path without problems on various Apple Macintosh computers running Mac OS 7, 8 and 9 for many years. Recently I moved to a PowerMac G4 running Jaguar (Mac OS X 10.2.5). This machine has no serial port and no GUI Kermit application is available for Mac OS X.

  1. Install the Griffin gPort hardware ( http://www.griffintechnology.com/products/gport/ ). The Griffin gPort replaces the modem port of a PowerMac G4 with a Mini-DIN-8 serial port capable of LocalTalk and MIDI. It is possible to install the gPort without cutting the wire of the pre-installed modem so at a later time one can remove the gPort and re-install Apples modem.
  2. Download and install the most recent gPort OS X software from the gPort Serial Adapter Software Downloads Page of Griffin Technology, Nashville, Tennessee ( http://www.griffintechnology.com/software/software_serial.html ). This establishes two additional serial devices for Mac OS X:
    
    [centerpiece:~] wolfgang% ls -aol /dev/ | grep gPort
    crw-rw-rw-   1 root      wheel     -  8,   1 Apr 20 10:14 cu.gPort
    crw-rw-rw-   1 root      wheel     -  8,   0 Apr 20 12:34 tty.gPort
    [centerpiece:~] wolfgang% 
    				
  3. For security reasons create a special user for the handling of the uucp lockfile directory:
    
    [centerpiece:~] wolfgang% sudo niload passwd . << EOF
    ? uucplock:*:555:-1::0:0:UUCP Lock Directory Owner:/dev/null:/dev/null
    ? EOF
    [centerpiece:~] wolfgang% nireport . /users uid gid name realname home shell | grep uucplock
    555     -1      uucplock        UUCP Lock Directory Owner       /dev/null       /dev/null
    [centerpiece:~] wolfgang% 
    				
  4. Download the most recent binary package of C-Kermit for Mac OS X from the C-Kermit 8.0 Binaries Page of Columbia University, New York ( http://www.columbia.edu/kermit/ck80binaries.html ). Writing this text the most recent binary package is “cku209.macosx102nc-10.2”.
  5. The downloaded binary package is the complete Kermit application itself. Install it:
    
    [centerpiece:~] wolfgang% sudo mv cku209.macosx102nc-10.2 /usr/bin/kermit
    [centerpiece:~] wolfgang% sudo chown uucplock /usr/bin/kermit
    [centerpiece:~] wolfgang% sudo chgrp nobody /usr/bin/kermit
    [centerpiece:~] wolfgang% sudo chmod u=rxs,go=rx /usr/bin/kermit
    [centerpiece:~] wolfgang% rehash
    [centerpiece:~] wolfgang% ls -aol /usr/bin/kermit
    -r-sr-xr-x   1 uucplock  nobody  - 2210788 Mar 23 23:36 kermit
    				
    (“rehash” recomputes the tcsh hash table of the contents of the directories in the path variable.)
  6. Get the compiled-in location of the uucp lockfile directory and as a side effect do a quick go-no-go test of the installed application.
    
    [centerpiece:~] wolfgang% kermit
    C-Kermit 8.0.209, 17 Mar 2003, for Mac OS X 1.0
     Copyright (C) 1985, 2003,
      Trustees of Columbia University in the City of New York.
    Type ? or HELP for help.
    (/Users/wolfgang/) C-Kermit>show communications
    
    Communications Parameters:
     Line: /dev/tty, speed: unknown, mode: remote, modem: generic
     Parity: none, duplex: full, flow: none, handshake: none
     Carrier-watch: auto, close-on-disconnect: off
     Lockfile directory: /var/spool/uucp
     Typical port device name: /dev/tty00
    
    Modem signals unavailable
    
    Type SHOW DIAL to see DIAL-related items.
    Type SHOW MODEM to see modem-related items.
    
    (/Users/wolfgang/) C-Kermit>quit
    [centerpiece:~] wolfgang%
    				
  7. Create the uucp lockfile directory:
    
    [centerpiece:~] wolfgang% sudo mkdir /var/spool/uucp
    [centerpiece:~] wolfgang% sudo chown uucplock /var/spool/uucp
    [centerpiece:~] wolfgang% sudo chgrp nobody /var/spool/uucp
    [centerpiece:~] wolfgang% sudo chmod u=rwx,go=x /var/spool/uucp
    [centerpiece:~] wolfgang% ls -aol /var/spool/ | grep uucp
    drwx--x--x   2 uucplock  nobody  -  68 Apr 20 12:21 uucp
    [centerpiece:~] wolfgang% 
    				
  8. Install Kermits man page.
    1. Download Kermits man page. The C-Kermit 8.0 Update Notes Page ( http://www.columbia.edu/kermit/ckermit80.html ) states that “ckututor.html (is the) C-Kermit Tutorial (for Unix). Also distributed in Nroff form as ckuker.nr ( ftp://kermit.columbia.edu/kermit/f/ckuker.nr ), the Unix C-Kermit manual page”.
    2. Install the man page.
      
      [centerpiece:~] wolfgang% sudo mv ckuker.nr /usr/share/man/man1/kermit.1
      [centerpiece:~] wolfgang% sudo chown root /usr/share/man/man1/kermit.1
      [centerpiece:~] wolfgang% sudo chgrp wheel /usr/share/man/man1/kermit.1
      [centerpiece:~] wolfgang% sudo chmod a=r /usr/share/man/man1/kermit.1
      [centerpiece:~] wolfgang% sudo /usr/libexec/makewhatis /usr/share/man/
      [centerpiece:~] wolfgang% ls -aol /usr/share/man/man1/kermit.1
      -r--r--r--    1 root  wheel  -  62344 Apr 20 23:00 kermit.1
      [centerpiece:~] wolfgang% 
      						
      (“makewhatis” updates the whatis database of man pages.)
  9. A sample transfer session:
    1. Check the HP-48SXs communication parameters. For me the following parameters work fine:
      
      IR/wire:       wire
      ASCII/binary:  ASCII
      baud:          9600
      parity:        none 0
      checksum type: 3
      translate code:1
      						
    2. In Mac OS Xs Terminal launch C-Kermit:
      
      [centerpiece:~] wolfgang% kermit
      C-Kermit 8.0.209, 17 Mar 2003, for Mac OS X 1.0 Copyright (C) 1985, 2003, Trustees of Columbia University in the City of New York. Type ? or HELP for help. (/Users/wolfgang/) C-Kermit>
    3. Configure C-Kermit to use the gPort:
      
      (/Users/wolfgang/) C-Kermit>set line /dev/tty.gPort
      (/Users/wolfgang/) C-Kermit>
      						
    4. Check C-Kermits other communication settings whether they match the corresponding settings on the HP-48SX:
      
      (/Users/wolfgang/) C-Kermit>show communications
      
      Communications Parameters:
       Line: /dev/tty.gPort, speed: 9600, mode: local, modem: generic
       Parity: none, stop-bits: (default) (8N1)
       Duplex: full, flow: rts/cts, handshake: none
       Carrier-watch: auto, close-on-disconnect: off
       Lockfile: /var/spool/uucp/LCK..tty.gPort
       Terminal bytesize: 8, escape character: 28 (^\)
      
       Carrier Detect      (CD):  On
       Dataset Ready       (DSR): Off
       Clear To Send       (CTS): Off
       Ring Indicator      (RI):  Off
       Data Terminal Ready (DTR): On
       Request To Send     (RTS): On
      
      Type SHOW DIAL to see DIAL-related items.
      Type SHOW MODEM to see modem-related items.
      
      (/Users/wolfgang/) C-Kermit>
      						
      If necessary match C-Kermits settings with the HP-48SXs ones:
      • set speed …
      • set parity …
      • set flow-control …
      • set handshake …
    5. Connect the HP-48SX by its Mac serial cable to the G4s gPort.
    6. Set the HP-48SX to Kermit Server Mode:
      
      Awaiting Server Cmd.
      						
    7. Initiate file transfers from C-Kermit:
      
      (/Users/wolfgang/) C-Kermit>get FPFahrListe hp48dir
      
      E to send Error packet, ^C to quit immediately, ^L to refresh screen.
      
      C-Kermit 8.0.209, 17 Mar 2003, centerpiece.local. [192.168.144.3]
      
         Current Directory: /Users/wolfgang/hp48dir
      Communication Device: /dev/tty.gPort
       Communication Speed: 9600
                    Parity: none
               RTT/Timeout: 01 / 03
                 RECEIVING: FPFahrListe => FPFahrListe
                 File Type: BINARY
                 File Size:
              Bytes So Far: 2445
                                ...10...20...30...40...50...60...70...80...90..100
              Elapsed Time: 00:00:37
        Transfer Rate, CPS: 65
              Window Slots: 1 of 1
               Packet Type: B
              Packet Count: 35
             Packet Length: 8 
               Error Count: 0
                Last Error:
              Last Message: SUCCESS.  Files: 1, Bytes: 2445, 65 CPS
      
      (/Users/wolfgang/) C-Kermit>send demo/LISTDEMO
      
      E to send Error packet, ^C to quit immediately, ^L to refresh screen.
      
      C-Kermit 8.0.209, 17 Mar 2003, centerpiece.local. [192.168.144.3]
      
         Current Directory: /Users/wolfgang
      Communication Device: /dev/tty.gPort
       Communication Speed: 9600
                    Parity: none
               RTT/Timeout: 08 / 10
                   SENDING: demo/listdemo => LISTDEMO => LISTDEMO
                 File Type: TEXT (utf8 => utf8)
                 File Size: 33
              Percent Done: 100 //////////////////////////////////////////////////
                                ...10...20...30...40...50...60...70...80...90..100
              Elapsed Time: 00:00:01
        Transfer Rate, CPS: 50
              Window Slots: 1 of 1
               Packet Type: B
              Packet Count: 3
             Packet Length: 8
               Error Count: 0
                Last Error:
              Last Message: SUCCESS.  Files: 1, Bytes: 33, 50 CPS
      
      (/Users/wolfgang/) C-Kermit>
      						
    8. Terminate transfer session, close serial port and quit C-Kermit:
      
      (/Users/wolfgang/) C-Kermit>bye
      (/Users/wolfgang/) C-Kermit>close connection
      (/Users/wolfgang/) C-Kermit>quit
      [centerpiece:~] wolfgang%
      						
  10. I can think of two other ways to take care of Kermits write accesses to the uucp lockfile directory:
    1. Grant everyone full access to the uucp lockfile directory.
      • + Simple to install: no special user needs to be created.
      • + Kermit runs with restricted users privileges.
      • - Uucp lockfile directory is unprotected.
    2. Set kermits owner to root and set kermits setuid bit.
      • + Simple to install: no special user needs to be created.
      • + Write access to uucp lockfile directory can be restricted to root only.
      • - Kermit runs with root privileges - potentially a security hole.
  11. Remaining To Dos
    1. Automate file transfers by Kermits macro facility.