Introduction
A D81 file is a copy of a 3.5-inch disk for the Commodore 1581 drive, used with the Commodore 64 and 128. It keeps the sector model of the D64 (256-byte sectors addressed by track and sector, directory entries of 32 bytes, files as chains of linked sectors) on a very different geometry: 80 tracks of 40 sectors each, and a header and BAM on track 40.
A standard image is 819,200 bytes (3,200 sectors); with one error byte per sector it is 822,400 bytes.
Structure
Every track has 40 sectors, so track t starts at (t − 1) × 0x2800. Track 40, in the middle, holds the
header (sector 0), two BAM sectors (1 and 2) and the directory from sector 3. See
Layout, BAM and directory.
0Tracks 1 to 39 40 sectors each399,360 bytes399360Track 40 the header, the BAM (two sectors), then the directory10,240 bytes409600Tracks 41 to 80 40 sectors each409,600 bytes819200Error bytes optional, one a sector3,200 bytes
Sizes
| Tracks | Sectors | Bytes | With error bytes |
|---|---|---|---|
| 80 | 3,200 | 819,200 | 822,400 |
In the explorer
Drop a .d81 file on the explorer to see:
- the tree: every track, and in it every sector named for what it is (header, BAM, directory sector, sector n of a file, free, orphan, shared) with its error byte; the header and the two BAM sectors show their fields and one entry a track, the directory entries show theirs;
- a picture of the disk, the directory, a table of the tracks and a table of all the sectors;
- every file to open: a PRG in the .PRG viewer, a SEQ file as text from PETSCII, any other as bytes; a CBM partition entry (type 5) is listed but its sectors are not followed;
- the problems found, listed, with the disk still opening.
The options bar sets whether error bytes follow the sectors (detected from the size) and the character set for names and text.
Not described
Known, not yet covered
- Reference: sub-directories (CBM partitions): the rule for what counts as one is given on the layout page, but the contents of a partition (its own header and BAM) are not described, and the viewer does not open them.
- Reference: REL files (side sectors and the 1581’s super side sector), the auto-boot loader’s file format (“COPYRIGHT CBM 86”), GEOS border and ID bytes of the header.
- Viewer: graphics characters in names and text are mostly shown as U+FFFD (the same limit as D64).
Unknown
- Viewer: no real D81 image is on this Mac and none was found to download, so the reading is checked on built images only, against the geometry printed in the VICE manual.
Links
Software
- VICE – Commodore emulator; its c1541 tool edits D81 files (Windows, macOS, Linux)
Reference
- VICE manual, chapter 17 – the D81 section is the main source of these pages (read through a summarising fetch, so the numbers are “our words”)
- Peter Schepers, Commodore disk image formats (unusedino.de) – the notes the manual builds on; not reachable on the day these pages were written