chs order in which an image's blocks are written to a floppy?

Started by bobl, November 10, 2009, 07:48:28 PM

Previous topic - Next topic

bobl

I'm writing some floppy read code on a machine that doesn't have a floppy and...
after years of using RawWrite & dd suddenly realise that I don't know the chs order
in which images are written


logical             chs tuple
block
number/
lba                   (cylinder, head, sector)
0                      0,             0,        1
1                      0,             0,        2
2                      0,             0,        3
62                     0,             0,        63
63              0,             1,        1



I got this off 'http://en.wikipedia.org/wiki/Cylinder-head-sector'; i.e.
a site talking about 63 sectors per track (prolly not a floppy!).
The pattern suggests that 
disks are filled up by varying...
   sectors before heads &
   heads before cylinders
and that whilst cylinders and heads start at 0, sectors start at 1.

Can someone please advise if these rules hold true for floppies.
Thx

BTW What can I do to maintain the alignment of the numbers which look fine in the editor




dedndave


MichaelW

The LBA-CHS equivalents shown in the linked article are correct for diskettes and for old hard disk drives, but for recent (~1990+) hard disk drives CHS is more or less meaningless. The attachment contains a Win32 console app that implements the LBA/CHS translation as specified in the ATA standard (~ATA/ATAPI-5), and displays the LBS-CHS equivalents for the first 200 LBAs.
eschew obfuscation

bobl

Thx to both of you for the confirmation and example.
I shall be using a hard disk too.