This the multi-page printable view of this section.Click here to print.
Acorn DFS is a single sided, single density 40 or 80 track format. A double sided disc can hold two DFS volumes. Each track carries ten 256 byte sectors numbered from 0 to 9.
Each sector is given an ID at format time; the parameters of the ID, listed below, are used by the DFS and the floppy disc controller to address sectors.
All these parameters can potentially take any value between 0 and 255, and so confuse Acorn DFS and some non-standard controllers. Some copy protection schemes make use of this feature.
The catalog is located in sectors 0 & 1 on Track 0. It is capable of holding just 31 entries.
Formatting a disk on the real hardware only needs to write to these two sectors (via `*FORM40` or `*FORM80`) but a blank catalogue simply needs these two sectors blanked and the disk size field initialised.
This is the structure of the catalogue header:
Byte | Track 0 Sector 0 | Track 0 Sector 1 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | ||
0 | First 8 characters of volume title padded with NULs or spaces | Last 4 characters of volume title padded with NULs or spaces | |||||||||||||||
1 | |||||||||||||||||
2 | |||||||||||||||||
3 | |||||||||||||||||
4 | BCD catalogue cycle number | ||||||||||||||||
5 | Number of files | ||||||||||||||||
6 | Boot Opts | Disk Type | 98 | ||||||||||||||
7 | 7 | Sectors in volume | 0 | ||||||||||||||
8 | File name padded with spaces | 7 | Load address | 0 | Last file | ||||||||||||
9 | 15 | 8 | |||||||||||||||
10 | 7 | Execution address | 0 | ||||||||||||||
11 | 15 | 8 | |||||||||||||||
12 | 7 | File length | 0 | ||||||||||||||
13 | 15 | 8 | |||||||||||||||
14 | 17 16 Exec | 17 16 | 17 16 Load | 9 8 | |||||||||||||
15 | Lk. | Directory | 7 | Start sector | 0 | ||||||||||||
16 | File name padded with spaces | 7 | Load address | 0 | Second to last file | ||||||||||||
17 | 15 | 8 | |||||||||||||||
18 | 7 | Execution address | 0 | ||||||||||||||
19 | 15 | 8 | |||||||||||||||
20 | 7 | File length | 0 | ||||||||||||||
21 | 15 | 8 | |||||||||||||||
22 | 17 16 Exec | 17 16 | 17 16 Load | 9 8 | |||||||||||||
23 | Lk. | Directory | 7 | Start sector | 0 | ||||||||||||
All unused bits must be kept clear.
Up to 12 printable ASCII characters, padded with NULs (&00) or spaces. The first eight characters are placed in sector 0 bytes 0 to 7, the last four characters in sector 1 bytes 0 to 3.
A binary-coded decimal (BCD) value where each hex nibble takes a value from 0 to 9. This starts at &00 and is incremented each time the catalogue is rewritten.
It provides a simple version control system and allows applications to confirm that their internal copies of the catalogue are up-to-date.
The number of files counter is stored in sector 1 byte 5 as bits 3…7.
Bits 0…2 are 0 making the entire byte the offset to the last valid entry in the catalog.
There may be up to 31 files on the disc.
Selects the action to be taken when the disc is booted. The field uses two bits of byte 6 in sector 1:
Bit 5 | Bit 4 | Action |
---|---|---|
0 | 0 | No action |
0 | 1 | *LOAD $.!BOOT |
1 | 0 | *RUN $.!BOOT |
1 | 1 | *EXEC $.!BOOT |
Unused in standard DFS, these two bits in byte 6 of sector 1 can be used to detect third party versions of DFS:
Bit 3 | Bit 2 | File System |
---|---|---|
0 | 0 | Acorn DFS or Watford DFS up to 256K |
0 | 1 | Watford DFS larger than 256K |
1 | 0 | Duggan HDFS, single sided disk |
1 | 1 | Duggan HDFS, double sided disk |
The total number of sectors on this side of the disc. This is a 10-bit field with the low 8 bits in sector 1 byte 7, and the others in the low two bits of sector 1 byte 6.
There is room for 31 file entries in the catalogue. Each entry takes up eight bytes in each of the two catalogue sectors.
Files must be listed in descending order of start sector with no gaps in the catalogue. Empty files should be given a start sector of 2. Files cannot be fragmented but there may be free sectors between files.
The rest of each sector represents the files. Each file is represented by a block of 8 bytes in each sector offset by 8. So the last file starts at offset 8, second to last at 16 & so on.
One to seven valid file name characters stored in sector 0 bytes 8 to 14.
Valid characters are the printable ASCII characters between &20 and &7E inclusive, except . : " # * and space.
The field is padded with spaces.
Bit 7 should always be clear but are used for other file systems as extra storage, either adding a bit to another field such as WDFS or file permissions as in HDFS.
When opening a file the DFS searches for it by name.
One valid file name character stored in the low 7 bits of sector 0 byte 15 Identifies the directory (namespace) to which the file belongs.
DFS directories are like those in ADFS, DOS or Linux except they cannot nest (they are all root directories) and they share the volume catalogue.
The combination of file name and directory must be unique in the volume.
If the top bit of the directory is set, then the file is locked and may not be altered or deleted.
An 18 bit address in memory where the file should be *LOADed by default. The low 8 bits are in sector 1 byte 8; the next 8 bits in sector 1 byte 9; the top two bits are in bits 2 and 3 of sector 1 byte 14.
If the file is not meant for *LOADing (e.g. a sequential file or text) all 18 bits should be set.
An 18 bit address in memory to be jumped to when the file is *RUN. This need not be within the bounds of the loaded file. The low 8 bits are in sector 1 byte 10; the next 8 bits in sector 1 byte 11; the top two bits are in bits 6 and 7 of sector 1 byte 14.
If the file is a sequential file or text then all 18 bits should be set.
An 18 bit value giving the number of bytes in the file.
The low 8 bits are in sector 1 byte 12; the next 8 bits in sector 1 byte 13; the top two bits are in bits 4 and 5 of sector 1 byte 14.
The 10 bit logical block address of the first sector that contains the file. The low 8 bits are in sector 1 byte 15; the top two bits are in bits 0 and 1 of sector 1 byte 14. The cylinder and record numbers are the result and remainder, respectively, when the LBA is divided by 10.
A start sector of 0 or 1 is invalid as the file would overlap the catalogue.
If bits 16 and 17 of the address are both set, the address refers to I/O processor memory and OSFILE will return the address ORed with &FFFF0000 in its parameter block.
Otherwise it is an address in second processor memory and OSFILE will return the address as is.
In practice the bits are sometimes found clear when they should be set.
Unlike its successor ADFS, the DFS format contains no self-identification strings or checksums, so recognising a disc or disc image as Acorn DFS is a complex and unreliable process.
If one has a floppy disc in hand it is often enough to confirm that the physical format is the same (see above) as Acorn DFS is the majority producer. On the other hand DFS disc image files are normally given the extension .ssd or .dsd, indicating a single or double sided disc image respectively.
Often the task is to identify which format variant a disc or image contains. This is more a matter of finding valid catalogues in the appropriate locations.
Any catalogue complying with the above is a valid DFS catalogue; however, only a tiny subset of these look like catalogues seen in real life. As an informal test a pair of sectors that match many of the following is more likely to be a catalogue:
This section is based loosely on the following:
Discs for the System series have an identical catalogue format to those for the BBC Micro, except all entries are in a directory " " (space), disks do not have a cycle number, and files do not have bits 16 and 17 of load and execution addresses.
The places they would occupy are reserved and must be cleared. A BASIC program named DCONV, on the Utility disc, performs this task.
The disk layout is identical to Acorn DFS with some differences shown below:
Byte | Track 0 Sector 0 | Track 0 Sector 1 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | ||
0 | First 8 characters of volume title padded with NULs or spaces | Last 4 characters of volume title padded with NULs or spaces | |||||||||||||||
1 | |||||||||||||||||
2 | |||||||||||||||||
3 | |||||||||||||||||
4 | Reserved | ||||||||||||||||
5 | Number of files | ||||||||||||||||
6 | Boot Opts | 98 | |||||||||||||||
7 | 7 | Sectors in volume | 0 | ||||||||||||||
8 | File name padded with spaces | 7 | Load address | 0 | Last file | ||||||||||||
9 | 15 | 8 | |||||||||||||||
10 | 7 | Execution address | 0 | ||||||||||||||
11 | 15 | 8 | |||||||||||||||
12 | 7 | File length | 0 | ||||||||||||||
13 | 15 | 8 | |||||||||||||||
14 | Reserved | 17 16 | Reserved | 9 8 | |||||||||||||
15 | Lk. | Ascii Space (0x20, 32) | 7 | Start sector | 0 | ||||||||||||
This section is based loosely on the following:
Angus Duggan's HDFS shares the same basic file structure as Acorn's DFS.
Sector 1 byte 6 bit 3 is set for HDFS with but 2 clear for single-sided and set for double-sided disks.
HDFS subdirectories follow the same format as the main catalogue.
This is the structure of the catalogue header:
Byte | Track 0 Sector 0 | Track 0 Sector 1 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | ||
0 | 10Sect | First 8 characters of volume title padded with NULs or spaces | Last 4 characters of volume title padded with NULs or spaces | ||||||||||||||
1 | |||||||||||||||||
2 | |||||||||||||||||
3 | |||||||||||||||||
4 | BCD catalogue cycle number | ||||||||||||||||
5 | Number of files | ||||||||||||||||
6 | Boot Opts | 1 | Sides | 98 | |||||||||||||
7 | 7 | Sectors in volume | 0 | ||||||||||||||
8 | 10Sect | File name padded with spaces | 7 | Load address | 0 | Last file | |||||||||||
9 | 18Len | 15 | 8 | ||||||||||||||
10 | 7 | Execution address | 0 | ||||||||||||||
11 | IsDir | 15 | 8 | ||||||||||||||
12 | Read | 7 | File length | 0 | |||||||||||||
13 | Write | 15 | 8 | ||||||||||||||
14 | Exec | 17 16 Exec | 17 16 | 17 16 Load | 9 8 | ||||||||||||
15 | Lk. | Directory | 7 | Start sector | 0 | ||||||||||||
16 | 10Sect | File name padded with spaces | 7 | Load address | 0 | Second to last file | |||||||||||
17 | 18Len | 15 | 8 | ||||||||||||||
18 | 7 | Execution address | 0 | ||||||||||||||
19 | IsDir | 15 | 8 | ||||||||||||||
20 | Read | 7 | File length | 0 | |||||||||||||
21 | Write | 15 | 8 | ||||||||||||||
22 | Exec | 17 16 Exec | 17 16 | 17 16 Load | 9 8 | ||||||||||||
23 | Lk. | Directory | 7 | Start sector | 0 | ||||||||||||
Sect
is bit 10 of the start sector.
Len
is bit 18 of the file length.
IsDir
defines if the entry is a file or a subdirectory.
Read
, Write
or Exec
attributes are set then the file can not be read,
written or executed respectively.
[Citation needed]
.
This section is based loosely on the following:
This is a double density format, but it is mentioned here as the volume catalogues are based on Acorn DFS.
DDOS discs are partitioned into between one and eight volumes. Track 0 is reserved for the DFS-style volume catalogues, plus a disc catalogue unique to DDOS.
In each volume catalogue:
This section is based loosely on the following:
Watford 62 DFS is identical to Watford DFS except it places a second catalogue in sectors 2 and 3 of track 0, allowing 62 files on one volume. To identify the second catalogue it sets its title to 12 × &AA bytes.
Without due care a system running Acorn DFS can corrupt a Watford disc as it is unaware of the
extra files.
On such a system the user may run a *SWAP
utility to exchange the catalogues.
In practice there is a special entry in the first catalogue (directory !, name !!!!!!!, length &200, start sector 2)
protecting the second one from being overwritten.
If any file in the first catalogue starts before sector 4, and it is not the special file, the disc is not a Watford DFS disc.
names, which are cleared in Acorn DFS.This section is based loosely on the following:
This is also a double density format with catalogues similar to Acorn DFS.
It uses 19 bit file lengths and 11 bit LBAs throughout, but the 'extra' bits are stored in the top bits of the disc title and file names, which are cleared in Acorn DFS.
This section is based loosely on the following:
The Watford DFS uses the same structure as Acorn's DFS with some additional attributes:
In byte 6 of Sector 1, bit 2 is clear and 3 is clear for Acorn & WDFS for disks up to 256K, but set for WDFS and disks larger than 256K.
Watford DFS use 19-bit file lengths and 11-bit sector numbers making the largest possible disk being 512K and the largest file size of 512K-1.
The disk layout is identical to Acorn DFS with some differences shown below:
Byte | Track 0 Sector 0 | Track 0 Sector 1 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | ||
0 | First 8 characters of volume title padded with NULs or spaces | Last 4 characters of volume title padded with NULs or spaces | |||||||||||||||
1 | |||||||||||||||||
2 | |||||||||||||||||
3 | |||||||||||||||||
4 | BCD catalogue cycle number | ||||||||||||||||
5 | Number of files | ||||||||||||||||
6 | Boot Opts | 0 | 108 | ||||||||||||||
7 | 7 | Sectors in volume | 0 | ||||||||||||||
8 | File name padded with spaces | 7 | Load address | 0 | Last file | ||||||||||||
9 | 15 | 8 | |||||||||||||||
10 | 7 | Execution address | 0 | ||||||||||||||
11 | 15 | 8 | |||||||||||||||
12 | 7 | File length | 0 | ||||||||||||||
13 | 18Len | 15 | 8 | ||||||||||||||
14 | 10Sect | 17 16 Exec | 17 16 | 17 16 Load | 9 8 | ||||||||||||
15 | Lk. | Directory | 7 | Start sector | 0 | ||||||||||||
16 | File name padded with spaces | 7 | Load address | 0 | Second to last file | ||||||||||||
17 | 15 | 8 | |||||||||||||||
18 | 7 | Execution address | 0 | ||||||||||||||
19 | 15 | 8 | |||||||||||||||
20 | 7 | File length | 0 | ||||||||||||||
21 | 18Len | 15 | 8 | ||||||||||||||
22 | 10Sect | 17 16 Exec | 17 16 | 17 16 Load | 9 8 | ||||||||||||
23 | Lk. | Directory | 7 | Start sector | 0 | ||||||||||||
This section is based loosely on the following: