Tracks and sectors in floppy disk

          

Tracks and sectors in floppy disk

The floppy disk drive  also known as floppy or FDD is the primary removable storage medium for a personal computer. The FDD, once called a mini disk, is the primary medium for getting voluminous information into and out of a micro computer system.  If you have two FDDs of different storage capacities, A: In DOS and Windows the identifier used for the first floppy disk drive; the second floppy disk is designated as drive B:.

A floppy disk, often called a diskette Drive in the PC world, is a thin, round, flat piece of Mylar. It has an extremely thin coating of ferric oxide or magnetic oxide layer that is capable of storing magnetic fields, like thick recording tape. The read-write head in a floppy disk drive stores data on the disk by altering the magnetic particles.

The large, 5.25-inch floppy disks that most PCs use are kept in a paper envelope. The smaller, 3.5-inch floppy that all Macintosh’s and some PCs use is enclosed in a rigid plastic case with a sliding metal shutter for head access.

Floppy disks retrieve information far more slowly than HDD because they rotate at lower speed (300 rpm as against 10,000+ rpm).

Data is written on to the floppy disk by the disk drive’s read/write heads as the disk rotates inside the jacket.

Because floppy disks store information magnetically, any magnet can destroy the data (information) on the disk. This means you should never allow your floppy disks near a magnetic paper clip holder, the telephone, the stereo, a portable radio, or any other electronic device-and don’t pin them to a filing cabinet with a magnet!

IBM Computer used 5.25″ inch floppy disks can contain 360 KB, while modern 3.5″ inch disks hold 1.44 Mb. Floppy disks became the main medium for software distribution during the formative years of personal computing.

In Floppy Disks, information is organized in tracks. Each track is subdivided into sectors and each sector into bytes. The smaller 3.5″ Floppy Disks use 80 tracks per side, 18 sectors per track, and 512 bytes per sector, yielding a capacity of 1.44 MB. Floppy disks first appeared in the late 1960s when IBM used them in an early minicomputer.

The advantage of the floppy disk is that it is removable, and so can be used to distribute software, to transfer data from one computer to another, or to back up files from a hard disk. But compared to a hard disk, floppy disks are also slower, offer relatively small amounts of storage, and can be easily damaged.

I've recently found a more modern application "Floppy Disk Master-7"(Picture 2) (FDM) that visualized the bad sectors, tracks and clusters(Picture 1) on a floppy disk in a similar (but fancier) way to the older "Norton Disk Doctor"(Picture 3) (NDD).

This raised the following question: How do both applications know the start of the first sector and the end of a the last sector of a floppy disk, in order to accurately visualize it on an image (FDM) or progress-like bar (NDD)? When is the disk in the proper direction visualized, assuming sector 1 starts at position twelve-o'clock on the left visualization and on 0% in the second visualization. Or more broadly how does a floppy drive (driver) identify the unique sectors?

Also if I understand it correctly the formatting type(Picture 4) determines the sector structure so in order to analyse and visualize the bad sectors, firstly the formatting type needs to be determined and understood in order to visualize?


Tracks and sectors in floppy disk

Picture 1: Floppy disk Sectors, Tracks and Clusters

Tracks and sectors in floppy disk

Picture 2: Floppy Disk Master 7

Tracks and sectors in floppy disk

Picture 3: Norton Disk Doctor

Tracks and sectors in floppy disk
Tracks and sectors in floppy disk

Picture 4a: Floppy Disk Format 4b: Apple Floppy Disk Format

CJ Dennis

2,4571 gold badge14 silver badges30 bronze badges

asked Jan 14 at 10:11

Tracks and sectors in floppy disk

1

The track identification part is quite simple. Floppy formats are standardized so that there are specifications what is the distance between tracks (e.g. 96 tracks per inch) and what is the position of the tracks from some reference point, so the drive is designed accordingly so that moving the head one step will always step one track, and the heads are aligned during drive manufacture so that they land on the tracks correctly as per the specification. The floppy drive has a stepper motor and it actually does not know at which track the heads are currently moved to, so it is the floppy controller that keeps track of where the head is positioned.

The floppy drive can only detect with an end switch when the heads are moved to track 0 and this status is made available to the floppy controller. When booting up a machine, if the floppy controller detects that the drive is not positioned to track 0, the heads are moved towards track 0 one step at a time until the drive says the heads are now positioned at track 0.

The sectors are more complex. It is not the floppy drive that knows anything about sectors either. For the drive, a whole track with all the sectors on it look like an endless loop with no start or end.

All the drive does is reads the magnetic transitions on the track to the floppy disk controller, and also writes data from floppy disk controller to the track.

Typically the drive also provides an index pulse signal once per rotation to the disk controller which may use the information to do something, like start formatting a track when the index pulse arrives, but it is not essential to normal read or write operation, but it is useful for aborting an operation if it has not succeeded for a few rotations.

