<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Thu, 19 Oct 2006 15:11:16
From   : Steve O'Leary <navalenigma@...>
Subject: ADFS sector checksums

Can anyone give me a definitive answer on ADFS checksums, the document at
 
http://mdfs.net/Docs/Comp/Disk/Format/ADFS
 
States it's the sum of  adding with carry the 255 bytes of data and then
adding the sector number.
 
Another from a post on this list about 4 years ago states it's the sum of
the bytes with no carry (i.e. no secotr number either).
 
The above link is on Jonathon Graham Harston's site but I don't know if
he's the author of it or not, but using that method doesn't seem to give me a
the same result as on a disk created in BeebEm.
For example the second sector (sector 01) of a blank new ADFS disk image
created by BeebEm contains the following data (all values in hex)
 
100   F9 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 
it goes on as zero's until it gets to 1FE where we get a value of 3 for
the end of free space list pointer
 
So the only three numbers we will be adding together here are F9, 04 and
03 (all others are zero). If I add these with carry I get(showing decimal as
well)
F9   24904    04--   ---FD   253   (No carry)
 
It then adds a load of zero's until we get to the 03 (The last number in
the 255 that it will add together)
 
FD   25303     3--   ---00     0  (Carry set)
 
We then add (with carry I presume but not stated) the sector number so we
get 02, even if we don't add with carry when adding the sector number we'd
still get a value of 01 when the disk created by  BeebEm has a value of 00
for this particular checksum (Address 1FF)
 
The post on the mailing list saying just add without carry all the 255
bytes together would have generated the correct number, so is this the correct
version ? or am I miss-interpreting the document on Jonathon's site.
So I know you post a lot on here Jonathon, can you shed any light, (or can
anyone else)
_________________________________________________________________
Be one of the first to try Windows Live Mail.
http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>