With the data clocks off the drive, I'm having a
few problems working out
the actual format that HP use to record files on the disk.
It looks as though the first block on the disk (block 0) contains
information about the volume label, number of blocks available, number of
blocks allocated etc. (and I assume the length of the catalog).
The next few blocks seem to contain the catalog information itself - file
names, start locations lengths, file types etc.
Does anyone have access to details of the format that HP use to store files
on cs80 protocol disks/tapes?
THis sounds very much like LIF (Logical Interchange Format). It's
documented (mostly) in the back of the manual for the HP71 HPIL module
(of all places). All blocks are 256 bytes long.
Block 0 is the volume label/descriptor block
Bytes
0-1 LIF ID (0x80, 0)
2-7 Volume lablel, ASCII, padded with spaces
8-11 Directory start block number, MSB first
12-13 System 3000 compatibility (0x10, 0)
14-15 zeros
16-19 Directory length (in blocks, MSB first)
20-21 Version (normally 0 1)
22-23 zeros
24-27 Tracks per surface
28-31 Number of surfaces
32-35 Records per track
36-41 Date and Time intialised (year, month, day, hour, minute, second in BCD)
42-255 zeros
Block 1 is all zeros
Each directoy block (the directory normally starts in block 2, BTW)
contains 8 directory entries, each 32 bytes long. Each entry describes a
file. Files must be contiguous, and the directory entries must appear in
the 'right order' -- that's to say they describe the files (and unused
space) in the order it appears on the disk.
A directory entry contains ;
Bytes
0-9 Filename, ASCII padded with spaces
10-11 Filetype (binary)
12-15 File starting block, MSB first
16-19 File length in blocks, MSB first
20-25 Date and Time created (see above for format)
26-27 Volume flag/number (0x80 1)
28-31 File type specific bytes (often the exact file length, record size,
protection, etc is put here. File lengths may not be in bytes!)
The filetype is a 16 bit number. The important ones to recognise are
0 0 Deleted file (empty space on the disk)
0xFF 0xFF End of directory
0 1 Text file (note, this is a somewhat odd format, it's not a
simple stream of ASCII characters).
Others will be OS-specific. I know them for the calculators, but that's
no help to you.
You may want to look at my 'LIF utilites for Linux', available from the
HPCC web site. Although they won't do what you want (they're written for
the 9114 floppy disks used on the calculators, and the parameters of this
disk type are hard-coded in some of the programs), you might get some
useful hints from the source code, or you might just want to laugh at my
terrible C.
-tony