Difference between revisions of "Track Dump Format"

From Ninerpedia
Jump to navigation Jump to search
Line 10: Line 10:
The track data depend on the recording technology, which is either FM or MFM.  
The track data depend on the recording technology, which is either FM or MFM.  


== FM track image ==
== Standard formats ==
 
=== FM track image ===


{| style="width:50%; text-align:center"
{| style="width:50%; text-align:center"
|-
|-
| colspan="2" style="border: 1px solid black; padding:0.2ex" | Track lead-in: 0x00 (16)
| colspan="2" style="border: 1px solid black; padding:0.2ex" | Gap 1: 0x00 (16)
|-
|-
| rowspan="13" style="background-color:#eeeeee; width:20%" | repeat for each sector
| rowspan="13" style="background-color:#eeeeee; width:20%" | repeat for each sector (9x)
| style="border: 1px solid black; padding:0.2ex" | Pre-ID gap: 0000 0000 0000
| style="border: 1px solid black; padding:0.2ex" | Sync: 0x00 (6)
|-
|-
| style="border: 1px solid black; padding:0.2ex" | ID Address Mark (IDAM): 0xFE (1)
| style="border: 1px solid black; padding:0.2ex" | ID Address Mark (IDAM): 0xFE (1)
Line 31: Line 33:
| style="border: 1px solid black; padding:0.2ex" | CRC: always 0xF7F7
| style="border: 1px solid black; padding:0.2ex" | CRC: always 0xF7F7
|-
|-
| style="border: 1px solid black; padding:0.2ex" | 0xFF (11)
| style="border: 1px solid black; padding:0.2ex" | Gap 2: 0xFF (11)
|-
|-
| style="border: 1px solid black; padding:0.2ex" | 0000 0000 0000
| style="border: 1px solid black; padding:0.2ex" | Sync: 0x00 (6)
|-
|-
| style="border: 1px solid black; padding:0.2ex" | Data Address Mark (DAM): 0xFB
| style="border: 1px solid black; padding:0.2ex" | Data Address Mark (DAM): 0xFB
Line 41: Line 43:
| style="border: 1px solid black; padding:0.2ex" | CRC: always 0xF7F7
| style="border: 1px solid black; padding:0.2ex" | CRC: always 0xF7F7
|-
|-
| style="border: 1px solid black; padding:0.2ex" | FF (45)
| style="border: 1px solid black; padding:0.2ex" | Gap 3: FF (45)
|-
|-
| colspan="2" style="border: 1px solid black; padding:0.2ex" | Track lead-out: 0xFF (231)
| colspan="2" style="border: 1px solid black; padding:0.2ex" | Gap 4: 0xFF (231)
|}
|}


Line 51: Line 53:
  imagelen = 2*40*tracklen = 260240
  imagelen = 2*40*tracklen = 260240


== MFM track image ==
=== MFM track image (18 sectors) ===


{| style="width:50%; text-align:center"
{| style="width:50%; text-align:center"
|-
|-
| colspan="2" style="border: 1px solid black; padding:0.2ex" | Track lead-in: 0x4E (40)
| colspan="2" style="border: 1px solid black; padding:0.2ex" | Gap 1: 0x4E (40)
|-
|-
| rowspan="15" style="background-color:#eeeeee; width:20%" | repeat for each sector
| rowspan="15" style="background-color:#eeeeee; width:20%" | repeat for each sector (18x)
| style="border: 1px solid black; padding:0.2ex" | Pre-ID gap: 0000 0000 0000 0000 0000
| style="border: 1px solid black; padding:0.2ex" | Sync: 0x00 (10)
|-
|-
| style="border: 1px solid black; padding:0.2ex" | 0xA1A1A1
| style="border: 1px solid black; padding:0.2ex" | 0xA1A1A1
Line 74: Line 76:
| style="border: 1px solid black; padding:0.2ex" | CRC: always 0xF7F7
| style="border: 1px solid black; padding:0.2ex" | CRC: always 0xF7F7
|-
|-
| style="border: 1px solid black; padding:0.2ex" | 0x4E (22)
| style="border: 1px solid black; padding:0.2ex" | Gap 2: 0x4E (22)
|-
|-
| style="border: 1px solid black; padding:0.2ex" | 0x00 (12)
| style="border: 1px solid black; padding:0.2ex" | Sync: 0x00 (12)
|-
|-
| style="border: 1px solid black; padding:0.2ex" | 0xA1A1A1
| style="border: 1px solid black; padding:0.2ex" | 0xA1A1A1
Line 86: Line 88:
| style="border: 1px solid black; padding:0.2ex" | CRC: always 0xF7F7
| style="border: 1px solid black; padding:0.2ex" | CRC: always 0xF7F7
|-
|-
| style="border: 1px solid black; padding:0.2ex" | 0x4E (24)
| style="border: 1px solid black; padding:0.2ex" | Gap 3: 0x4E (24)
|-
|-
| colspan="2" style="border: 1px solid black; padding:0.2ex" | Track lead-out: 0x4E (712)
| colspan="2" style="border: 1px solid black; padding:0.2ex" | Gap 4: 0x4E (712)
|}
|}