When a floppy track is formatted by the controller, typically the controller would wait for the index pulse and then write the whole track in one continuous operation, writing all the sectors, with appropriate preambles and synchronization marks, and with properly timed gaps between sectors. Each sector consists of two parts, first there is a sector ID header which gets written with info such as which track this is, what is the sector number, and how many bytes the sector data contains. Then after a gap, there is sector data header which follows with the sector data and CRC check word. As the index hardware pulse starts the track formatting, sometimes there is also an index data mark written right at the beginning of a track, to mark the beginning of a track in the data stream.

So when the controller is commanded to read one or more sectors starting from some specific area of the drive, it would seek to correct track, select correct read head (top or bottom side), and starts listening the data stream for the correct sector header and when it has been detected the sector data is passed on to system one way or another (IO or DMA). This would continue if more than one sector needs to be read.

Please note that the order in which the sectors are on a track is set during track formatting. For a floppy that has 18 sectors per track, they could be in any order on the track. In some systems the tracks were not organized linearly, but interleaved so that if the system can't read two consecutive sectors, at least there is no need to wait for a full rotation until the sector with the next number is again under the head and available for reading.

So it is unlikely that these software programs actually know how the sectors are physically located on a track. Most likely they work with just the logical sector number. This can be seen from the images that the programs don't even care that 1.44MB floppies were two-sided, and that for NDD it uses 3 sectors per one symbol for the status.

So, just for reading and writing floppy images or checking for bad sectors, it is irrelevant how they are visualized versus how the sectors really are physically located on each track. To the software, an 1.44 MB floppy is just a block device with 2880 sectors of 512 bytes each and they can be accessed without problems or then there is a problem which can be visualized.

Tracks and sectors in floppy disk

user3840170

18k4 gold badges71 silver badges115 bronze badges

answered Jan 14 at 13:33

JustmeJustme

20.8k1 gold badge46 silver badges99 bronze badges

13

Where there are various formatting schemes for floppy disks, the usual is to break down a track into sectors. This is done during formatting and the individual sectors are written with empty data in them along with "buffer" zones between them.

Each of the sectors typically has an "address" that in incorporates the SIDE, TRACK, and SECTOR numbers.

When the disk is being read or written the controller needs to find the exact side, track, and sector where the data is to be read from or written to. It does this by starting to read sectors until it finds the one with the address being looked for and once it does it either reads the data block from that sector or switches on the write circuitry to write the data block.

Most disk systems have what is called an "index" hole or mark which is used to help the drive locate sector one quickly without having to read. The controller waits until the index is located and then it knows that sector 1 is under the R/W head.

Note that there are many variations of the above scheme but most follow this pattern to one degree or another.

answered Jan 14 at 12:48

jwh20jwh20

2,0401 gold badge7 silver badges14 bronze badges

TL;DR:

For the titular question:

A floppy drive doesn't identify anything at all (some may to track 0). For tracks it steps in or out as much as the controller tells. It also doesn't identify sectors but read the raw magnetic stream. it is the controller that looks for data blocks, picks headers thereof and acts according to whatever address is written there.

For the workings of the programs mentioned:

They simply read the floppy using OS calls to deliver one or more sectors within a track.

Some advanced (modern) can do more like low level reading and measure time to show real distribution.


How do both applications know the start of the first sector and the end of a the last sector of a floppy disk,

By simply reading it?

The shown programs work by reading logical sectors with the usual OS calls. They simply read each sector in ascending order, from 0 to max (as set by the OS) using the OS function to read a sector - the very same way as any other access does.

in order to accurately visualize it on an image (FDM) or progress-like bar (NDD)?

Reading is all done on a logical level and, except for the very last picture, they display only an assumed, logical structure, not a real distribution. These images are abstract representation of the data gathered to make reading easy, not really low level positional information.

When is the disk in the proper direction visualized, assuming sector 1 starts at position twelve-o'clock on the left visualization and on 0% in the second visualization. Or more broadly how does a floppy drive (driver) identify the unique sectors?

Like it is always identified when reading, by it's header?

Also if I understand it correctly the formatting type determines the sector structure so in order to analyse and visualize the bad sectors, firstly the formatting type needs to be determined and understood in order to visualize?

No, it doesn't. At least not for those basic graphics.

Format information is provided by the OS. Neither of the programs bypasses the OS when reading. It's just the high level information presented in a nice circle or sequence of blocks.


Now, of course it's possible to do a more in depth analysis by using direct, low level hardware access. Programms doing so will need their own floppy drivers on modern OS (*1), while on classic DOS they would simply operate FDC and timer direct. This would start by direct reading a track. Either using a read track command and analyse the data stream delivered by the FDC or reading each sector of a track while measuring access time.

Positioning of sectors relative to each other can be calculated from the read data when reading track, or from a timer counting. Relative positioning between tracks can as well be based thereon, as disk rotational speed is constant. At least as long as the drive doesn't stop inbetween :))

Of course it may be useful to determinate the exact speed an individual drive is running at first. This can easy be done by reading the same sector (like the first one) twice and measuring the waiting time between these two reads - better to do that a few times to get a more reliable measurement.

By measuring each access time for each sector on each track a nice picture of the real distribution can be drawn - unlike the abstract ones offered by NDD or FDM.


*1 - Some information could be gathered without a dedicated driver by timing based guessing ... err ... statistics, but this depends quite a lot on OS behaviour.

