[comp.os.cpm] 3.5inch HD disk formats: Why not 11*1024

ralph@uhheph.phys.hawaii.edu (Ralph Becker-Szendy) (02/07/91)

I just found this message I always wanted to post but never got around to. I
think it was posted to the INFO-CPM side, but never made it to comp.os.cpm.
So here we go:

A while ago there was a long discussion in this space about what the
maximum usefull capacity of a 3.5" disk in HD mode should be. I
remember Dave Goodenough claiming that he runs his with 10*1024+1*512
byte sectors per track, which Tilmann Reh found disgustingly
incompatible, therefore Tilmann uses 10*1024 and frowns on Dave.

Anyhow, we were just re-writing the formatting routines of my disk
controller. We came across something very strange. We claim that
11*1024 is legal ! Here's how the numbers work out:

A 3.5" HD drive is equivalent to a 8" DD drive (500kHz data rate MFM),
except that it spins at 300rpm instead of 360rpm. Lets express that as
saying that a 3.5" drive spins at 5rps. Therefore a track contains
500kHz / 5rps = 100000 bits = 12500 bytes, whereas a 8" track contains
10416 bytes. By the way, the data sheet for a Toshiba ND3561 drive and
for Mitsubishi 3.5" drives agree on 12500 bytes per track, whereas the
data sheets for 5.25" HD drives (which spin at 360rpm like 8" drives
when running in HD mode) say 10416 bytes, just as they should.

Now the overhead on each track. It consists of track header:
- Gap 4a:         80 bytes (content 4E)
- Sync:           12 bytes (content 00)
- Index mark:      4 bytes (3xC2, FC)
- Gap 1           50 bytes (content 4E)
then for each sector:
- Sync:           12 bytes (content 00)
- ID adress mark:  4 bytes (3xA1, FE)
- Sector ID:       4 bytes (Cyl, Head, Sect, Len)
- Sector ID CRC:   2 bytes
- Gap 2:          22 bytes (content 4E)
- Sync            12 bytes (content 00)
- Data mark:       4 bytes (3xA1, FB)
- Data:         1024 bytes
- Data CRC:        2 bytes
- Gap 3            n bytes (content 4E)
and after all sectors:
- Gap 4a:          m bytes (content 4E).

This layout of a track was obtained from the data sheet of the WD 37C65
controller (which agrees with the 176x and 179x controller family, and
with the 2797 actually used in our controller board), and agrees with 
the ones listed in several different drive data sheets.

Therefore, each sector occupies 1086 bytes (1024 net plus 62 bytes
overhead), and there is an additional track overhead of 146 bytes.

Now, we still have to calculate the lengths of Gap 3 and 4a, called n
and m so far. Gap 4a has to be at least 16 bytes, but most formats seem
to use at least 120 bytes, so we stick to just setting its minimum
length at 120 bytes. Now just take the total track length (12500),
subtract track overhead (-146), subtract the minimum length of Gap 4a
(-120), and subtract the space required for data sector (-11*1086).
That yields 12500-146-120-11*1086 = 288. 

Now take these 288 bytes which are left, and distribute them evenly
over the 11 Gap 3s, making each 26 bytes long. In the 176x data sheets
a length of 24 bytes for gap 3 is recommended, so we are safely within
specs. Then the rest of the track (11x26 is a little less than 288 due
to rounding) is filled by letting Gap 4a get as long as it wants
(therefore in our case Gap 4a will be at least 120 bytes, usually a
little longer).

By the way, according to the 176x data sheet the limit of 24 bytes for
gap 3 (as indeed all gap lengths we used above) is already increased
above the functional limit to account for motor speed variation, PLL
lock up time, write splice area etc. Supposedly one can cut all gap
lengths in half (most gaps can theoretically be as short as 2 bytes)
and it would still work. So we seem to be far on the safe side.

Conclusion: 11x1024 is a legal format, and actually leaves a little bit
more safety margin than recommended in the controller data sheet. So,
why does nobody use it? And therefore, why should we be the first ones
to find that out?

Thanx for enlightenment, and don't start a religious war over this one.

Ralph Becker-Szendy and Christoph Tietz (visiting)























-- 
Ralph Becker-Szendy                          UHHEPG=24742::RALPH (HEPNet,SPAN)
University of Hawaii                              RALPH@UHHEPG.PHYS.HAWAII.EDU
High Energy Physics Group                                  RALPH@UHHEPG.BITNET
Watanabe Hall #203, 2505 Correa Road, Honolulu, HI 96822         (808)956-2931

rzh@ICF.LLNL.GOV (R. Hanscom) (02/08/91)

ralph@uhheph.phys.hawaii.edu (Ralph Becker-Szendy) writes:

>   stuff deleted
>A while ago there was a long discussion in this space about what the
>maximum usefull capacity of a 3.5" disk in HD mode should be. I
>   more stuff deleted

Great, but has anybody actually swapped a 3.5" drive for an 8" drive
and gotten it to work as an 8" drive (I admit that it wastes part
of the 3.5" drive!)??  There is *SOME* attraction in replacing noisy
8" power hogs with newer, quieter hardware *WITHOUT THE ADDED HASSLE
OF SOFTWARE MODIFICATION*.  Part B of the question is, what is the
wiring mod. on the drive connector??

           roger          icf!rzh@lll-winken.llnl.gov
                            rzh@phoenix.ocf.llnl.gov
                              hanscom1@llnl.gov

tilmann@mcshh.hanse.de (Tilmann Reh) (02/10/91)

> remember Dave Goodenough claiming that he runs his with 10*1024+1*512
> byte sectors per track, which Tilmann Reh found disgustingly
> incompatible, therefore Tilmann uses 10*1024 and frowns on Dave.
> Anyhow, we were just re-writing the formatting routines of my disk
> controller. We came across something very strange. We claim that
> 11*1024 is legal ! Here's how the numbers work out:

