UDOS for 8KW HP21xx machines
============================

UDOS is an extremely simple dos for the USB adapter, the menu has options
to save all of memory to an ABS binary, attach a file for reading, run a
VDRIVE prompt for file management, and exit by running from location 2...

1) SAVE BINARY
2) ATTACH FILE
3) DOS PROMPT
4) RUN FROM 2
> 

UDOS doesn't have a binary load, rather it opens the file for read and uses
the firmware's "read as PTR" command so the HP's stock papertape loader can
load the selected binary file. The attach option can also be used to attach
IPL or data files to load into HP-IPL/OS (or other applications).

This directory contains source and binaries for UDOS, a "hook" binary
and IPL package for accessing UDOS' internal code for additional functions,
an IPL package containing DCON for changing UDOS' USB slot, an IPL package
containing a version of Octapus that doesn't include the extra punch code,
and a smaller version of the MAZE game (no map, that's kinda cheating anyway).
Also included is the HP-IPL/OS 1.6 kernel in hpiplos1.abs, the internal.ipl
package for removing block support, and 8kextra2.ipl which contains extra
utilities and string functions.

There are two versions of UDOS - The udos_c2.abs binary is a stand-alone
version that loads at 17000 octal and can be added to HP-IPL/OS or about
anything else not using the top 0.5KW of memory. The hhooks.abs overlay
loads at 16400 octal and links to udos_c2.abs to provide stack pop/push
and other code to easily access internal UDOS functions using RUN commands.

The udos_b2.abs binary is designed to be used with the preconfigured
basic1.abs binary obtained from "The HP2100 Archives". It loads between
16350 octal and the beginning of the HPBASIC drivers (17217), puts a
jump to 5137 in locations 2/3 (autorun), puts a jump to UDOS in locations
77/76 to run UDOS when BYE is entered, and adjusts locations 106 and 116
to make room for UDOS. To install, load basic1.abs, load udos_b2.abs, then
run from location 100. For more BASIC program memory remove the matrix
functions as indicated in the udos_b2.asm comments. Binaries saved using
UDOS will contain the interpreter plus BASIC code, run from location 2 to
start the BASIC program. Running from 100 will erase the BASIC program
for entering new programs. A few 8K-compatible BASIC programs are in
the 8Kbas directory.

Three HP-IPL/OS builds with UDOS are provided, a base build that can
be used to create other builds, a build with the MAZE game, and a build
with extra utilities, file access words and Octapus. For all of these builds,
configuration is TTY=11, PTR/USB=12, PTP=13. There is no config utility, to
change the slot assignments put the TTY slot in location 355, the PTR slot
in location 357, the PTP slot in location 356, then run from 2.
Do slot# DCON to change the USB adapter slot.

File UDOSBASE.ABS, build date 11/16/10...

HP-IPL/OS  8K   V1.6
? WORDS
DO +DO INDEx +LOOx >STEx IFNZ IFZ IF<0 ENDIx ELSE UNTIx WHILx CASE = < > <=
>= <> DEFAxxx ENDCxxx EXECxxx WBOOx AND OR XOR ADD SUB INC DEC NOT 2CPL DUP
DROP OVER ROT SWAP GET PUT PNUM CRLF DECIxxx OCTAx BINAxx RADIx SP>S SB>S
XP>S XB>S YP>S YB>S ZP>S ZB>S END EOD DEFIxx DMPS S>SR SR>S PCHR PWRD CHRIx
S>X X>S S>Y Y>S S>Z Z>S MUL ASL ASR ROL ROR DIV RUN X>>Y X>>Z Y>>X Z>>X
$PRIxx $SWAx $CPY $DUP $DROx $LEN $ADR $XTExx $PUT $GET $CRExxx $STR $HEAx
$APPxxx $TAIx $IN $CAT $VAL <>COx >PTP <PTR MSPAxxx MSBOxx MSBIx MSWOxx
MSWIx MS$Oxx MS$Ix MSCRxx >MS <MS MS_Sxxx MS_Rxxxxxx CONSxxx #0 #1 @TL @TB1
@TB2 @ANVxx @LLP @ENSxx @CLH @LITxxxx @STRxxx @RTSxx @DIC @USR @BLK @END
@DIPxx RND TOKEx SDIC +IRQ -IRQ +AUTx -AUTx ADDCxxx $DEFxxx HEADxxx WORDx
ADDHxxxxx ADDHxxxxxx FIXLxxxx ADDMxxxx VARIxxxx CONSxxxx UDOS DCON
EOD=011262 FREE=005515
?

Package list...
Start with hpiplos1.abs (version 1.6 6/9/10)
internal.ipl - select option 2 to remove block support
overlay udos_c2.abs
@BLK 17000 PUT @END 16777 PUT
DEFINE UDOS to 17000 RUN END
dcon.ipl

There isn't much in this build (not even EXPLAIN and FORGET), its main
purpose is to serve as a base upon which to make other 8KW UDOS builds.
If there is no need to change the USB adapter slot the DCON word can be
removed, no FORGET so has to be done manually: "DCON" $DEFADR 4 SUB 0 PUT

File UDOSMAZE.ABS, build date 11/16/10...

HP-IPL/OS  8K   V1.6
? WORDS
DO +DO INDEx +LOOx >STEx IFNZ IFZ IF<0 ENDIx ELSE UNTIx WHILx CASE = < > <=
>= <> DEFAxxx ENDCxxx EXECxxx WBOOx AND OR XOR ADD SUB INC DEC NOT 2CPL DUP
DROP OVER ROT SWAP GET PUT PNUM CRLF DECIxxx OCTAx BINAxx RADIx SP>S SB>S
XP>S XB>S YP>S YB>S ZP>S ZB>S END EOD DEFIxx DMPS S>SR SR>S PCHR PWRD CHRIx
S>X X>S S>Y Y>S S>Z Z>S MUL ASL ASR ROL ROR DIV RUN X>>Y X>>Z Y>>X Z>>X
$PRIxx $SWAx $CPY $DUP $DROx $LEN $ADR $XTExx $PUT $GET $CRExxx $STR $HEAx
$APPxxx $TAIx $IN $CAT $VAL <>COx >PTP <PTR MSPAxxx MSBOxx MSBIx MSWOxx
MSWIx MS$Oxx MS$Ix MSCRxx >MS <MS MS_Sxxx MS_Rxxxxxx CONSxxx #0 #1 @TL @TB1
@TB2 @ANVxx @LLP @ENSxx @CLH @LITxxxx @STRxxx @RTSxx @DIC @USR @BLK @END
@DIPxx RND TOKEx SDIC +IRQ -IRQ +AUTx -AUTx ADDCxxx $DEFxxx HEADxxx WORDx
ADDHxxxxx ADDHxxxxxx FIXLxxxx ADDMxxxx VARIxxxx CONSxxxx UDOS DCON FORGxx
PDEF EXPLxxx $EQUxx $SLIxx $TRIx RENAxx MAZE
EOD=016637 FREE=000140
? 

Package list...
Start with hpiplos1.abs (version 1.6 6/9/10)
internal.ipl - select option 2 to remove block support
overlay udos_c2.abs
DEFINE UDOS to 17000 RUN END
dcon.ipl
8kextra2.ipl
FORGET WHEREIS
@BLK 17000 PUT @END 16777 PUT
maze_sm.ipl

For other uses FORGET MAZE for 4764 octal words free.

File UDOSUTIL.ABS, build date 11/17/10...

HP-IPL/OS  8K   V1.6
? WORDS
DO +DO INDEx +LOOx >STEx IFNZ IFZ IF<0 ENDIx ELSE UNTIx WHILx CASE = < > <=
>= <> DEFAxxx ENDCxxx EXECxxx WBOOx AND OR XOR ADD SUB INC DEC NOT 2CPL DUP
DROP OVER ROT SWAP GET PUT PNUM CRLF DECIxxx OCTAx BINAxx RADIx SP>S SB>S
XP>S XB>S YP>S YB>S ZP>S ZB>S END EOD DEFIxx DMPS S>SR SR>S PCHR PWRD CHRIx
S>X X>S S>Y Y>S S>Z Z>S MUL ASL ASR ROL ROR DIV RUN X>>Y X>>Z Y>>X Z>>X
$PRIxx $SWAx $CPY $DUP $DROx $LEN $ADR $XTExx $PUT $GET $CRExxx $STR $HEAx
$APPxxx $TAIx $IN $CAT $VAL <>COx >PTP <PTR MSPAxxx MSBOxx MSBIx MSWOxx
MSWIx MS$Oxx MS$Ix MSCRxx >MS <MS MS_Sxxx MS_Rxxxxxx CONSxxx #0 #1 @TL @TB1
@TB2 @ANVxx @LLP @ENSxx @CLH @LITxxxx @STRxxx @RTSxx @DIC @USR @BLK @END
@DIPxx RND TOKEx SDIC +IRQ -IRQ +AUTx -AUTx ADDCxxx $DEFxxx HEADxxx WORDx
ADDHxxxxx ADDHxxxxxx FIXLxxxx ADDMxxxx VARIxxxx CONSxxxx UDOS DCON FORGxx
PDEF EXPLxxx $EQUxx $SLIxx $TRIx RENAxx WHERxxx DUMP $>VI $>VD $>VC &WFD
VECS PVDR VDIR VDEL VSTAx VREAx VAPPxxx VWRIxx VCLOxx VLD OE OE?
EOD=012706 FREE=001071
? 

Package list...
Start with hpiplos1.abs (version 1.6 6/9/10)
internal.ipl - select option 2 to remove block support
overlay udos_c2.abs
overlay hhooks.abs
DEFINE UDOS to 17000 RUN END
dcon.ipl
8kextra2.ipl
FORGET ABSOUT
hhooks.ipl
oct14a.ipl

Memory from 16500 to 16777 is empty and available for custom machine code.
Machine code can written in assembly and loaded as an overlay, or if not
too complex, entered using the Octapus utility (or PUT).

For more IPL programming memory, Octapus can be removed...

? FORGET OE
? @BLK 16400 PUT @END 16377 PUT

This provides 3513 octal words free.

The hooks provide a set of words that resemble VDOS but are simpler...

"FILENAME" VREAD - opens a file for reading via MS input commands
"FILENAME" VWRITE - opens a file for writing via MS output commands (deletes)
"FILENAME" VAPPEND - opens a file for writing, data is appended to the file
VCLOSE - closes a write file
VDIR - lists the disk directory
"FILENAME" VDEL - deletes a file
"FILENAME" VLD - loads an IPL file
VSTAT PNUM - prints error status

MSBIN MSWIN MSBOUT MSWOUT MS$IN MS$OUT and MSCRLF can be used to read from
and write to open files. >MS can be used to redirect console prints to an
open write file... almost anything that prints can print to a file instead.
Use CONSOLE to reset redirection back to the console and stock papertape
drivers. For example to save a word definition...

"WORDNAME.IPL" VWRITE >MS
EXPLAIN WORDNAME
"CONSOLE" $PRINT CRLF
CONSOLE VCLOSE

...afterwards "WORDNAME.IPL" VLD can be used to reload the word.
This is handy for rearranging dictionary words. Groups of words can
be saved to a single file by using multiple EXPLAIN commands.

A possibly useful aspect of UDOS is it can also punch... if the USB device is
connected to a PTP device it detects the situation and just saves memory to
ABS. This can be used to make UDOS builds under simulation without having
the usual punch code loaded, which is how these builds were made.

The making_*.txt files contain simulator logs created while making these
builds. Building on real hardware is a similar process, but instead of
simulator command, hardware operations are used and there's no need to
fake a punch for saving. Also, once UDOS is overlayed, running it from
location 17000 (or the UDOS word if present) allows attaching IPL files
that can then be loaded using <MS.

----------------------------------
Last mod 11/17/10