Line 96: Line 98:
  imagelen = 2*40*tracklen = 549760
  imagelen = 2*40*tracklen = 549760


== Interleave ==
=== Interleave ===


If sectors were stored in rising sequence, a single revolution of the disk would be enough to read in all sectors of the track. This requires a data rate which cannot be maintained by most systems. Therefore, sectors are put on the track with a constant interleave between. By this technique, reading all sectors of a track requires 2, 3, 4 or more revolutions.  
If sectors were stored in rising sequence, a single revolution of the disk would be enough to read in all sectors of the track. This requires a data rate which cannot be maintained by most systems. Therefore, sectors are put on the track with a constant interleave between. By this technique, reading all sectors of a track requires 2, 3, 4 or more revolutions.  
Line 227: Line 229:
This offset is not mandatory, so it should not be assumed as fixed. Neither is it mandatory that the interleave is 4:1 in all cases. DSDD images, for instance, do not show this offset.
This offset is not mandatory, so it should not be assumed as fixed. Neither is it mandatory that the interleave is 4:1 in all cases. DSDD images, for instance, do not show this offset.


=== Special format: 16 sectors ===
== Special format ==
 
=== MFM track image (16 sectors) ===


This format is used with the TI double density controller and the HX5102, the Hexbus floppy drive (no skew).
This format is used with the TI double density controller and the HX5102, the Hexbus floppy drive (no skew).
{| style="width:50%; text-align:center"
|-
| colspan="2" style="border: 1px solid black; padding:0.2ex" | Gap 1: 0x4E (50)
|-
| rowspan="15" style="background-color:#eeeeee; width:20%" | repeat for each sector (16x)
| style="border: 1px solid black; padding:0.2ex" | Sync: 0x00 (12)
|-
| style="border: 1px solid black; padding:0.2ex" | 0xA1A1A1
|-
| style="border: 1px solid black; padding:0.2ex" | ID Address Mark (IDAM): 0xFE (1)
|-
| style="border: 1px solid black; padding:0.2ex" | Track
|-
| style="border: 1px solid black; padding:0.2ex" | Head
|-
| style="border: 1px solid black; padding:0.2ex" | Sector
|-
| style="border: 1px solid black; padding:0.2ex" | Size: 0x01
|-
| style="border: 1px solid black; padding:0.2ex" | CRC: always 0xF7F7
|-
| style="border: 1px solid black; padding:0.2ex" | Gap 2: 0x4E (22)
|-
| style="border: 1px solid black; padding:0.2ex" | Sync: 0x00 (12)
|-
| style="border: 1px solid black; padding:0.2ex" | 0xA1A1A1
|-
| style="border: 1px solid black; padding:0.2ex" | Data Address Mark (DAM): 0xFB
|-
| style="border: 1px solid black; padding:0.2ex" | Sector content (256)
|-
| style="border: 1px solid black; padding:0.2ex" | CRC: always 0xF7F7
|-
| style="border: 1px solid black; padding:0.2ex" | Gap 3: 0x4E (50)
|-
| colspan="2" style="border: 1px solid black; padding:0.2ex" | Gap 4: 0x4E (206)
|}
=== Interleave ===


