On 01/04/2014 10:37 AM, Pete Turnbull wrote:
Anyway, working out the number of heads is trivial.
Every sector on any
vaguely conventionally formatted MFM drive has a header with an ID mark
which includes the track, sector and head numbers. So you just select
each possible head in turn, from 0 up to 7 (most drives) or 15 for
controllers that have a 4-bit head select, read a sector, and see if the
returned head number is correct. The first time it's not, you've just
exceeded the head count.
Similarly, working out the number of sectors/track can be done in a
similar way--and a simple binary search can quickly determine the number
of cylinders. This presuppose a formatted drive.
--Chuck