The Museum of HP Calculators
HP Articles Forum
[Return to the Index ]
[ Previous | Next ]
liffile - HP9114 LIF disk image file
Posted by Tony Duell on 20 Mar 2002, 11:55 p.m.
This article describes the files that may be found at
ftp://ftp.hpmuseum.org/hpswap/. You may also be interested in the LIF Utilities for linux.
DESCRIPTION
The HP9114 LIF disk image file format was designed as a
simple way to store HP9114 disk images on a larger computer, and to allow programs to be written to process
those images (including writing them back to a physical
disk).
IMAGE FILE & LIF LOGICAL BLOCKS
The file consists of a raw dump of the data blocks on the
disk, in increasing numerical order. There are no headers
or trailers added, either for the entire image or for each
block. That is to say :
Bytes 0 to 255 are LIF logical block 0
Bytes 256 to 511 are LIF logical block 1
Bytes 512 to 767 are LIF logical block 2
and so on
As an HP9114 disk contains 2464 user blocks (organised as
77 cylinders, 2 heads, and 16 sectors per track, with each
sector being 1 block), an image file is always 2464*256,
or 630784, bytes long.
LIF DISK PHYSICAL BLOCKS
The correspondence between the logical block numbers
described in the last section and the physical sector
addresses on the disk is also straightforward. The cylinders on the disk are numbered from 0 to 76. the 2 heads
(sides) are called 0 and 1, and the sectors on each track
are numbered from 0 to 16. Then :
Block 0 is cylinder 0, head 0, sector 1
Block 1 is cylinder 0, head 0, sector 2
Continuing on cylinder 0, head 0, until...
Block 15 is cylinder 0, head 0, sector 16
Block 16 is cylinder 0, head 1, sector 1
Continuing on cylinder 0, head 1 until...
Block 31 is cylinder 0, head 1, sector 16
Block 32 is cylinder 1, head 0, sector 1
And continuing in this manner for all 77 cylinders
PSEUDO-CODE TO WRITE AN IMAGE TO DISK
Assuming the necessary functions exist to seek the disk
head to a particular cylinder ( seek() ) and to write a
256 byte sector ( writesector(cylinder,head,sector,data[]))
then it is reasonably easy to write a program to transfer a disk image to a physical disk. The following
pseudo-code gives the basic idea :
declare blockbuffer to be 256 bytes long
open(image file)
for cylinder=0 to 76
seek(cylinder)
for head = 0 to 1
for sector = 1 to 16
read next 256 bytes of image file into blockbuffer
writesector(cylinder,head,sector,blockbuffer)
next sector
next head
next cylinder
close(image file)
end
REFERENCES
The logical block structure of a LIF device is given in
appendix D of the HP-IL Module for the HP71 Owner's manual. The relationship between LIF logical blocks and
physical disk sectors was determined experimentally.
RESTRICTIONS
Although the LIF Utilities for linux are released under
the GNU public license, the only restriction placed on the
use of this image file format is that no (other) restrictions may be placed on its use. Anybody is welcome to
write programs using this file format (for example to convert the image files into other formats, or to transfer
between physical disks and the image format) for any computer or operating system, and to distribute these programs under any license terms they choose.
AUTHOR
The LIF image file format was designed by Tony Duell,
ard@p850ug1.demon.co.uk
[ Return to the Message Index ]
Go back to the main exhibit hall