I've now got the first and most important disk imaged using dd and the
contents of the fdutils package. The image is clean: os9exec mounted it
without complaint (it has to read the first 256 bytes and like what's in
them to do this), lha successfully verified the archive in the disk and
unpacked it into the /dd (main hard disk) image.
I did this by using setfdprm from fdutils 5.5 to tweak the parameters in
floppy.ko on my Fedora 16 (kernel 3.4) system and then reading the disk
with dd. The OS-9 disks I need to read were recorded in a 3.5" HD (1.4
MB) drive. They are formatted using 34 sectors per track, two sides and
80 tracks. The sectors are 256 bytes and, the main reason I couldn't
initially read the disks, the track and sector indexes are zero based
rather than using the more usual 1-base.
Once I started playing with setfdprm I was able to read 8KB (i.e. 33
blocks plus a bit of crud and so had something to look at: it was
immediately obvious that the first (ID block) had been skipped over and
there was a clue in the /usr/local/etc/mediaprm file, which defined the
OS-9 level 1 disks for the Color Computer required 'zero-based'. Once I'd
worked out how to get that accepted (see below) I was able to read the
day-1 backup disk I'd been using for testing with 'conv=noerror' set on
dd, but although the disk was mountable it wasn't clean. Fortunately, the
day-0 backup read cleanly on first try with no errors being reported.
Problems.
=========
As another poster said, the documentation for fdutils isn't great: a huge
understatement. Its not only badly organised and an 'info' package, but
its internally inconsistent (there are at least four different names and
locations given for the disk formats library) but incomplete (there's no
mention of the 'zerobased' parameter that I could see).
'fdmount' won't compile because it needs a header that lives deep in the
kernel-specific file structure and there's no simple way to tell make
where it lives: I don't need fdmount so commented it out of 'make all'.
'make install' failed to install the disk format library so I copied in
in place manually.
Parameter names are not consistent in the code: the zero based flag
appears in the code as both 'zero-based' and 'zerobased': as the code
stands both names upset one of the programs. Even worse, setfdprm
expected 'zerobased' if supplied from the command line, but 'zero-based'
in the disk format library. So, I did a search&destroy through the source
to standardise on 'zerobased' and then edited the disk format library to
use 'zerobased'. This was needed because this value is defined by string
literals scattered through the codebase rather than as a single #define
in a header. That problem fixed, I was able to successfully read a floppy
with zero based track and sector indexing.
Summary: this is a useful package. A lot of effort has obviously gone
into it, so its a pity that the documentation is so unfriendly and that
the build is flawed. I'll provide feed back to its maintainer about these
problems and will also document the particular OS-9 floppy format that my
system uses.
Thanks to all on ucol who helped me solve this problem: my accounting
system is up and running again and the other stuff I use OS-9 for will
shortly be joining it.