Apr 82 DSKPAT - V03 DSKPAT is a program designed for general inspection and modification of disk blocks. The program prompts for a device specification then uses this to assign LUN 4. The device is normally a disk but it is not necessary that this be the case, tapes, printers, or communications devices could be used for special purposes. The device is then attached as a check for mounted devices. A command loop is entered. All I/O, display, and modification is to and from a 512 byte block buffer. There is no modification of the disk without explicit actions by the user. The program makes no assumptions about the structure of the disk other than to associate symbolic names to common logical block numbers seen in Files-11 (Home and Index), and to calculate check-sums in both Home block and simple block-sum manner. Program exit on "^Z" and return to "Device?" prompt on "DONE". Version 3D supports the following functions. Optional arguments are enclosed in "[ ]" and one of a group in "{ }". get [ LBN ] put [ LBN ] set {LBN, READONLY, INDEXF, TERMINAL, PRINTER} next dump {o,b,a,r,h,f,d} [ loc ] {OCTAL, BYTE, ASCII, RAD50, HOME, FILE, DIRECTORY} modify loc val display loc status home [ set,verify ] block [ set,verify ] save [ buf ] restore [ buf ] mcr command_line_text done help LBNs can be #, NEXT, PREV, BOOT, HOME, INDEX, or LAST GET and PUT perform IO.RLB/IO.WLB access to the Logical block number specified. The default LBN is the one last accessed or specified with SET. The LBN can be entered as octal, decimal (trailing decimal point) or symbolic (NEXT, PREVIOUS, BOOT, HOME, INDEX, or LAST). ex: GET 1234. GET HOME PUT 777 SET allows the user to set the selected device READONLY, specify the next LBN to use, pick up INDEXF.SYS LBN from a HOME block in the buffer, switch the DUMP device from the terminal to a printer (or whatever is assigned to LUN 3). ex: SET 1234. -> Default LBN SET READONLY -> Write protect SET PRINTER -> Use Lun 3 NEXT is equivalent of to SET NEXT and establishes the default LBN as one greater than the current LBN. DUMP allows the user to inspect the current block buffer in a variety of formats. Currently, octal, octal-byte, ascii, rad50, and Files-11 directory format have been implemented (as of V3D). The starting LOCation or buffer offset defaults to zero. DMP is a synonym for DUMP. ex: DUMP R 600 -> Dump 600-776 in RAD50 DMP D -> Dump in directory format DISPLAY allows the user to examine any word in the current buffer in decimal, decimal-byte, octal, octal-byte, ascii, rad50, and hexadecimal. DSP is a synonym. ex: DISP 234 -> Show offset 234 contents 32771 3,128 #100003 #003,200 $8003 %TSK " ( decimal ) ( octal ) (hex) (R50) (ascii) MODIFY allows the user to specify a new contents for any location in the current buffer. ex: MOD 234 nn -> Change offset 234 to nn HOME and BLOCK allow the user to verify or set check-sums for Files-11 Home blocks and blocks. The VERIFY modifier is optional and the default. The correct check-sums can be inserted into the buffer by specifying the SET modifier. FILE is a synonym for BLOCK. ex: HOME -> Verify Home CS BLOCK VERIFY -> Verify Block CS FILE SET -> Calculate and set Block CS SAVE and RESTORE provide a mechanism for storing several blocks in memory that can later be reused on the current disk or on a different one. The number of SAVE buffers is a conditional (default 4) that can be changed by the user. ex: SAVE -> Copy buffer to SB 0 RESTORE 3 -> Copy SB 3 to block buffer DONE indicates that the current device is to be released. The "Device? " prompt will be reissued. The readonly flag is cleared, the next LBN and INDEXF buffers are cleared. SAVED blocks are maintained across this transition. ex: DONE -> Release this device Device? vd: -> Get next volume Three other functions exist. HELP presents a short summary of the implemented functions along with program version and task build date. The summary at the beginning of this document is an abstraction from the HELP display. STATUS prints a report about the current device and program state. The final resolved device name and unit number and the READONLY flag is displayed. The NEXT LBN, MAX LBN, and any saved disk blocks are indicated. The $DSW and IOSB for the last disk QIO are displayed to allow diagnosis of any problems that occur. MCR allows the user to issue any MCR command on systems that support the Spawn directive. Exit status is available in the $DSW field of the STATUS command. The disk device is detached so that the spawned program can access it as well as this program. This can provide a substitute for the file header format dump. ex: MCR DMP TI:=DK:/BL:1234:1234/HF General notes: The SAVE buffers are located immediately following the block buffer and can therefore be accessed by the DUMP, DISPLAY, and MODIFY commands by using offsets greater than 1000(8). The range of offsets will be 1000 plus 1000 times the buffer number wanted. ex: DUMP 2346 -> Dump save buffer 1 + 346 The program can access mounted volumes by building it /PR:0. Be extremely careful in this mode, because there is no protection against totally destroying your disk other than your own great care. This capability is, on the other hand also extremely useful. The program is quite useful for recovering data from crash dump files from common and task buffers. Anticipated enhancements include generalised file access, a calculation routine for offset and linkage checks, and additional dump formats. Multiple commands per line, a command "REPEAT N COMMAND ", and command macros are under consideration.