[comp.sys.amiga] Boot-block checksum?

blgardne@esunix.UUCP (Blaine Gardner) (10/26/87)

A friend is trying to install a DeciGel and/or NoFastMem type patch in
the boot-block (to persuade EA and Psygnosis games to work), and has run
into problems calculating the checksum for the boot-block.

> I need the _exact_ procedure for calculating the boot block checksum
> (after the four character identifier). Assembly source would be
> _ideal_. Also, any info about where I can find more disk _structure_ 
> information (block checksums, VTOC, etc.) would be helpful.

Can anyone give him a hand?
-- 
Blaine Gardner @ Evans & Sutherland    540 Arapeen Drive, SLC, Utah 84108
UUCP Address:   {ihnp4,ucbvax,decvax,allegra}!decwrl!esunix!blgardne
		{ihnp4,seismo}!utah-cs!esunix!blgardne
"I don't see no points on your ears boy, but you sound like a Vulcan!"

bryce@hoser.berkeley.edu (Bryce Nesbitt) (10/27/87)

In article <538@esunix.UUCP> blgardne@esunix.UUCP (Blaine Gardner) writes:
>A friend is trying to install a DeciGel and/or NoFastMem type patch in
>the boot-block (to persuade EA and Psygnosis games to work), and has run
>into problems calculating the checksum for the boot-block.
>
>> I need the _exact_ procedure for calculating the boot block checksum
>> (after the four character identifier). Assembly source would be
>> _ideal_. Also, any info about where I can find more disk _structure_ 
>> information (block checksums, VTOC, etc.) would be helpful.
>
>Can anyone give him a hand?


		lea.l	bblock,a0	;address of 1024 byte boot block
		move.l	a0,a1

		move.l	#128+127,d3	;how many longs in the block
		moveq	#0,d0
		move.l	d0,4(a0)	;Zero out checksum location
		move.w	#0,CCR		;Unset extend bit (for addx)
chksum		move.l	(a1)+,d1
		addx.l	d1,d0
		dbra	d3,chksum
		neg.l	d0		
		subq.l	#1,d0
		move.l	d0,4(a0)	;Set checksum into block


This is from the "install" progam I wrote a while back for the Amigados
Replacement Project (What ever happened to that?).  Anyhow, complete
source code to this and another install is on a recent fish disk (don't
have the number handy).

Good project to have noFASTmem in the boot block!  Be sure to SetFunction()
the Allocate and Avail exec library vectors.  Replace them with your own
"there is no fast memory here" flavors. 

You had better check for a nonstandard boot block and warn the user before
wiping it out!  The DOS has a standard bit of code, followed by garbage.
If the sector is the same up to the end of the standard code (checksum
excepted) then wipe it out without regret.

|\ /|  . Ack! (NAK, SOH, EOT)
{o O} . bryce@hoser.berkeley.EDU -or- ucbvax!hoser!bryce
 (")
  U	"I never said you _could_, I merely said you _should_." -Humpty
	Dumpty	

page@ulowell.cs.ulowell.edu (Bob Page) (10/27/87)

bryce@hoser.berkeley.edu (Bryce Nesbitt) wrote:
>... the Amigados Replacement Project (What ever happened to that?).

It's still alive... Charlie Heath (Microsmiths) was handing out loads
of ARP disks at AmiExpo, and was involved with AndyF and Bill Hawes at
an "AmigaDOS: Past Present and Future" panel discussion.  Andy hinted
that CBM is interested in the project and may find a way to lend some
support into getting it into a future Amiga OS release.

..Bob
-- 
Bob Page, U of Lowell CS Dept.   page@ulowell.{uucp,edu,csnet}