| Home CBM ASCII-X BASIC C128 D64plus Disk File Sector Escape Codes Hardware PCxface PETSCII Pet2asc Futurama IBM PC-AT Contact Games Glossary Hall of fame Hall of shame Miscellaneous Privacy policy Programming Twisty puzzles |
There are two main types of sectors ("blocks") in a CBM file system. Most common is a "GCR" sector (block)... these are used by 8580, 1540, 1541, 1570, 1571 (and compatibles). An alternative is an MFM sector which is used by some 1571/CPM formats and (technically) all 1581 sectors... (1581 physical sectors usually hold 2 logical CBM sectors)... In my terminology, a sector is a PHYSICAL part of a disk... the operating system may split/combine physical SECTOR(s) into a "block" (a logical concept). A block, in Commodore terms, always holds 256 bytes of data (typical 254 bytes of user data plus a 2-byte file link). But a sector, even if it holds a 256 byte block, actually contains way more than 256 bytes of "raw data". For example, the most common CBM encoding (GCR, see above) of a sector actually uses 260 * 5 / 4 = 325 bytes of "data" (plus more for a sector header). The 325 bytes are a special code (Group Code Recording = GCR) which adds some redundancy / synchronization / error detection for the hardware. Those 325 bytes translate into 260 "internal" bytes (in the following order):
The other way to encode a sector, MFM, is more dynamic than the simple 5/4 expansion of GCR. For details, see this Wikipedia article. GCR sectors always hold 256 bytes of file system data (a block), but MFM may hold one of: 128, 256, 512, or 1024 bytes. For example 1581 and CMD disks store data in 512-byte sectors (in this case, a 256-byte block would need to be extracted from half a sector). Some CP/M disks (usable by 1571) use 128-byte sectors (in this case, a 256-byte block would need to be assembled from two sectors). © H2Obsession, 2015 |