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

--_11d5327b-a144-4c4f-9eec-dfa2d03e7f81_



> From: kortink@...> To: bbc-micro@...> Subject: Re:
[BBC-Micro] ADFS sector checksums> Date: Thu, 19 Oct 2006 16:47:41 +0200> > >
On Thu, 19 Oct 2006 15:11:16 +0100, you wrote:> > >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.> > That's wrong. The
sector number has no part in the calculation.> It has been mentioned many
times, but it doesn't seem to have> inspired correction of the relevant
documents.> > A 'C' code fragment that calculates the checksum correctly is :> >
int ix, sum, cflag;> > for (ix = 254, sum = 255, cflag = 0; ix >
0; ix--)> if ((cflag = ((sum += sector[ix] + cflag) > 255)) != 0)>
sum -= 256;> > sector[255] = sum;> > This is exactly what ADFS does
itself.> > Start with 255, 'clear carry', then add, with carry, all> bytes from
offset 254 up to and including 0. The final> 'carry out' (from adding the
byte at offset 0) is discarded.> > A number of messages about this appears
mid march 2006 on> this mailing list.> > > John Kortink
 
Thanks for that John, so the document is definetly wrong. I searched the
mailing list using the search
terms "adfs" and "checksum" but don't get anything after 2004.
 
_________________________________________________________________
Be one of the first to try Windows Live Mail.
http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d
--_11d5327b-a144-4c4f-9eec-dfa2d03e7f81_
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>