Technical notes for the 7906 sim and HP-IPL/OS ============================================== Some of this material is repeated elsewhere and this doesn't replace other docs, rather fills in a few gaps and summarizes the file system and present software implementation. Importing and exporting editor-format files ------------------------------------------- The IPL files, IPL apps (beginning with $), and the # NOTES file on the disk are in the editor's "array" format, where each line of the file is 78 characters long plus a CRLF, with zero bytes following the text data. File sizes are a multiple of 3460 octal bytes (the size of each 23 line page). There should be no need to export the IPL files or apps unless changed (regular text versions are available elsewhere), if exporting is needed use the SFS/EDIT build then halt (control-E) and attach PTP to an output file, continue and "FILE.IPL" LDFILE MASAVE then halt and detach PTP. Same for # NOTES and the $ files. If the export text option is used from the import/export submenu, the space padding and trailing zeroes will be included in the output file. The # SUMMARY file and sources for the BCS games are in regular text format and can be extracted using the export text option without effect. Export text exports the file exactly as it appears in the disk file. To import a text file in a form that can be edited run the SFS/EDIT build, halt and attach the file to PTR, continue and enter MALOAD, if the file does not have ~TERMINATE~ by itself on the last line it will hang after loading, in which case halt then enter run 2 to start (the general recovery procedure whenever something hangs). Once back to the ? prompt enter "FILENAME" SVFILE (or "# FILENAME" to display on the menu) to save the editor-format file. Note that the editor is limited to 782 lines or less. To import regular text files (less than 64Kbytes) for reading only (not editing) use the menu's import/export submenu. Additional menu usage notes --------------------------- If the Load ABS option key 3 is inadvertently pressed, press any key then Y at the halt prompt but instead of attaching a file enter run 2 to rerun the system. At some point I might modify the menu to return to the menu unless Y or N is pressed at the first prompt. Creating a new empty disk sim ----------------------------- Basically, to create a new blank simulation except for the boot system, all that's needed is a copy of block 0 and the HP-IPL/OS boot system. To create an ABS copy of the boot system, go to a prompt, control-E to halt and at the sim prompt enter attach ptp hposmenu.abs then enter c to continue. Enter again if you want to see the ? prompt but not necessary. Enter SYSALL to write the build to PTP. Now to save block 0. At the ? prompt enter the following (exactly... we're doing low-level disk stuff here): OCTAL DEFINE TEMP 0 0 SBLA @BLK GET R-1K @BLK GET DUP 1777 ADD +DO INDEX GET MSWOUT +LOOP END Control-E and enter attach ptp block0.bin then enter c to continue and enter TEMP to run the word entered in from the above code. Control-E and exit. The block0.bin file should be 2Kbytes in length. Move the hposmenu.abs, block0.bin, and boot_7906.sim files to a new directory to build the new sim in, along with any ABS or other files you want to import into the new sim. If desired run the stock sim again and use the ABS and text export functions to export any binaries, IPL apps/files or text files you want to move to the new sim. Note.. as described in import/export notes, files in editor format will contain zero bytes when exported so might not open in a PC editor, but this will preserve the file in editable format without having to do all the MASAVE/MALOAD stuff. In the new dir, "run" boot_7906.sim in SimH HP2100. Nothing useful will happen but creating an empty disk image and setting up the slots. Control-E then at the sim prompt enter load hposmenu.abs then enter run 2 to start it, an empty menu should pop up, press 1 for the prompt. Enter DGEN to write the system to disk as the boot system (but won't be bootable yet). Now to "format" the disk... Enter XINIT then enter 3 for the number of volumes, then enter 26 for the (octal) number of files in the last volume. Enter "NAME" MKVOL to create the first volume, change NAME to what you want displayed in XDIR listings, 16 characters maximum. Now to make the disk bootable by copying block0.bin to block 0... Enter the following code at the prompt: OCTAL DEFINE TEMP @BLK GET DUP 1777 ADD +DO INDEX MSWIN PUT +LOOP 0 0 SBLA @BLK GET W-1K END Control-E then enter attach ptr block0.bin then enter c and enter TEMP to read block0.bin and write it to block 0 of the disk. Control-E and exit. "Run" boot_7906.sim again, this time it should boot. The import/export submenu (option 6) can be used to copy in whatever you want, to display on the menu ABS binaries should be named @ FILENAME and text files should be named # FILENAME to display on the menu. If importing IPL apps to run from the menu they must be named $ NAME where NAME is the exact name of the first word, such as $ FED, $ MAZE, etc. Otherwise they won't work. Leave out the @ # $ prefixes to not display the files on the menu, these can be loaded using "FILENAME" XLOAD or viewed using "FILENAME" XSHOW. Customizing the menu build (and HP-IPL/OS builds in general) ------------------------------------------------------------ If interested in customizing the menu the source is in DM2.IPL, feel free to edit as needed (if you want to play with IPL code which is stack-based and unlike probably any other programming language except a passing resemblence to FORTH). Before messing with it might be a good idea to save the original boot system to a file - at the prompt enter "STOCKMENU" XSAVE - and save edited versions to another filename such as DM2A.IPL or similar. Once a new menu source has been prepared, go to the prompt and enter "!DMI" 0 STASH to save the custom !DMI word (which avoids running the menu in case the build is saved to PTP using SYSALL and booted without a disk present - if not a factor then don't bother with STASH and FETCH and forgetting the stock !DM word), enter FORGET FED and confirm to remove the existing menu, "DM2A.IPL" XLOAD to load the new version of the menu, enter FORGET !DM and confirm to remove the stock !DM autostart word then enter 0 FETCH to restore the original !DMI word. While testing mods, save the build to a file, i.e. "MODMENU" XSAVE (do "MODMENU" XDEL first if it already exists), the modified version can be tested by doing "MODMENU" XLOAD from the prompt. When all works as desired then DGEN can be used to write the modified system to disk as the default boot system. That in a nutshell is how HP-IPL/OS builds are updated... but further notes on the process, if loading additional IPL's into the build always do WORDS afterwards to keep tabs on free memory - there's no checking for overflowing the dictionary - and the STASH/GET trick for preserving words after the FORGET point only works on high-level words (EXPLAIN WORDNAME must show code), and only if the specified block (0 in the example) is available. The default boot system has 3 blocks numbered 0-2, whereas the SFS/EDIT build has only blocks 0 and 1. The other way to update the system is to use the sources and scripts in the provided mkdisk.zip file, to use the mkdisk directory must be moved into the hpiplos directory of the 1.51(x) HP-IPL/OS main archive, alongside the abs, ipl, and scripts directories which are referenced by the build scripts. Updated versions can be tested using the stock menu's Load ABS function or break to the sim prompt, load filename.abs and run 2. This method is easier if you wish to use a PC editor to work on the code (make sure sources are in CRLF format if editing under Linux) and semi-automatically handles all the !DISK/!DMI stuff but as written requires that the menu build be built from scratch starting with the kernel. Once used to HP-IPL/OS procedures (and if you can stand the crude editor) it's easier to make minor changes on-line, but the build scripts provide an opportunity to edit almost anything and include/exclude options as needed. Watch out for page errors, in HP-IPL/OS machine code has to be arranged so it does not cross a 1KW page boundary. About the Simple File System (SFS) ---------------------------------- SFS was invented by Bob Shannon (who also invented the original HP-IPL/OS) to provide a simple way to store and retrieve files on a HP-IPL/OS disk. But first some background about how HP-IPL/OS disk support works... Presently disk drivers exist for 7900, 7906 and IDE disks, and with a bit of hacking (as with the 7906 sim) it is possible to support multiple disk types and autodetect the one to use by looking in high memory to see what disk the build was booted from (if any). The 7906 sim contains 7906 and IDE disk drivers, on startup the !DISK word checks to see what it was booted from, prompts if it can't tell, and sets a %DT variable accordingly. To avoid running the disk menu when no disk is present the disk menu's stock autostarting !DM word has been replaced with !DMI which only runs the menu if a disk was detected or selected. This "combo" method isn't exactly "proper" procedure (normally only one disk driver is loaded) but permits me to boot the exact 7906 sim disk image on my HP2113E IDE disk system by copying 7906.dsk to an IDE disk using a USB adapter and a dd command (conv=swab). No matter what disk driver is used, data is stored on disk in 1KW chunks and always in the same logical location, disk space permitting. Thus SFS, XDOS and other disk software generally don't care what kind of disk it is, and a new disk can be supported by writing a driver for it. There are only a few functions the driver has to perform... Set the logical 1KW block address (high low SBLA calls this function) Load a 31KW binary into main memory from the set block (LDFB) Load 1KW from the set block into memory (address R-1K) Save 1KW from memory to the set block on disk (address W-1K) Check the drive status (