06 July 2012, 02:43 | #1 |
Registered User
Join Date: Jun 2012
Location: France
Posts: 183
|
Kickstart checksum algorithm ?
Hello.
I'm interested in building custom kickstart ROM alternatives, such as EmuTOS for Amiga. It seems that kickstart ROMs have a 32-bit checksum at the end. For 256 kB ROMs, it is at offset $3ffe8. Question 1: Is that long at offset $3ffe8 really is a checksum? I can't find any documentation about it. Question 2: What is the algorithm to compute that checksum? It seems to be something like computing the sum of all the longs in the ROM, but I can't get the exact value... Question 3: For a custom kickstart, it that checksum really important? A custom kickstart without checksum works fine with WinUAE. Does any components use that checksum, such as soft kicking tools, etc? I'm in the mood of not including such checksum in custom ROMs if it is not required. Thanks in advance. |
06 July 2012, 04:04 | #2 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Just like in Amiga bootblocks there's no actual checksum stored, it's inferred, and the 32-bit word you're looking at is just used to correct the checksum.
At -20 bytes from the end of a Kickstart ROM there's a 32-bit word that holds the size of the ROM in bytes. I don't know if software cares about it, but maybe this is how the hardware can map ROMs so they always end at $100 0000 regardless of size. Also, the Amiga 1000 only has a small boot ROM which loads the Kickstart from disk and verifies the checksum, so at least in this case the checksum must be correct. The checksum is the sum of all 32-bit words and the carry digits, and must be equal to -1. |
06 July 2012, 08:06 | #3 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Size (end-20) is at least used by some reset routines to find start address of ROM.
|
06 July 2012, 09:46 | #4 | |||
Registered User
Join Date: Jun 2012
Location: France
Posts: 183
|
Quote:
Quote:
Quote:
I didn't add the carry bits, this is why my result was almost good, but not exactly. |
|||
06 July 2012, 22:16 | #5 | ||
Registered User
Join Date: Jun 2012
Location: France
Posts: 183
|
Quote:
Quote:
I made tests with WinUAE, and it still works fine when the kickstart on the floppy has invalid checksum. |
||
06 July 2012, 23:39 | #6 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Ok, good to know. I read this in Ralph Babel's Amiga Guru Book and some other book but never verified it myself, perhaps it only applies to some versions of the A1000 boot ROM.
|
06 July 2012, 23:47 | #7 |
Registered User
Join Date: Jun 2012
Location: France
Posts: 183
|
|
07 July 2012, 07:25 | #8 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
I remember getting red screen but only after first keyboard or software reset if loaded kickstart disk had bad checksum.
|
07 July 2012, 11:18 | #9 |
Registered User
Join Date: Jun 2012
Location: France
Posts: 183
|
I made further tests with WinUAE, Amiga1000 settings and Kickstart 1.3.
Indeed, the checksum makes a difference on reset (either LCtrl+Win+Win or WinUAE reset function). - On startup, the kickstart is loaded from the floppy. Valid or invalid checksum makes no difference. - On reset, if the checksum of the loaded kickstart was valid, it is reused from WOM and not reloaded from the floppy. It behaves just like a kickstart in ROM. - On reset, if the checksum of the loaded kickstart was not valid, it is loaded again from the floppy, just like on cold boot. I reproduced the same behavior with an EmuTOS floppy, no more mystery NB: I never saw a red screen, maybe that function was introduced in later kickstarts... |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
C: Image rotation algorithm problem | TikTok | Coders. General | 20 | 19 August 2019 20:15 |
Name that algorithm | swirlythingy | Coders. General | 3 | 07 March 2013 22:07 |
VICE PAL filter algorithm | Leandro Jardim | support.WinUAE | 0 | 23 September 2012 00:27 |
Decoding algorithm(s) for encoded disk sectors (ADOS) | andreas | Coders. General | 10 | 02 November 2009 22:18 |
Kickstart checksum incorrect | Techx | support.WinUAE | 5 | 04 August 2005 04:43 |
|
|