Subject: Re: A fix for the panic on reboot problem in NetBSD 3.1 (tested in SE/30)
To: Martin Husemann <martin@duskware.de>
From: Sungwon Chung <lucky.cimon@gmail.com>
List: port-mac68k
Date: 01/02/2007 07:05:46
On 1/2/07, Martin Husemann <martin@duskware.de> wrote:
> On Tue, Jan 02, 2007 at 04:22:39AM -0500, Sungwon Chung wrote:
> > The fix finally made is simply to change the line 362 of the
> > 'usr/src/sys/arch/mac68k/mac68k/pmap_bootstrap.c'
> > by adding '+ 1'.
>
> This looks kinda wrong to me (but I do not understand a lot of the underlying
> magic). Why does the ROM need write access to everything < start, does it
> realy have to be "everything" - and why don't we just align start on a page
> boundary?
>
> Martin
>

(1) I also don't know the exact reason for write acess to everything < start.

What I guess is as follows.

The region 'everything < start' is used in bootstrapping to get some
information about video and memory configuration previously obtained
by MacOS. When the cpu_reboot() is called, doboot() in locore.s executes
a MacOS ROM reset subroutine for reset.  After execution is handed
over to the MacOS ROM reset subroutine, the MacOS ROM may
need to write the 'everything < start' region for interrupt vector table
and so on, before reinitializing the MMU.

I think its commiter is the one who can tell us the exact answer.
The minimal write access for ROM was implemented at revision 1.62,
which is after NetBSD 2.1:

http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/mac68k/mac68k/pmap_bootstrap.c.diff?r1=1.61&r2=1.62&f=h


(2) I think we can probably align the 'start' at a page boundary by
modifying '/usr/src/sys/arch/mac68k/mac68k/locore.s'.
I just wished to minimize the modification.

Best,
Sungwon