The catalogue of a DFS disc is its first two sectors, 512 bytes. Sector 0 holds the names, sector 1 everything else about the disc and the files. The same file is in the same place in both: entry n of sector 0 is the name of entry n of sector 1. Numbers of two bytes are little-endian. The bytes below were read on twelve real disc images (the BeebEm disc folder and three discs of an assembly-language book) and on built images; all twelve say 800 sectors, so a 40-track catalogue (400 sectors) is only seen on built images.
Sector 0: the names
| Bytes | Meaning |
|---|---|
| 0–7 | The first 8 characters of the disc title (padded with spaces or $00) |
| 8–255 | 31 entries of 8 bytes: bytes 0–6 the file name, 7 characters padded with spaces; byte 7 the directory character ($ by default) with bit 7 the locked flag |
The directory character stands in for directories: a file A.PROG is the file PROG in directory
A. DFS has no sub-directories; it is just a letter before the name, and *DIR chooses the one that
is listed.
Sector 1: the disc and the files
| Bytes | Meaning |
|---|---|
| 0–3 | The last 4 characters of the disc title: the title is 12 characters in all |
| 4 | The cycle number, in BCD: it goes up by one each time the catalogue is rewritten |
| 5 | Number of entries times 8: 0 to 248 (31 files) |
| 6 | Bits 0–1: bits 8 and 9 of the number of sectors on the disc. Bits 4–5: the boot option set by *OPT 4: 0 nothing, 1 *LOAD $.!BOOT, 2 *RUN $.!BOOT, 3 *EXEC $.!BOOT (the file is run when the disc is booted with Shift and Break) |
| 7 | The low 8 bits of the number of sectors: 400 for 40 tracks, 800 for 80 |
| 8–255 | 31 entries of 8 bytes, the same files in the same order as sector 0, see below |
A file entry (8 bytes in sector 1)
| Byte | Meaning |
|---|---|
| 0–1 | Load address, bits 0–15 |
| 2–3 | Execution address, bits 0–15 |
| 4–5 | Length in bytes, bits 0–15 |
| 6 | The high bits, two each: bits 0–1 bits 8–9 of the start sector; bits 2–3 bits 16–17 of the load address; bits 4–5 bits 16–17 of the length; bits 6–7 bits 16–17 of the execution address |
| 7 | Start sector, bits 0–7 |
A real example, the first file of the disc Assembly_Language_Programming_Exercises.ssd: the name entry is
45 78 39 2E 34 20 20 24 (Ex9.4 , directory $) and the file entry is
00 19 23 80 CD 05 CC 51. The load address is $1900, the execution address $8023, the
length $05CD (1,485 bytes) and the start sector $51 (81). Byte 6 is $CC:
bits 0–1 are 0 (start sector below 256), bits 2–3 are 3 (load address high bits), bits 4–5 are 0, bits 6–7 are 3 (execution
address high bits). With both high bits set an address is shown as &FFFF1900, which tools take to mean an
address in the host machine when a second processor is attached. Saved BASIC programs on these discs carry $8023 (some $801F) as their execution address,
an address in the paged ROM area where BASIC lives.
Order of the entries
The rule (BeebWiki, "Acorn DFS disc format", raw text read 2026-11-14): files must be listed in descending order of start sector with no gaps in the catalogue; an empty file is given start sector 2; files cannot be fragmented but free sectors may lie between them. On the real discs the entries run from the file at the highest sector down to the file at the lowest: the file written last is the first entry. The viewer lists the entries in the order it finds them and does not flag an order that breaks the rule.
Rules for a valid catalogue
From the same BeebWiki page (the DFS has no identification string or checksum, so this is how a catalogue is told from other data):
- the bits of the catalogue that are not used must be zero: in sector 1 byte 6, bits 2, 3, 6 and 7 (the disc size is a 10-bit field, the low 8 bits in byte 7 and bits 8 and 9 in bits 0 and 1 of byte 6);
- the file count byte is a multiple of 8, at most 31 × 8; the disc size is between 2 and 800 sectors (the format allows 1023);
- the disc title is printable ASCII padded with NULs or spaces (Acorn DFS 1.00 and 1.20 pad with spaces on
*TITLE; 0.90, 0.98, 2.00 and later with NULs; either is correct); - a file name is one to seven printable characters from &20 to &7E except
. : " # *and the space, padded with spaces; the directory character is one such character; name plus directory must be unique; - a start sector below 2 is invalid (it would overlap the catalogue) and must be below the disc size; skipping zero-length files the start sectors strictly descend, no file overlaps the one before it in the catalogue (start2 + ⌈length2 / 256⌉ ≤ start1) and none overshoots the disc (start + ⌈length / 256⌉ ≤ disc size);
- a load or execution address with both bits 16 and 17 set refers to the I/O processor, and OSFILE returns it ORed with &FFFF0000; otherwise it is a second processor address and is returned as it is (in practice the bits are sometimes found clear when they should be set); a file not meant for loading (sequential or text) should have all 18 bits set;
- the format is single sided, single density, 40 or 80 tracks of ten 256-byte sectors numbered 0 to 9, with a track skew of 3 on the disc itself (a floppy detail not present in an image).
The viewer's own checks are listed below. It does not check the unused bits, the character set of names (names with a
. in them are common: see below), unique names, descending order, or a start sector at or beyond the disc size
except through the disc-size check on the file's last sector.
On the fourteen real catalogues that read as DFS (227 file entries) this was checked against an independent reader written from the BeebWiki text:
the unused bits are zero and the order is descending on every one, and two differences from the rules were seen:
the three book discs Assembly_Language_Programming_*.ssd have file names with a . in them
(Ex9.4, Li7.8), which the rule forbids, and econet_level_1_utils.ssd has one name and
directory twice (FS). Real tools evidently write such discs, so the viewer is deliberately lenient.
Watford DFS and other variants
Watford 62 DFS places a second catalogue in sectors 2 and 3 of track 0, allowing 62 files on one volume. It marks the second
catalogue by setting its disc title to twelve $AA bytes (eight in sector 2, four in sector 3). To keep Acorn DFS from
corrupting such a disc the first catalogue carries a special entry (directory !, name !!!!!!!, length
&200, start sector 2) that protects the second. A disc whose first catalogue has a file starting before sector 4 other than
that entry is not a Watford disc. The viewer notices the eight $AA bytes and says so, but does not read the extra entries.
The two public descriptions of the second catalogue differ. BeebWiki says its disc title is twelve $AA bytes (as above).
Jonathan Harston’s Acorn, Watford, Solidisk and Duggan DFS Filesystem Structure (mdfs.net/Docs/Comp/Disk/Format/DFS, read raw 2026-11-19) gives the layout of
sectors 2 and 3 as: sector 2 bytes 0–7 eight bytes of $AA; sector 2 bytes 8–255 the 31 name entries; sector 3 bytes 0–4 five bytes of
$00; byte 5 (number of entries) × 8; bytes 6–7 a copy of the boot option and disc size in sector 1; bytes 8–255 the 31 file-information entries.
That document makes only the first eight bytes the marker, which is what the viewer tests. The 31 entries of the first catalogue and the 31 of the second make 62.
The same BeebWiki page describes three variants the viewer does not read: Acorn System DFS (every entry in directory " ", no cycle number, and no bits 16 and 17 of the addresses, which are reserved and cleared); Opus DDOS (double density, one to eight volumes with their own DFS-style catalogues on track 0 and a partition offset added to start sectors; the disc size is an 11-bit value and, only when its top bit, bit 2 of sector 1 byte 6, is set, the file length takes bit 6 and the start sector bit 2 of the extra byte of each entry); and Watford DDFS (double density, 19-bit file lengths and 11-bit start sectors, the extra bits stored in the top bits of the disc title and the file names, which Acorn DFS keeps clear). The wiki's own description of the last two is brief and is a summary of other documents.
Other DFS catalogues (Watford, Solidisk, HDFS, Disk Doctor)
All from the mdfs.net document named above, which says that Acorn System/Atom DOS, Acorn DFS, Watford DFS, Solidisk DFS and Angus Duggan’s HDFS share one file structure and each understands a large subset of the others. The Solidisk part “has been worked out from Andrew Benham’s FUSE DFS module … in the absence of any extant documentation, and may be incorrect” (the document’s own words).
- Sizes. Single-density discs have 10 sectors of 256 bytes a track, double-density ones 18 (numbered 0 to 17); tracks are sequential up one side. Acorn DFS uses 18-bit lengths and 10-bit sector numbers (at most a 256 KB disc and a file of 256 KB − 1); Watford DFS, Solidisk DFS and HDFS use 19-bit lengths and 11-bit sector numbers (512 KB).
- Telling them apart. By byte 6 of sector 1: bits 3 and 2 = 0 0 is DFS or WDFS up to 256 KB; 0 1 is WDFS larger than 256 KB; 1 0 is HDFS single-sided; 1 1 is HDFS double-sided. (For Acorn DFS bit 3 is unused and must be 0, as above; bit 2 is the disc-size bit 10 of the larger formats.) The other bits of that byte: bits 7–6 zero, bits 5–4 the boot option, bits 1–0 the disc-size bits 9–8. In HDFS the disc-size bit 10 is in bit 7 of sector 0 byte 0, the “disc title” is the directory name, and the cycle byte is a key number.
- File attribute bits (bit 7 of the seven name bytes and the directory byte): byte 7 is always the locked flag. In WDFS, byte 5 is bit 18 of the file length and byte 6 is bit 10 of the start sector. In HDFS byte 0 is bit 10 of the start sector, byte 1 bit 18 of the length, byte 2 unused, byte 3 file or directory, byte 4 not readable, byte 5 not writable, byte 6 not executable. Solidisk DDFS uses bit 2 of sector 1 byte 14+n for bit 10 of the start sector, bit 3 for bit 18 of the length, and (SDDFS) bits 6–7 also for the load address bits 17–16.
- Early DFS versions let a user write titles or names with bit 7 set, which makes such entries look as if they had HDFS or WDFS attributes; most DFSs refuse such names.
- Disk Doctor second directory. A locked entry named
!.!!!!!!!is a second directory with the same layout as the first; the Disk Doctor*SWAPcommand swaps the two, and each directory has to refer to its own part of the disc. (BeebWiki describes the matching protecting entry in the Watford case above.) HDFS subdirectories and DFS62 multiple catalogues use the same layout. - Heuristics BeebWiki lists for a catalogue that “looks real” (not rules): a size of 400 or 800 sectors; a file
$.!BOOT; the load and exec address bits 16 and 17 all clear or all set; few directories, most of them$; BASIC programs with load addresses of the form&3nn00(nn = 0E, 11, 19, 1B, 1D, 1F or 21) and exec&3801For&38023; screen dumps and code images with equal load and exec addresses; text and sequential data with load and exec0,&30000or&3FFFF; files mostly under 2 KB and none over 64 KB except text and data; few lowercase letters in names.
The viewer reads none of these extensions beyond noticing the Watford marker.
What the viewer checks
- the entry count byte is a multiple of 8 and at most 248;
- the number of sectors is at least 2 (and at most 800 for the viewer to take the file for DFS when it has no
.ssdor.dsdname); - every file starts at sector 2 or later and ends within the sectors the catalogue says the disc has;
- no two files share a sector;
- names are printable ASCII.
A disc that fails the first two checks has its entries left unread: they would only be noise.