CP-M File System

CP/M was the dominant 8-bit microcomputer operating system (1974), and its disk format holds no parameters on disk, so the geometry must be known. It is found on Kaypro, Osborne, Amstrad PCW and similar floppies, and in retro-computing and business-data recovery.

Overview

CP/M stores no parameters on disk. A directory of 32-byte entries (user number, name, extent, record count and allocation block numbers) sits after the reserved system tracks. Block size, sector skew, directory size and pointer width differ per machine, so the implementation selects them from a table of known disk definitions. Deleted entries are marked 0xE5.

History

  • Created by Gary Kildall at Digital Research (1974).
  • CP/M 2.2 appeared in 1979 and CP/M 3 in 1983.

Structures

Offsets are in bytes from the start of the structure named in each heading. Field names are descriptive and are not an official specification. Fixed-width integers are shown as u/i (unsigned/signed) followed by bit width and byte order.

Cpm File System

OffsetSizeTypeFieldNotes
0x18bytesLabel
0x93bytesLabel
0xC1u8Label Flags

Group Files

OffsetSizeTypeFieldNotes
0x01u8Key
0x18bytesKey
0x93bytesKey
0xC1u8–
0xE1u8–

Stamp

OffsetSizeTypeFieldNotes
0x02u16 LEDays
0x21u8Hour
0x31u8Inute

Classify

OffsetSizeTypeFieldNotes
0x01u8User
0x111bytes–
0xC1u8–
0xE1u8–
0xF1u8–

Other fields read

Read inOffsetSizeTypeFieldNotes
Block Pointers(16 + 2 * i)2u16 LE–

Constants

Implementation limits

ClassNameValueNotes
Cpm DetectorMaxImageBytes2 * 1024 * 1024

Cpm Entry Kind

NameValue
Invalid(next)
Empty(next)
File(next)
Deleted(next)
Label(next)
Timestamps(next)
Structures and constants were extracted from the implementation. Prose sections are a summary from public sources; verify details before relying on them.