Juergen (CH) wrote:
> Does anybody know what this DSF header used by LIFUTIL is?
Its essentially a single file LIF image (http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/articles.cgi?read=24) with significantly reduced directory area. The first block (256 chars) is essentially the same as the first block of a LIF volume (differences: there is always only one file on the volume, and the volume label is always HFSLIF).
The second block contains two directory entries (same as a LIF volume) the first is the entry for your file. The really annoying thing is that the directory entry always has the name WS_FILE instead of the LIF filename (what a wasted opportunity). So you need to specify the filename your self.
The second directory entry is of type 0xffff, end of directory entry.
So you can essentially cut&paste from a LIF volume to create a LIFUTIL DSF file.
Following is some hex dumps with comments:
DSF image of file CH4.BIN (from the HP85 training pack):
000000000000 80004846 534c4946 00000001 10000000 *..HFSLIF........*
000000000010 00000001 00000000 00000001 00000001 *................*
000000000020 00000005 11111111 11110000 00000000 *................*
000000000030 00000000 00000000 00000000 00000000 *................*
*** SAME ***
0000000000f0 00000000 00000000 11111111 11110000 *................*
000000000100 57535f46 494c4520 2020e022 00000002 *WS_FILE ."....*
000000000110 00000003 00000000 00008001 f0020001 *................*
000000000120 00000000 00000000 0000ffff 00000000 *................*
000000000130 00000000 00000000 00000000 00000000 *................*
*** SAME ***
000000000200 4d41494e 000040f0 02000000 00000000 *MAIN..@.........*
000000000210 00000000 00000000 10000c85 7f013751 *..............7Q*
000000000220 9b060343 48340e20 00064740 5a40000e *...CH4. ..G@Z@..*
000000000230 30002f46 40474056 051f494e 434f5252 *0./F@G@V..INCORR*
000000000240 45435420 5052494e 54455220 53504543 *ECT PRINTER SPEC*
000000000250 49464943 4154494f 4ef0ec40 56ec4056 *IFICATION..@V.@V*
000000000260 ec0e4000 3656052d 506c6561 73652073 *..@.6V.-Please s*
000000000270 70656369 66792074 68652070 72696e74 *pecify the print*
000000000280 65722e2e 2e202020 2832206f 72204f54 *er... (2 or OT*
...
...
...
This is the HP85 Training pac diskette image (extracts)
1st sector:
000000000000 80004241 53494320 00000002 10000000 *..BASIC ........*
000000000010 0000000e 00000000 00000000 00000000 *................*
000000000020 00000000 00000000 00000000 00000000 *................*
*** SAME ***
Directory entry for file CH4
000000000240 43483420 20202020 2020e022 0000006d *CH4 ."...m*
000000000250 00000003 00000000 00008001 f0020001 *................*
Comparing the two we see that they have only minnor differences (just the filename and the start sector on disk, which is always 2 for the DSF as the file starts on the third sector of the image (which is block 2 if you start counting blocks from 0)
Summary: To create a DSF archive you:
(a) copy the first two blocks (block 0 and 1) from an existing DSF archive.
(b) copy the LIF directory entry of the file (32 bytes) into the
beginning of the second block (block 1) of the new DSF archive (absolute DSF file address 0x0100).
(c) Edit the file directory entry in the new DSF archive to change the filename to WS_FILE and the starting block to 0x00000002 (absolute DSF file address 0x010C).
(d) Append file contents to DSF archive starting from the third block (block 2), absolute DSF file address 0x0200.
**vp
Edited: 10 Oct 2005, 7:33 p.m.