Format on Disk - Nakazoto/CenturionComputer GitHub Wiki

Format on Disk

A page about the formatting used on disk.

Format on Hawk Drive

Words.

Format on Floppy Drive

CPU6 systems with an FFC card use 8" double-density floppy drives. Both single-sided and double-sided disks are supported with 76 and 152 tracks respectively. Tracks are MFM encoded and soft-sectored with up to 20 sectors per track.

Sector format

+------+---------+----------+------------+-----+-----+-------------+------+----------+
| Sync | Track # | Sector # | Header CRC | Gap | Key | Data Length | Data | Data CRC |
+------+---------+----------+------------+-----+-----+-------------+------+----------+
  • Sync (32 bitcells)

    Flux bitstream 1001 0001 0010 _00_10 0100 0100 10_00_ 1001. MFM decodes as 0x50A1 but with 2 invalid sequences (highlighted with underscores). Since normal data will not generate these invalid sequences, these are used to unambiguously detect the start of a sector.

  • Track # (8-bit, unsigned integer)

    Track numbers start at 0 with the outermost track and increase inward toward the spindle.

  • Sector # (8-bit, unsigned integer)

    Sector numbers start at 0 with the first sector after the index mark. Sectors are numbered assuming a 400 byte sector size which results in 20 sectors per track. If larger sectors are used, sector numbers are skipped for the 400 byte sectors that would otherwise occupy the same space in the track.

  • Header CRC (16-bit, big-endian, CCITT/XMODEM CRC)

    Computed over Track # and Sector #. Sync is not included in the CRC.

  • Gap (at least 432 bitcells)

    Long series of MFM-encoded zeros followed by a MFM-encoded one. Since this gap provides a safe area for a write splice to occur, stray bits may be encountered which may cause a naive decoder to prematurely detect the end of the gap. Early experiments have found that skipping the first 400 bitcells after the Header CRC is sufficient to ignore the write splice area and allow the end of the gap to be detected.

  • Key (1 byte)

    Based on reverse engineering of FFC microcode, this appears to specify a decryption key to be used for the sector data. Error codes exist to report both a bad key length as well as a bad key. So far, only 0x00 has been observed which indicates that the sector data is stored unencrypted.

  • Data Length (16-bit, big-endian, unsigned integer)

    Specifies the number of bytes that immediately follows. Only 400 and 4095 have been observed though the format appears to allow any value from 0 to 65535.

  • Data

  • Data CRC (16-bit, big-endian, CCITT/XMODEM CRC)

    Computed over Key, Data Length, and Data.

Format on Finch Drive

Future words.

#Format on Phoenix Drive More future words.