Date : Thu, 22 Dec 2011 12:09:43 +0000
From : adsb@... (Andrew Benham)
Subject: ADFS directories - "reserved" bytes
On 21/12/11 14:42, Jules Richardson wrote:
> J.G.Harston wrote:
>> Jules Richardson wrote:
>>> one 'gotcha' that I found is that the following two references
>>> claim that byte 0x4ff in a directory block should be 0x00:
>> ...
>>> ... however, I've got a disk here that has 0x14 in that location for
>>> one
>>> single directory on the disk (all other dirs have 0x00 at offset
>>> 0x4ff).
>>
>> The RISC OS PRMs calls this the "Check byte on directory". This
>> suggests
>> that that one directory has been written to on RISC OS as some point.
>
> Interesting... the disk in question is one of the Pandora source ones,
> although it's possible it went near a RISC OS machine at some point
> (perhaps someone just needed a disk to write to temporarily, although I
> suspect that RISC OS machines with 5.25" drives aren't very common!)
I came across this check byte when I was writing my Linux FUSE-ADFS
code. It looks like the check byte was introduced in the 'D' format
ADFS (old map, 77 entry directories) which, IIRC, appeared with Arthur.
I ought to check my (5.25") DOS Plus floppies, because this was (I
believe) the first outing of Acorn's 800kB disk format - although only
the first floppy is ADFS (and only the first part of that disk too).
>> I've done a quick check editing the final byte on 8-bit ADFS and it
>> doesn't make a difference.
My code ignores that byte on reads - and I've never added write support.
> Aside: do you happen to know if there's a reason why ADFS checks the master
> sequence number and 'Hugo' string at the start and end of a directory
> block, and reports a 'broken directory' *if they don't match*?
>
> That almost reads to me as though there was something other than a duff
> sector that could trash a directory block (Perhaps the directory is the
> last thing to be written in certain ops, and users had a habit of yanking
> the floppy out before the directory block had been completely written?)
Sounds like good defensive programming to me. Also very useful when
trawling through a corrupted (hard) disk trying to recover data. An
idea subsequently taken up by Sun:
http://en.wikipedia.org/wiki/ZFS#Data_Integrity
--
Andrew Benham Southgate, London N14, United Kingdom
The gates in my computer are AND OR and NOT, not "Bill"