rasz_pl wrote on 2023-09-09, 00:42:
MHDD cant remap anything on its own, it can only try and force the drive firmware to do it by repeatedly writing to a bad sector.
Is not a fact. On phantom.sannata they suggest that there is an ATA command 50h, 40h (Assign this sector to an alternate location).
Details
9.8 Format track
The implementation of the Format Track command is vendor specific. The
actions may be a physical reformatting of a track, initializing the data field
contents to some value, or doing nothing.
The Sector Count Register contains the number of sectors per track.
The track address is specified in the Cylinder High and Cylinder Low
Registers, and the number of sectors is specified in the Sector Count
Register. When the command is accepted, the drive sets the DRQ bit and waits
for the host to fill the sector buffer. When the sector buffer is full, the
drive clears DRQ, sets BSY and begins command execution.
The contents of the sector buffer shall not be written to the media, and may
be either ignored or interpreted as follows:
+=============-=============-=============-==========================+
|DD15 ---- DD0| |DD15 ---- DD0| |
|-------------| |-------------+--------------------------|
| First sector| | Last sector | Remainder of buffer |
| descriptor | : : : : : : | descriptor | filled with zeros |
+====================================================================+
One 16-bit word represents each sector, the words being contiguous from the
start of a sector. Any words remaining in the buffer after the representation
of the last sector are filled with zeros. DD15-8 contain the sector number.
If an interleave is specified, the words appear in the same sequence as they
appear on the track. DD7-0 contain a descriptor value defined as follows:
00h - Format sector as good;
20h - Unassign the alternate location for this sector;
40h - Assign this sector to an alternate location;
80h - Format sector as bad.
NOTES
9 - Some users of the ATA drive expect the operating system partition table to
be erased on a Format command. It is recommended that a drive which does not
perform a physical format of the track, write a data pattern of all zeros to the
sectors which have been specified by the Format Track command.
10 - It is recommended that implementors resassign data blocks which show
repeated errors.
rasz_pl wrote on 2023-09-09, 00:42:
You mean the other way around, why format ignores bad flag?
It seems that they have already figured out that he does not ignore him, but at the same time makes many attempts to “recover” the sector.
rasz_pl wrote on 2023-09-09, 00:42:
DOS 'Format track and set bad sector flag' https://stanislavs.org/helppc/int_13-6.html that might be used here calls ATA command 45 'WRITE UNCORRECTABLE EXT'
No, this command appeared much later.
Most likely the command used is ATA_FORMAT_TRACK 50h, 80h (Format sector as bad)
Which forces the hard drive to put a mark in the sector id.
"The Sector ID data consists of the Cylinder, Head, and Sector Number fields, as well as a CRC field used to verify the ID data. Most controllers use bit 7 of the Head Number field to mark a sector as bad during a low- level format or surface analysis. This convention is not absolute, however. Some controllers use other methods to mark a bad sector, but usually the mark involves one of the ID fields."
And the error appears not UNC (10h), but BBK (0Ah).
Horun wrote on 2023-09-09, 01:12:
Wow rasz, you just made my head hurt 😒 So much detailed info !!
Do you want me to make your head hurt even more? 😀
On phantom.sannata I was told that an MFM disk can skip bad sectors (they won't be visible at all!)