At my request
about two weeks ago, Dave added support for mixed sector
sizes to the Imagedisk file format specification, so as a container
format it will work fine. However, he did not add support to the
Imagedisk program, because a 765/8272-style FDC apparently can't format
a track with mixed sector sizes.
Oh, sure it can. Witness the IBM XDF format
floppies and the programs
that can format and write them. You just have to be a little clever is
all. --Chuck
I think I know how to format with the last sector on a track different
than the others, which is what Al would need for the HP discs, though I
haven't actually tried it. I have no idea how one might reliably get any
other mix of sector sizes on the same track when using a 765/8272-style
FDC.
You sure can't *FORMAT* disks with mixed sector sizes on a PC's FDC.
To be clear, what I mean by this is that using only the format command to
the 765, you can't create a disk with validly formed mixed sized sectors.
What you can do when formatting is:
- Lie about the sector size when supplying the data for the individual
ID headers.
- Fill in bogus head/sector data for sectors you don't want to use
(and will overwrite) later.
- Control the gap3 size for the entire track.
- Write fewer sectors than will fill the track
- Reset the FDC before it has completed writing the final sector
on the track.
But you can't actually create (with the format command) sectors of
mixed sizes. It *IS* possible to write disks with mixed sector sizes,
and it *IS* possible to format a disk such that it can be written with
mixed sector sizes - but only in a very few limited cases of
usefulness (XDF is one of these).
The fact that all sectors have to be formatted the same size means
that alll the sector headers have to be evenly spaced, which is usually
NOT where you want them for a arbitrary mixed-sector-size disk.
You can format the track with smaller sectors, lying about the sizes
and filling in the ID data on sectors you won't use with values that
won't match ... but due to the additional headers and gaps, you won't
be able to overlay larger sectors into these "slots" without extra
overhead - two 256 bytes sectors takes more space on the disk than
a single 512 byte sector. This means that for most disk formats you
will run out of space. It doesn't help that most controllers cannot do
128 bytes sectors in MFM (TESTFDC will check this for you).
The last sector is a special case - because it's header will actually
be where it is supposed to be. So theoretically you can just give it
the required (different) sector size in the last ID field and you should
be good.
If the last sector is going to be bigger, this is easy - there will be a
big gap after the last sector, and when you write the larger sector
everything works (assuming the whole track still fits of course).
If the last sector is smaller, and the original larger sector won't fit,
it gets tricky - One would hope that the FDC would stop formatting
at the index hole - you would have "bad data" which would be
overwritten by the good smaller sector when you write it and
everything would be good ... but that is not the case (at least with
the PC I tried this on when I was looking into it).
The FDC keeps formatting past the index hole, and overwrites
the first sector on the track, So you need to kill the FDC after it
has written the header, but before it reaches the end of the disk.
If you are running the FDC interrupt driven, this wouldn't be too
hard - wait a few microseconds after you feed it the last sector
ID information than reset the FDC. But if you are running it DMA
(which is what ImageDisk does) you don't have this detail of
knowing when the last sector is being written - and since you
don't know when it starts writing (depending on the position
of the index hole), you don't know how long to wait.
Unfortunately the case of the last sector being smaller than the rest,
and a full-sized sector not fitting is probably the most common, as
it makes sense when trying to fit the most data possible onto a
track.
In the 7 years since I started the ImageDisk project, I think that Erics
request to expand the format to support mixed-sector-sized disks
which I received a couple of weeks ago was the first request I've
had about mixed sector sizes disks - and his was only for the
format specification.
Given the rarity of mixed-sector sizes disks in classic systems, the
inability to handle arbitrary mixed-sector-sized disks with the PC's
FDC, and the difficulty in handling the very few cases that it might
be able to recreate, I have so far elected not to try and implement
this capability in ImageDisk. IMHO handling of this type of disk is
better done with a hardware disk imaging system.
At some point if/when I have time, I'll look into adding the ability
to read mixed-sector-sized disks into ImageDisk. It would also
be fairly simple to allow it to re-write mixed-sector-sized images
to disks that are already formatted. Having it try to format disks
compatible with arbitrary mixed sector-sized disks would however
be difficult, especially given the fact that ImageDisk's FDC driver
is DMA.
If/when it gets this far, I might then consider creating a separate
stand-alone program using the FDC in interrupt mode, and allowing
the user to tweak "most everything possible" to try and format a
compatible disk on the PC ... or perhaps one of the more clever
people on the list would like to take on this as a project ?
Dave
--
dave12 (at) Dave Dunfield
dunfield Firmware development services & tools:
www.dunfield.com
(dot) com Classic computers:
http://www.classiccmp.org/dunfield/