{| style="width:72%; text-align:center"
{| style="width:72%; text-align:center"

Revision as of 20:06, 30 July 2018

The Track Dump Format is used in the PC99 emulator. It contains all data bytes from all disk tracks. Unlike the Sector Dump Format, this format stores the tracks "twice ascending", that is,

  • the first half of the image contains tracks 0 to 39 of side one
  • the next track is track 0 on side two, increasing to track 39 of side two.

So it counts up for each side. Thus, the track sequence of side two is reversed to the access direction of the real medium.

The format, as defined by PC99, is not a precise track image: We do not get clock patterns, so we cannot precisely know where the address marks are. Second, the Track Dump Format does not support CRC checking; the CRC bytes are always 0xF7.

The track data depend on the recording technology, which is either FM or MFM.

Standard formats

FM track image

Gap 1: 0x00 (16)
repeat for each sector (9x) Sync: 0x00 (6)
ID Address Mark (IDAM): 0xFE (1)
Track
Head
Sector
Size: 0x01
CRC: always 0xF7F7
Gap 2: 0xFF (11)
Sync: 0x00 (6)
Data Address Mark (DAM): 0xFB
Sector content (256)
CRC: always 0xF7F7
Gap 3: FF (45)
Gap 4: 0xFF (231)

The total length of a track and the length of a DSSD disk (180 KiB) thus calculates as

tracklen = 16 + 9*334 + 231 = 3253 bytes (9 sectors per track, single density)
imagelen = 2*40*tracklen = 260240

MFM track image (18 sectors)

Gap 1: 0x4E (40)
repeat for each sector (18x) Sync: 0x00 (10)
0xA1A1A1
ID Address Mark (IDAM): 0xFE (1)
Track
Head
Sector
Size: 0x01
CRC: always 0xF7F7
Gap 2: 0x4E (22)
Sync: 0x00 (12)
0xA1A1A1
Data Address Mark (DAM): 0xFB
Sector content (256)
CRC: always 0xF7F7
Gap 3: 0x4E (24)
Gap 4: 0x4E (712)

For a typical DSDD disk (360 KiB), we get

tracklen = 40 + 18*340 + 712 = 6872 bytes (18 sectors per track, double density)
imagelen = 2*40*tracklen = 549760

Interleave

If sectors were stored in rising sequence, a single revolution of the disk would be enough to read in all sectors of the track. This requires a data rate which cannot be maintained by most systems. Therefore, sectors are put on the track with a constant interleave between. By this technique, reading all sectors of a track requires 2, 3, 4 or more revolutions.

The interleave used for 9-sectors tracks may look like this:

0 7 5 3 1 8 6 4 2


and like this on a track with 18 sectors:

0 11 4 15 8 1 12 5 16 9 2 13 6 17 10 3 14 7

When the head moves to the next track, the disk keeps rotating, so it would be better to use an offset to catch the next sector. In the track dump format, we indeed have a shift in sector numbers which looks as follows:

Track 0 0 7 5 3 1 8 6 4 2
Track 1 6 4 2 0 7 5 3 1 8
Track 2 3 1 8 6 4 2 0 7 5
Track 3 0 7 5 3 1 8 6 4 2
Track 4 6 4 2 0 7 5 3 1 8
Track 2 3 1 8 6 4 2 0 7 5
...
Track 39 0 7 5 3 1 8 6 4 2

This offset is not mandatory, so it should not be assumed as fixed. Neither is it mandatory that the interleave is 4:1 in all cases. DSDD images, for instance, do not show this offset.

Special format

MFM track image (16 sectors)

This format is used with the TI double density controller and the HX5102, the Hexbus floppy drive (no skew).

Gap 1: 0x4E (50)
repeat for each sector (16x) Sync: 0x00 (12)
0xA1A1A1
ID Address Mark (IDAM): 0xFE (1)
Track
Head
Sector
Size: 0x01
CRC: always 0xF7F7
Gap 2: 0x4E (22)
Sync: 0x00 (12)
0xA1A1A1
Data Address Mark (DAM): 0xFB
Sector content (256)
CRC: always 0xF7F7
Gap 3: 0x4E (50)
Gap 4: 0x4E (206)

Interleave

0 9 2 11 4 13 6 15 8 1 10 3 12 5 14 7