HP-IPL/OS IDE Disk Builds ========================= The HP-IPL/OS builds here are for running with a customized 8052-based controller connected to an IDE disk drive which supports "LBA" access. The controller is based on a "Paul" development board, Bob Shannon has been running the system since 2005, as of 11/18/07 the IDE driver actually works :) (apparently Bob's system had a patched status read that always returned "OK", took a bit of debugging to determine that the posted IDE driver code never worked... without actual plans to make the thing his was the only operational example and happily running with old code) The 8052 IDE disk controller code is in the hpdiskc2.asm file. The comments include partial details about the HP interface, more complete details are in the hpide* files. Status as of 11/30/07 - partially tested and essentially working but there's still an issue with 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 MS BACx BACIxxx TTYCxx +TBG -TBG >TBG TBGZxxx >WDT +WDT -WDT !100xx T>>S TIMExxx PTIMx !WDA CBUS ?BUS >BUS BUx $ACxxx A>CCxxx USPAxx DMSTxxxx UPTR MSUSxx ABSLxxx GOUSxx GOSYxxxx ALTSxxx ?DMS VERSxxx CONFxx DADD D2CPx EMUL EDIV DSWAx $DVAx $DSTx >IDE FP FP>$ FSGN FSQR TTYPx TERMxxxx ESC POS CLS COLOx -COLxx MKWOxx ENDWxxx FILx UCOMx FSS CWA LAA RAA FPA FSA FCA FNA DNA VNA NDEA DBLA DBHA FSLA FSHA DupCxxxx SCDRx RCDRx ChkBxx ChkDxx DIRExxxxx REOPxx OPEN SEEK DirUxxxxx CLOSx CNF DEL BCOPx RELExxx ?SFS -SFS DASL DASR DLSL DLSR DROL DROR !PRN CKPRx MSPRx +PE -PE LBUF BSRCx MSASxxx RCTL RUN&xxx LIBLxxx LIBExx LFIL LIB SETLxx LFORxxx LDIR LCLOxx R L D>L A>L L>A MS>L D2F FCOPx FMOVx FDUP MS2F F2MS ABS2x VRECxxxx XRECxxxx XINIx +TD -TD >TD -GD +GD >GD *GT EOD=052253 FREE=007524 Configuration... Slot 10 - time-base generator Slot 11 - console interface Slot 12 - papertape reader Slot 13 - papertape punch Slot 17 - HPIB interface Slot 20 - LPT interface Slot 22 - BACI interface Slot 23 - IDE disk interface Package list... hpiplos1.abs - version 1.5 kernel extra.ipl 3 ALLOCATE oct70.ipl create.ipl baci.ipl tbg.ipl hpib.ipl dms.ipl version.ipl config.ipl FORGET !SDC (no SR reconfig) double.ipl disk.ipl xdos.ipl ide.ipl float.ipl floatext.ipl hpscreen.ipl mkword.ipl sfs.ipl bigshift.ipl print.ipl sfslib.ipl sfsutils.ipl xutils.ipl hp2645.ipl Includes the "fast" library system, the build is arranged so that the words after the library words can be stored in or run from the library, including some of the library words themselves. If the library system isn't needed use the technique shown below for saving the HP2645 words to save any words in the dictionary after the library to alternate memory, FORGET LBUF to remove the library words then reload the words saved to alt mem. Otherwise the various extra words appearing after the library can be saved to the library then removed from the dictionary to save memory. Alternatively, just save a copy of the complete build for when the utilities are needed, do this now by entering "SFS/STOCK" XSAVE (change name as needed). Adapt the following steps to include the kinds of utilities that would be useful to access from the library. Some of the utilities such as VRECOVER XRECOVER and XINIT obviously should not be run while SFS is running but can be loaded as needed or to make utility builds. As configured 192KW memory is required to use the library. If less memory is installed then LBUF must be set to the SFS buffer to use... For 128KW enter: LBUF 1 PUT For 160KW enter: LBUF 2 PUT Note: The FCOPY FMOVE and FDUP words require at least 160KW and cannot be run from the library unless 192KW memory is installed. To activate and copy the XDOS utilities to the library enter... $VOL "LIBRARY.FILE" SETLIB (adjust the library name as needed) "MS2F" D>L "F2MS" D>L "ABS2F" D>L "VRECOVER" D>L "XRECOVER" D>L "XINIT" D>L To copy the SFS library and file copy utilities to the library enter... "D>L" D>L "A>L" D>L "L>A" D>L "D2F" D>L "FCOPY" D>L "FMOVE" D>L "FDUP" D>L The MS>L (MS in to library) utility requires A>L so if needed in the library a multiword segment must be created, enter... RENAME MS>L MLMAIN DEFINE MS>L "MLMAIN" $DEFADR IFZ DROP ELSE EXECUTE ENDIF END ZAM 2 MSUSER >MS EXPLAIN MS>L EXPLAIN A>L EXPLAIN MLMAIN "LIBEND" $PRINT CRLF CONSOLE A>L After everything desired has been copied to the library do LDIR to make sure it all looks OK then LCLOSE. Nothing is written to disk until LCLOSE is used, so it might be a good idea to LDIR then LCLOSE LIB while building the library to save at different stages. If an error occurs while importing code into the library, do -SFS to abandon the changes then LIB to reopen the library and try again. Note... there is no protection against overflowing the library, do frequent LDIR commands to keep up with the library size, if it gets much over 170000 start getting worried about it. "NAME" LFORGET can be used to trim the library by deleting NAME and everything after it - juggling is needed using L or L>A to load words into the dictionary or alt mem, using D>L or A>L to add back after deleting something from the middle. Be especially careful when juggling multi-word library segments. If the HP2645 terminal words need to be kept then enter the following to temporarily store them in alternate memory... ZAM 2 MSUSER >MS EXPLAIN +TD EXPLAIN -TD EXPLAIN >TD EXPLAIN -GD EXPLAIN +GD EXPLAIN >GD EXPLAIN *GT "CONSOLE" $PRINT CRLF CONSOLE If removing just the XDOS utilities (leaving the lib/file copy utilities) enter: FORGET MS2F (Y to confirm) This leaves 11756 octal words free (EOD=50021), 3 blocks allocated. To remove the library/file copy utilities too enter: FORGET D>L This leaves 13344 octal words free (EOD=46433). After removing the lib utilities if D>L or other lib utilities needed then instead of a command like "WORDNAME" D>L instead enter: "WORDNAME" "D>L" R Note - the R must be at the end of the line when running utilities from the library, the load does not take place until AFTER the last command so commands after a R will execute before the run-and-forget takes place. D>L might be frequently used so if desired FORGET A>L instead. If the HP2645 words were saved to restore enter: 2 MSUSER 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 MS BACx BACIxxx TTYCxx +TBG -TBG >TBG TBGZxxx >WDT +WDT -WDT !100xx T>>S TIMExxx PTIMx !WDA CBUS ?BUS >BUS BUx $ACxxx A>CCxxx USPAxx DMSTxxxx UPTR MSUSxx ABSLxxx GOUSxx GOSYxxxx ALTSxxx ?DMS VERSxxx CONFxx DADD D2CPx EMUL EDIV DSWAx $DVAx $DSTx >IDE FP FP>$ FSGN FSQR TTYPx TERMxxxx ESC POS CLS COLOx -COLxx MKWOxx ENDWxxx FILx UCOMx FSS CWA LAA RAA FPA FSA FCA FNA DNA VNA NDEA DBLA DBHA FSLA FSHA DupCxxxx SCDRx RCDRx ChkBxx ChkDxx DIRExxxxx REOPxx OPEN SEEK DirUxxxxx CLOSx CNF DEL BCOPx RELExxx ?SFS -SFS DASL DASR DLSL DLSR DROL DROR !PRN CKPRx MSPRx +PE -PE LBUF BSRCx MSASxxx RCTL RUN&xxx LIBLxxx LIBExx LFIL LIB SETLxx LFORxxx LDIR LCLOxx R L D>L A>L L>A MS>L D2F FCOPx FMOVx FDUP MTINxx MTRExx MTWRxxx GAP GAPMxxx FS1R BS1R FS1F BS1F RWLP RWOL MTSTxxxx MTBOxx MTWAxx ?MTExxxx EOF RECOxxx FILEx MTSCxx MTGEx IDREx MTDIx DLTF MTSExx MMTIx MTSAxx MTLOxx MS2Mx MT2Mx B2MT MT2B MTSHxx D2MT MS2F F2MS ABS2x VRECxxxx XRECxxxx XINIx EOD=055502 FREE=006275 Requires a HP21xx "MX" machine such as a HP2113E with at least 64KW memory to use XDOS and/or magtape, and at least 96KW to use SFS. As configured requires 192KW to use the library system. Configuration... Slot 10 - time-base generator Slot 11 - console interface Slot 12 - papertape reader Slot 13 - papertape punch Slots 14,15 - 13181/7970 magtape interface set Slot 17 - HPIB interface Slot 20 - LPT interface Slot 22 - BACI interface Slot 23 - IDE disk interface Package list... Start with hposide.abs FORGET MS2F 2 ALLOCATE magtape.ipl mtextra.ipl FORGET HELP xutils.ipl FORGET MS2F for 10364 octal free memory (EOD=53413). Some of the magtape words can go in the library, probably MS2MT MT2MS B2MT MT2B MTSHOW and D2MT for 11424 octal free (EOD=52353). HP-IPL/OS MT6I 1.51 =================== This build is in the hposmt6i.abs file, dated 2/13/08. The following is after booting via PTR (not from disk)... 1)7906 2)IDE 3 HP-IPL/OS MT6I 1.51 ? 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 MS BACx BACIxxx TTYCxx MKWOxx ENDWxxx CFGE !DMS -DMS SDMA UDMA UJUMx SJUMx SPAGx C>ACxxx A>CCxxx USPAxx DMSTxxxx UPTR MSUSxx ABSLxxx GOUSxx GOSYxxxx ALTSxxx ?DMS CONFxx !SDC MTINxx MTRExx MTWRxxx GAP GAPMxxx FS1R BS1R FS1F BS1F RWLP RWOL MTSTxxxx MTBOxx MTWAxx ?MTExxxx EOF RECOxxx FILEx MTSCxx MTGEx IDREx MTDIx DLTF MTSExx MMTIx MTSAxx MTLOxx MS2Mx MT2Mx B2MT MT2B MTSHxx D2MT DADD D2CPx EMUL EDIV DSWAx $DVAx $DSTx FIX FLT FP+ FP- FP* FP/ DFLT DFIX PWR1x $>FP FP>$ FSGN FSQR TTYSxxx TTYGxx TTYPx TERMxxxx ESC POS CLS COLOx -COLxx >IDE SR DMENU ENDIF END altutil.ipl conalt.ipl fcam.ipl mt2f.ipl "SR 70 RUN Saving and restoring IDE disk images ==================================== A USB drive tray may be used to copy the IDE disk contents to and from a file on a Linux-compatible host PC using the "dd" command. This is particularly handy for setting up a system under simulation (using the "combo" build with both IDE and 7906 drivers), which can be booted on real hardware. The SimH HP2100 7906 disk format is compatible with IDE provided only a single platter is used. This technique is also very useful for simply backing up and restoring disk images without simulation. WARNING! Misapplication of these commands can result in data loss! Not responsible for any damage that may result, know what you are doing!!! The detachable USB drive is (now) /dev/sdc in my system, make sure this is the case (and not a host PC drive), otherwise change the commands accordingly. To avoid mistakes (like typing the wrong /dev/device) best to put in scripts. To copy a disk image file to the drive, I (now) use the following command... sudo dd if=imagefilename.ext of=/dev/sdc conv=swab Substitute the input filename and make sure /dev/sdc is the USB drive. The USB drive used to be /dev/sda, but since upgrading from Ubuntu 6.06 (which used hda, hdb etc for hard drives) to Ubuntu 8.04, all hard drives internal and external use the sd* prefix. To find out what device is the USB drive adapter, in a terminal with the external drive Not connected run the command ls /dev then connect the drive and do ls /dev again and note which new sd* device was added. The following script checks to make sure the device does not exist when run, prompts to attach the drive and confirms, then writes. This assumes the USB ide drive is /dev/sdc and the disk image filename is 7906.dsk, edit as needed... -------- cut - file copy7906toIDE.sh --------------- #!/bin/bash # warning... make darn sure idedrive = /dev/[ext USB drive] # don't attached until prompted to, if exists won't run # this is free software, no warranty whatsoever. idedrive=/dev/sdc if [ -e $idedrive ]; then echo "$idedrive exists, not running" else echo "Attach IDE drive to $idedrive" echo "---- Enter Y to confirm ----" read answer if [ $answer == "Y" ]; then if [ -e $idedrive ]; then sudo dd conv=swab if=7906.dsk of=$idedrive else echo "$idedrive not found" fi fi fi echo "---- Press Enter to end ----" read answer ---------------------------------------------------- This is a Linux-specific solution, it should be possible to do a similar thing under Windows but a critical function is the swap bytes conversion. DD for Windows does not appear to have conv=swab, the dd included with CygWin has the swab option but can only output to a file so it can be used to make an image with the bytes swapped which can then be copied as-is to the drive using another drive imaging program. To copy a drive to a disk image file, I (now) use something like this... dd if=/dev/sdc of=imagefilename.ext bs=10000000 count=1 conv=swab Substitute the output filename, set bs to how many bytes to copy which depends on the disk contents, how many volumes it contains, etc. 10000000 is the approximate size of a single 7906 platter, which is actually 10100736 bytes but if formatted according to the HP-IPL/OS docs (3 volumes 26 octal files in the last volume, or 150 decimal total files) works out to 9914368. 10000000 is close enough. I'm using 7906 geometry because it makes it easy to set up disks under simulation or access disks copied from the IDE disk using the 7906 sim, but the IDE disk can be formatted to any capacity up to 64 volumes of 64 files each, for each virtual drive, up to the entire capacity of the drive. The bs= spec could be set to 2048 then count= set to the (decimal) number of 1KW blocks to save which can be derived from doing an XDIR of the last volume, looking at the block low/high numbers of the last file then converting to decimal, adding 33 dec to account for the last file's size and convert to a count. Or just pick a bs= number which you know is big enough to capture all of the data, it doesn't matter if empty space is also saved other than making the image file bigger. The number of 1KW blocks to save can be calculated exactly using the following formula... 39 + (#volumes-1)*2049 + (#files in last volume)*32 3 volumes with 22 dec files in last volume works out to 4841 1KW blocks (9914368 bytes) and can be specified as bs=2048 count=4841 in the dd command. Each virtual drive adds 131174 blocks (268644352 bytes) to the size of the last drive's files, so this technique is not recommended for saving such drives due to the huge size of the backup file unless all volumes of the first drive truly are full, which would be one stuffed HP-IPL/OS system! . . .