DISKDEFS(5)

πŸ’Ύ DISKDEFS(5) β€” the diskdefs file, aka CP/M disk format tea πŸ’…

okay so bestie, welcome to diskdefs, the file format manual page from the CP/M tools girlies. This is the file that holds your CP/M format descriptions, and the reason it exists is lowkey tragic: CP/M in general does not store those in the file system, and there are no standards of any kind. Not one. It's giving chaos. 🫠 So we keep them in a text file like the icons we are. ✨


🌸 DESCRIPTION 🌸

The diskdefs file contains CP/M format descriptions. That's the whole vibe. πŸ’–

A diskdefs file consists of one or more entries shaped like this, and the way that it's shaped is literally non-negotiable:

diskdef name
  seclen size
  tracks count
  sectrk count
  blocksize size
  maxdir count
  [dirblks count]
  boottrk number
  [bootsec number]
  [skew number]
  [skewtab sector[,sector]...]
  [os 2.2|3|isx|p2dos|zsys]
  [offset size]
  [logicalextents count]
  [libdsk:format name]
end

See those square brackets? Those lines are the optional ones, the little accessories of the entry. πŸ‘‘ The rest are the fit that has to be exact.

⚠️ skew and skewtab must only be used exclusively. Pick one, bestie. Not both. It's giving "you can't sit with both tables at lunch". πŸ“

Comments are marked with a leading hash or semicolon and extend to the end of the line. So go ahead and annotate your life. # and ; are your journaling besties. πŸ“

It is possible to reserve space after the directory beyond maxdir using an inflated DPB ALV0. And if the format makes use of that, then dirblks must be set. No skipping it, no "I'll do it later". Set it. πŸ’…

bootsec contains the total number of sectors used by the boot area. This is for CP/M systems that map multiple logical tracks onto a physical track. And here's the tea: while raw disk images <em>can</em> be configured for doing the same, accessing libdsk images needs to be done by physical tracks. Physical. Tracks. Periodt. πŸ’€


πŸ” SEE ALSO πŸ”

  • cpm(5) β€” your other bestie, go read her too πŸ¦‹

and that's the whole page, bestie!! 🌈 This one's from CP/M tools, dated November 2, 2022 β€” shoutout to the date stamp for keeping it iconic. ✨ Go define some disks. Slay. πŸŽ€πŸ’–