I never told something about (nor ever used) a 10x1024 byte 3.5" HD format.
The only 3.5" HD format I ever defined was 11x1024 byte, giving 1760k
per disk. Perhaps at least Christoph remembers that I was the one who gave
him the algorithms and data sheets for gap calculation (resulting in the
format mentioned above).
Sometime ago someone else spreaded a word about things I would have said
concerning format definitions (kind of the above), which are also absolutely
nonsense. Seems like someone is misusing my name?

However, the discussion with Dave was concerning 5.25" DD formats, where I
use 5x1024 byte (or 10x512, if necessary). Dave argued to put one more 512
byte sector in the resulting gap4 (possible only with 5x1024), which I
strictly claimed (and still claim) ILLEGAL.

For those who still do not know about how to reach maximum LEGAL capacity,
and to end the rumours about my format definitions, here are some facts:

3.5" and 5.25" DD:	5x 1024 per side (200/400/800k)
5.25" HD and 8" DD:	9x 1024 per side (1440k)
3.5" HD:		11x 1024 per side (1760k)
All my formats have zero offset tracks (thanks to CP/M-Plus), so the above
capacities are NET.

Tilmann Reh		tilmann@mcshh.hanse.de
			tilmann.reh@hrz.uni-siegen.dbp.de

sprague.wbst311@XEROX.COM (02/11/91)

> Great, but has anybody actually swapped a 3.5" drive for an 8" drive
> and gotten it to work as an 8" drive (I admit that it wastes part
> of the 3.5" drive!)??

Why not use a 5.25" HD drive?  They usually cost about $10 less, and the swap
*seems* to be easier.  And yes, I have replaced 8" drives on a Xerox 820-II
with 5.25" HD drives.  My next attempt will be on a CompuPro S-100 system.

I have not completed the 820-II project yet, due to the stupid mistake of
plugging my interface board in backwords, and blowing one of the drives (maybe
both).  ARRRRGH!!!  However, I have formatted, sysgened and booted a floppy on
the 5.25" HD floppy.

If anyone is interested, I can send out the modification.  If you have the pin
out of your drive, it's fairly obvious what you need to do .. though not in all
cases.  In addition, you may have trouble with the MOTOR ON signal, which 8"
drives don't have.  Some drives allow you to tie the Drive Select to the motor
on, others don't.  Assuming you have power, there is a one chip solution for
Motor On, should you need it.

				~ Mike  (Sprague.Wbst311@Xerox.Com)

wilker@gauss.math.purdue.edu (Clarence Wilkerson) (02/12/91)

The Heath H89 CP/M 2.203 BIOS supported a 5 x 1024 format
which was quite a bit faster than the 18 x 256 format.
Of course, it used an extra 1k or so to buffer the data
in the bios. 

sprague.wbst311@XEROX.COM (02/14/91)

It was suggested that I post the the "one chip solution" for generating Motor
On to a 5.25" HD drive, when making it act like an 8" drive.  Note that I have
*NOT* yet tried my one chip solution .... I will as soon as the NEW drives I
ordered arrive.  Grumble be VERY careful that you don't plug things in
backwards!!!  If something is wrong with this, PLEASE let me know!  I have been
known to make mistakes in the past.  :-)

Since most 8" drive motors are AC and *USUALLY* always spinning (though there
are hardware solutions for this), there is almost never a Motor On signal in
the 8" drive interface.  Some 5.25" drives allow you to set a jumper in order
to use the Drive Select signal for Motor On.  Other drives (Epson for example)
do not seem to do so.

In addition, there is only one drive select line for a 5.25" interface.  While
I am not sure on this, I believe IBM's twisted cable allows them to use one of
the unused Drive Select lines for a Motor On signal, thus they have a Drive
Select *AND* a Motor On signal for each drive.  Let's hope that the high
density drive manufacturers are not making drives specifically for IBM's
twisted cable .... that is, I am banking on the fact that you can still power
*BOTH* drives Motor On signal at the same time like you can for most 360k
drives.  If you can't, this is a serious hiccup in the one chip solution.

Last note that the drives use reverse logic, that is, active low signals.  For
drive select to be active, it must be low.  For the motor to turn on, Motor On
must be low.

A truth table for a two drive system:

 DS0 | DS1 || Motor On
-----+-----++---------
  0  |  0  ||    X	This should never happen.
  0  |  1  ||    0	Drive "A:" has been selected, Motor On.
  1  |  0  ||    0	Drive "B:" has been selected, Motor On.
  1  |  1  ||    1	Neither drive is active, Motor Off.

So if you make the "X" condition a logical "0", you have the truth table for an
AND gate (7408).  Of course, you can also use a NAND gate (7400) and take the
output into both inputs of another NAND gate (4 of them on a 7400), which will
make it act like an inverter.

For a system with more than two drives, use a 7411 for three drives or a 7421
for 4 drives.  Again, by using one of the spare gates in the chip as an
inverter, you could also use a 7410 or a 7420.

Remember, it is a good idea to put a capacitor between Vcc and ground.  A .1uF
ceramic disk should do.

In my case, on a Xerox 820-II, I have a 5 Volt power line in the interface
cable.  I have a small wire wrap perfboard cable adapter which ties the correct
lines in the 820s drive interface cable to the cable that goes to the 5.25"
drives.  This chip will be mounted in the center of the perfboard.  While power
is not a concern, I will probably use LS TTL chips, because I have them.

The CompuPro S-100 will not be so easy, assuming I need to do this.  For it, I
will have to pull 5 Volts from the floppy drive power supply itself.

				~ Mike  (Sprague.Wbst311@Xerox.Com)