Duggan HDFS Filesystem Structure ================================ http://mdfs.net/Docs/Comp/Disk/Format/HDFS HDFS uses 256-byte logical disk sectors. Logical sectors are counted with 10-bit or 11-bit numbers starting from &000 at the start of the filesystem. Acorn DFSs use 18-bit file lengths and 10-bit sector numbers, so the largest possible DFS disk system is 256K and the largest possible file is 256K-1. HDFS use 19-bit file lengths and 11-bit sector numbers, so the largest possible HDFS disk system is 512K and the largest possible file is 512K-1. Note that Watford DFS also extends the DFS catalog structure, but puts its additional information in different locations. DFS, WDFS and HDFS directories can be distinguished by looking at byte &106 in the catalog: 106: b3=0 b2=0 DFS or WDFS disk up to 256K 106: b3=0 b2=1 WDFS, disk larger than 256K, usually double-density 106: b3=1 b2=0 HDFS, single-sided disk 106: b3=1 b2=1 HDFS, double-sided disk Sector 0,1 ---------- The first two sectors contain the 31-entry DFS/HDFS catalog. The catalog is always stored sorted by file sector start address, with highest sector address at the start and lowest address at the end. 000-007 First eight bytes of the disk title byte 0,b7: Total number of sectors b10 (HDFS) 008-00F First file entry 010-017 Second file entry 018-01F Third file entry ... 0F8-0FF 31st file entry A file entry is laid out as: byte 0-6 Filename, padded with spaces byte 7 Directory byte 0,b7: start sector b10 (HDFS) byte 1,b7: length b18 (HDFS) byte 2,b7: unused (HDFS) byte 3,b7: entry is subdirectory (HDFS) byte 4,b7: not readable (HDFS) byte 5,b7: not writable (HDFS) byte 6,b7: not executable (HDFS) byte 7,b7: file locked 100-103 Last four bytes of disk title 104 Disk cycle number 105 (Number of catalogue entries)*8 106 b6-b7: Unused, set to zero b4-b5: !Boot option (*OPT 4 value) b3: DFS: 0 HDFS: 1 b2: DFS: unused HDFS: (number of sides)-1 b0-b1: Total number of sectors b8-b9 107 Total number of sectors b0-b7 108-10F First file's info 110-117 Second file's info ... 1F8-1FF 31st file's info A file info entry is laid out as: byte 0-1 file load address b0-b15 byte 2-3 file execution address b0-b15 byte 4-5 file length b0-b15 byte 6 b6-b7: file execution address b16-b17 b4-b5: file length b16-b17 b2-b3: file load address b16-b17 b0-b1: file start sector b8-b9 byte 7 file start sector b0-b7