
  HPSEND
  ======

This program transfers a file to a HP 21xx minicomputer via a serial port
connected to a pass-through papertape reader (PTR) emulator. The emulator is
designed so that it communicates at 9600 baud, and transmits a "!" character
when it is ready to receive one byte of data, which it passes on to the
parallel interface serving as the PTR controller.

The interface is described at:
http://www.infionline.net/~wtnewton/oldcomp/hppte/index.html

The source is in the hpsend.bas file, run using: qbasic.exe /run hpsend
The hpsend.exe file was compiled using QB4.5's bc /e hpsend.bas then
linked using link hpsend.obj specifying BCOM45.LIB for the library.


  Installation
  ------------

HPSEND must be run in a dos environment which permits access to the
serial port, it cannot be run with Windows running. Options include
rebooting into Win9x "dos" mode, using a "boot" floppy containing some
form of dos, or running under DosEmu/FreeDos under Linux. It may be
necessary to issue a MODE command to set up the serial port, I didn't
need to under Linux but when I tried from a FreeDos boot disk I had to
add MODE.COM to the floppy and use the command: mode com1 baudhard=96
For MSDOS/Win9x's or other try this instead: mode com1:96,n,8,1

FreeDos-based bootdisks can be found at: http://www.fdos.org/bootdisks/
I tested using FREEDOS.EXE at: http://www.fdos.org/bootdisks/old/
To make the bootdisk I put a floppy in and ran (from WinXP): freedos a:
No mode.com was on the bootdisk, that can be found at:
http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.0/
goto /pkgs/ and get modex.zip (or paste all that together for the url).
I used the mode.com from my FreeDos install.

For Linux, DosEmu can be found at: http:/www.dosemu.org/
or installed via the package manager, look for dosemu and dosemu-freedos.
Setting it up is a bit tricky, involving editing configuration files.
The way I set it up was compile it from source, installed to /usr/local/bin,
got dosemu-freedos-1.0-bin.tgz and extracted it to a directory under
~/.dosemu and put a link named c_fd1 in the ~/.dosemu/drives directory,
along with a link named d that points to a directory tree that serves as
my drive d: where I keep all my stuff. The /etc/dosemu/dosemu.conf file
was edited to permit serial port access I added $_com1 = "/dev/ttyS0"
to the serial port section. Also edited dosemu.users and added
[my username] c_all to tell it to let me do what I want, don't know
if that's necessary for the serial port.
Autoexec.bat was modified as follows...
Changed z: to c: in the path and set helppath lines
I keep my c: files write-protected so made a tmp dir under ~/.dosemu
and replaced the set TEMP=c:\tmp with...
 lredir e: LINUX\FS\home/newton/.dosemu/tmp
 set TEMP=E:\
I set up my own drive D: so removed the lines...
 unix -s DOSDRIVE_D
 if "%DOSDRIVE_D%" == "" goto nodrived
 lredir d: linux\fs%DOSDRIVE_D%
 :nodrived
Also removed lredir e: linux\fs/media/cdrom c
Towards the end, before the final unix -e line, added...
 path %path%;D:\EXEC;[and all the other dirs I want on the path]
 d:  (actually a call to another batch that does that among things)

This is how I set up DosEmu/FreeDos, YMMV. If everything is put
on drive C: (assuming it's not normal-user write-protected, perhaps
instead of installing dosemu-freedos via the package manager download
the binary .tgz and extract it to a dir under ~/.dosemu and adjust
the link in the drives dir) then the autoexec.bat mods might not be
needed. However by default it gives access to the entire Linux
filesystem which I didn't want lest there be a buggy program.


  Operation
  ---------

Ok now assuming there's a suitable environment, a HP minicomputer with
a suitable PTR emulator, and software to load into it, run HPSEND.
At the filename prompt you can enter COM1: thru COM4: to change the
port (default is COM1:), enter the name of a file to send, or just
press Enter to exit. To boot a HP 21MX mini power it up, while it's
warming up tell HPSEND the filename of a suitable ABS binary to boot,
when it says "Sending file..." go to the mini and select the S register,
enter the PTR slot in bits 6-11, press store, preset, IBL, preset, run.
A progress bar should begin printing another * for every 1024 bytes.
When the load is done bits 0-5 should light up on the front panel
and the machine halts. Once that happens, in HPSEND press Esc to
terminate the send and Enter to quit. Run a serial port terminal
and swap the cable to the TTY or BACI port unless you have a real
terminal already connected.

What happens next depends on what's being booted, for HP-IPL/OS if the
build is already configured for the machine put 2 in the P register
(select P, clear, light up bit 1, store) and run. If not configured
select S, put the TTY slot in bits 0-5 (or 0 if no TTY), the BACI slot
in bits 6-11 (or 0), set bit 12 to use a BACI console, clear bits 13-15
(set 15 to disable autostart but then BACI won't work), store, put 70
in P (select P, clear, light up bits 3 4 5, store) and run.

---------------------------------
Terry Newton   wtn90125@yahoo.com