answered Jan 14 at 15:19

Tracks and sectors in floppy disk

RaffzahnRaffzahn

181k20 gold badges507 silver badges744 bronze badges

3

How do both applications know the start of the first sector and the end of a the last sector of a floppy disk, in order to accurately visualize it on an image (FDM) ...

Having a look at the screen shot from the website of the manufacturer, I doubt that this is an accurate visualization of the floppy:

A real floppy disk track begins with some empty space, then the sectors (each one consisting of the address field, data and empty space) follow and at the end of the track there is more empty space.

The screen shot however shows 18 sectors that cover 1/18 of the full circle - this means that there is no empty space on the visualization.

I assume that the program is assuming that a floppy disk with N sectors per track contains sectors 1, 2, ... N in each track. And it assumes that the sectors are stored in that order.

The floppy disk format (e.g. 1.44 MB) is stored in the first sector of a disk and it is known that a 1.44 MB disk has 80 sectors per side and 18 sectors per track.

However, the sectors can be stored in a different order (e.g. 1, 10, 2, 11, 3, 12 ... 9, 18) or even use completely "odd" sector numbers (e.g. 53, 35, 39, 120, 97, 87, ...). I assume that the program would not visualize such disks correctly at all.

... or progress-like bar (NDD)?

If you are talking about screen shot #3:

This is a linear visualization of sectors:

This kind of visualization is not "accurate" at all but it simply displays all sectors accessed by the operating system in the order in which they are accessed by the operating system (DOS or Windows).

If you modify a 1.44 MB (2880 sectors) floppy in a way that the OS treats it as 720 KB (1440 sectors) floppy, the program will probably only show 1440 of 2880 sectors.

answered Jan 15 at 9:26

Martin RosenauMartin Rosenau

3,2743 gold badges10 silver badges22 bronze badges

Sectors are nothing new

Computers had them with magnetic tape.

A "sector header" was a quasi-unique pattern that shouldn't occur anywhere else in data.*

So the drive simply waited until a sector header appeared, then read the sector in the normal manner. The sector header included the sector number. If it wasn't the sector desired, then go back to waiting.

Like I say, this is nothing new; it'd been done for years with magnetic tape.



* What keeps someone from writing data with a sector header in the data pattern? A reality of magnetic media's difficulty recording long strings of hard zeroes or hard ones. You were already adding more bits to the data stream to assure all write patterns had an appropriately mixed 0-1 pattern. So for instance an 8-bit byte might actually write as 10 media bits - so 00000000 might map to 0011010010 to assure there were enough 0-1 transitions in the data for it to record reliably. Thus, mappings could be chosen to exclude certain combinations reserved for sector headers.

Tracks are "Go to zero, then use dead reckoning"

The heads are positioned off a gear or worm drive operated by a stepper motor. The stepper motor is electronically controlled to a precise rotation angle.

It's pretty simple: if your density is 96 tracks per inch, then use a threaded worm drive with 96 threads per inch. Have the stepper motor do one complete revolution to move 1 track over. As long as the stepper motor stops at 0 degrees, and this is easy to ascertain/hold with a stepper motor, it should be right on-track.

By comparison, a typical screw from an electrical junction box is 32 threads per inch.

Obviously there were refinements to this, such as using 48- or 24-thread-per-inch and stopping the motor every 180 or 90 degrees. The trade-off being precision vs speed. Or moving away from steppers altogether.

Drives generally used "dead reckoning" to know where they were. If they were on track 24 and made 3 inward steps, they must necessarily be on track 21.

However at some point (always: startup), the drive will not be sure about its position. In this case, it ran the head inward, until it reached track zero. There was a mechanical limit switch that would close when the head reached track zero.

Some cheaper drives did not even have a limit switch, and simply rammed the head repeatedly against the mechanical track zero stop. These drives were particularly noisy in their "seeking to zero" on startup and when they encountered a bad sector!

answered Jan 16 at 23:48

1

The Apple ][ had "non-sectored" floppy disks (the disk itself has no mark for start of sectors), all other microcomputers of the aera used "sectored" floppies. What was written on disk was a sector preamble, a sector identification and then the sector data, followed by a trailer.

Some software I don't remember the name to allowed using "large floppies" by writing out extra-large sectors (less space wasted on headers/trailers). That required frobbing the operating system (fittingly called DOS). Wasn't too popular. Some "copy protection" schemes also used weird sector layouts to make floppies "uncopiable".

answered Feb 3 at 1:22

vonbrandvonbrand

2372 silver badges6 bronze badges

What is track in floppy disk?

Floppy disks are read and written by a floppy disk drive (FDD). A disk drive track is a circular path on the surface of a disk or diskette on which information is magnetically recorded and from which recorded information is read. Tracks are subdivided into blocks.

Where is data recorded in a floppy disk sector runs tracks?

The surface of a floppy disk organized into circular rings called tracks. Data is stored on these circular tracks as tiny spots.

What is the first sector on a floppy disk?

On a floppy disk, the boot sector is the first sector on the disk: all floppy disks contain a boot sector, even if they are just data disks.

What does a floppy disk contains?

A floppy disk contains circular tracks and sectors.