<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Fri, 27 Oct 2006 00:58:04 +0100
From   : jgh@... (Jonathan Graham Harston)
Subject: ADFS sector checksums

>Message-ID: <3lcuj2dthslh96i0qbfkkp0eb4q7dd86fc@...>
 
John Kortink <kortink@...> wrote:
> >Sector 1: F9 FF 1F 00 00 .... 00 27 E6 00 03 xx
> >FNsum returns &2A, but actual checksum is &2B.
> 
> No, the actual checksum is &29.
> 
> The proof of the pudding : putting the relevant harddisc
> images on GoMMC : &2B for sector 1, as expected, gives a
> 'Bad FS map' error. &29, as expected, doesn't.
 
Ah. Knowing that helps. I suspect that the proble is related to
my code starting sum=0, whereas your C code starts sum=255,
which none of the documentation tells you.
 
The Master Reference Manaul just says "checksum". The PRM
v2p200 says "8-bit ADCs on the bytes of the map, starting
with value 0", and the zero is repeated in the next paragraph
and in the code sample. That to me clearly says
0++mem[0]++mem[1]++mem[2]++mem[3]...etc where '++' means ADC.
Your code says 255++mem[0]++mem[1]...etc.
 
> >Well, that gives me &21 instead of &2B.
> 
> No, it gives &29. Which is the correct answer. You
> either forgot to properly zero out the rest of the
> sector or your 6502 has forgotten how to add.
 
My 6502 must have forgotten how to count, as I typed that code in,
spooled the output, listed it and ran it, then read the spool
output directly into the email.
 
Anyway. I'll have to get around to plugging my GoMMC back in and
making some sample blank disks and getting the BASIC code working
properly.
 
-- 
J.G.Harston - jgh@...                - mdfs.net/User/JGH
Sheffield Boundary Review at http://mdfs.net/User/JGH/Docs/Politics/ParlReview
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>