public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
From: Joshua Juran <jjuran@gmail.com>
To: Finn Thain <fthain@telegraphics.com.au>
Cc: Brad Boyer <flar@allandria.com>, Riccardo <riccardo@kaffe.org>,
	Laurent Vivier <Laurent@lvivier.info>,
	geert@linux-m68k.org, linux-m68k@vger.kernel.org
Subject: Re: [PATCH] Add SWIM floppy support for m68k Macs.
Date: Wed, 5 Nov 2008 04:20:28 -0800	[thread overview]
Message-ID: <B0EA0FB1-9FEF-4159-ADAB-B5C2EA910352@gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0811051852060.23823@loopy.telegraphics.com.au>

On Nov 5, 2008, at 2:31 AM, Finn Thain wrote:

> On Tue, 4 Nov 2008, Joshua Juran wrote:
>
>> On Nov 4, 2008, at 12:06 PM, Brad Boyer wrote:
>>
>>> On Tue, Nov 04, 2008 at 07:34:41PM +0100, Riccardo wrote:
>>>
>>> Hopefully there's a logical way to detect this upgrade, but it  
>>> would be
>>> interesting to know if the update changes the gestalt ID.
>>
>> You would detect an upgraded ROM by reading the ROM, I imagine.
>
> Good point. But I think we'd need the ROM base to be supplied by  
> Penguin?
> Or even just the ROM checksum.

It's probably a good idea for the kernel to know the address and size  
of the ROM, and given those (or just the former) it can determine the  
checksum.  Penguin can get these from low memory and Gestalt()  
respectively.  EMILE can too iff they're set up in ROM -- I don't know.

>> By the way, does anyone know how to calculate a ROM checksum, or  
>> will I
>> have to reverse-engineer CopyROM or somesuch?
>
> I assumed that CopyROM etc did not validate anything, they just  
> reported
> the checksum contained in the ROM (first 4 bytes).

Oh.  Red herring, then.  So for our purposes it's just a magic  
number, and the "checksum" algorithm would be:

	inline unsigned long checksum( const void* rom, unsigned long size )
	{
		return *(const unsigned long*) rom;
	}

:-)

> The code must be part
> of the POST though, since a bad rom checksum is a sad mac error. So  
> you
> could reverse engineer that. But IIRC there is a card ROM checksum
> algorithm given in Designing Card and Drivers for the Mac II and  
> Mac SE.
> It's probably the same algorithm. I don't have access to my copy at  
> the
> moment.

Might be interesting, but not necessary -- if we really wanted to  
verify the ROM was intact we could use any checksum algorithm we  
wished, with a table mapping one to the other.

But one of these days I should spend some quality time disassembling  
ROM anyway.

Josh



  reply	other threads:[~2008-11-05 12:20 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-01  9:43 [PATCH] Add SWIM floppy support for m68k Macs Laurent
2008-11-01 18:10 ` Brad Boyer
2008-11-02  0:29   ` Finn Thain
2008-11-02  5:23     ` Brad Boyer
2008-11-02 12:02   ` Laurent Vivier
2008-11-04 18:34     ` Riccardo
2008-11-04 20:06       ` Brad Boyer
2008-11-05  0:58         ` Riccardo
2008-11-05  2:28           ` Brad Boyer
2008-11-05 21:43             ` Riccardo
2008-11-06  4:18               ` Brad Boyer
2008-11-05  6:58           ` Finn Thain
2008-11-05 21:45             ` Riccardo
2008-11-05  7:37         ` Joshua Juran
2008-11-05 10:31           ` Finn Thain
2008-11-05 12:20             ` Joshua Juran [this message]
2008-11-05 13:10               ` Finn Thain
2008-11-05 14:32                 ` Laurent Vivier
2008-11-06  4:09                   ` Brad Boyer
2008-11-02  6:00 ` Finn Thain
2008-11-02 11:59   ` Laurent Vivier
2008-11-02  8:54 ` Geert Uytterhoeven
2008-11-02 11:21   ` Laurent Vivier
2008-11-02 21:28     ` Brad Boyer
2008-11-03  0:14       ` Finn Thain
2008-11-03 18:58         ` Laurent Vivier
2008-11-09 16:16         ` Geert Uytterhoeven
2008-11-09 21:47           ` Laurent Vivier
2008-11-09 23:05           ` Michael Schmitz
2008-11-10  0:15           ` Finn Thain
2008-11-11  8:52             ` Geert Uytterhoeven
2008-11-11  9:43               ` Finn Thain
2008-11-11 10:21                 ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B0EA0FB1-9FEF-4159-ADAB-B5C2EA910352@gmail.com \
    --to=jjuran@gmail.com \
    --cc=Laurent@lvivier.info \
    --cc=flar@allandria.com \
    --cc=fthain@telegraphics.com.au \
    --cc=geert@linux-m68k.org \
    --cc=linux-m68k@vger.kernel.org \
    --cc=riccardo@kaffe.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox