Subject: LIF floppy hacking
To: None <port-amiga@NetBSD.ORG>
From: Håkan Thörngren <hth@analytik.analytikerna.se>
List: port-amiga
Date: 05/14/1998 14:52:39
This is a rather long mail about the NetBSD-Amiga floppy driver.

I recently acquired an ancient HP9114A floppy disk drive.  It uses
something that is called LIF floppies.  These are really 3.5" DD
floppies with 256 bytes block size.  I took a guess that it used the
same MFM encoding as MS-DOS and started to hack fd.c in=20
NetBSD-Amiga 1.3.1.=20
I was able to read LIF formatted floppies surprisingly easy, writing
was troublesome, both eventually it worked as well.

This hacking created a lot of questions that puzzles me, I hope that
someone can spread some light...

Using the MS-DOS write code and the LIF sector format caused the
track write to overrun itself damaging the first written sector.
I fixed this by reducing the sector trailing gap (for LIF only).

I use 'dd' to read and write the entire floppy.  Writing to a floppy
is done sector sequentially, there is no sector interleaving done at
all.

Is it possible to format a floppy on Amiga-NetBSD? =20

What is disklabel supposed to do on a floppy?  I could only use it
for displaying the floppy format, write does not seem to work.

Finally, some notes about my changes:

First of all, the floppy driver is not very nice to block sizes other
than 512, I think I have fixed that problem now.

I access the floppies using /dev/fdXc and just picked "the next
available" device numbers.

Can someone take pity on me and merge my changes to -current,
possibly cleaning them up a little bit?  That would save me from
having to edit fd.c for every future release..
Just tell me where to email the diffs, or the complete fd.c
as desired..

Since I do not fully understand how the kernel uses fd.c, my fixes=20
may be little bit off a hack in the dark.

BTW, I took a look at the Linux kernel (no, I do not use Linux or
PCs), it does not support HP-LIF either.  They do support a wide
range of other floppy formats though.

As a final note, there are also LIF floppies with 512 bytes blocks,
but I have ignored them as I am unable to test them.  They should
really be the same as MS-DOS floppies, except that they use 77 tracks.
HP claims to use the last 3 tracks for data reliability, but I have
not found any documentation about it. Those tracks are not formatted
by the 9114 floppy disk, at least not in the ordinary way.

  /H=E5kan