Subject: DIAGNOSTIC seems to trigger fault in oea_init()
To: None <port-macppc@netbsd.org>
From: David P. Reese, Jr. <daver@siginfo.org>
List: port-macppc
Date: 01/29/2006 21:34:02
I'm surprised that other people haven't seen this problem so I'm 
wondering
if it is specific to my hardware (early Aluminum PowerBook G4).

Kernels built with DIAGNOSTIC seem to fault in oea_machdep.c:oea_init()
on line 175 where memcpy() is called to populate the trap vector at
address 0.

What I don't understand is that addresses 0x0-0x100 are zeroed
on line 166 which doesn't cause a trap.  Also, changing the for loop
to start populating trap vectors at address EXC_RST instead of 0
allows kernels with DIAGNOSTIC to boot.

I'm not sure why we populate the trap vector at address 0 as [1] claims
that addresses 0x0-0x100 are reserved for system use and are not in fact
part of a trap vector.

Below I have the output of boot failures using a GENERIC+DIAGNOSTIC
kernel and a kernel with a minimal config that includes DIAGNOSTIC
(http://siginfo.org/files/netbsd/macppc.MINIMAL.conf).

First, here is the output of GENERIC+DIAGNOSTIC:

     >> NetBSD/macppc OpenFirmware Boot, Revision 1.10
     >> (jmc@faith.netbsd.org, Tue Mar 22 15:50:28 UTC 2005)
     5457528+217564 [268336+254237]=0x5e9598
      start=0x100000

     Invalid memory access at   %SRR0: 001017cc   %SRR1: 00080030
      ok
     0 > .registers
     Client's Fix Pt Regs:
      00 00380bb4 006fcd20 00668ab8 00000000 00421d1c 00001300 00000000 
00630000
      08 00000000 00630000 00000000 00000001 40004044 00000000 00000000 
00000000
      10 00000000 00000000 00000000 00000000 00000000 00000000 006fd000 
00100000
      18 00670000 0041f4a4 00100540 00570000 00000000 00000000 00400ec4 
00000000
     Special Regs:
         %IV: 00000700   %SRR0: 001017cc   %SRR1: 00080030    %MSR: 
00000000
         %CR: 40004044     %LR: 00001300    %CTR: 00421d1c    %XER: 
00000000
      %DSISR: 42000000    %DAR: 00e17000   %SDR1: 0ffe0000
      %SPRG0: 00380bb4  %SPRG1: 006fcd20  %SPRG2: 00668ab8  %SPRG3: 
0ffdf400
      ok
     0 >

Strangely enough, using the minimal kernel config that I have posted
at http://siginfo.org/files/netbsd/macppc.MINIMAL.conf, the resultant
kernel fails to boot with the following:

     >> NetBSD/macppc OpenFirmware Boot, Revision 1.10
     >> (jmc@faith.netbsd.org, Tue Mar 22 15:50:28 UTC 2005)
     958780+55828 [71248+63770]=0x118e88
      start=0x100000
      ok
     0 > .registers
     state not valid
     0 >

Both kernels boot successfully when built without the DIAGNOSTIC option.


1. PowerPC Operating Environment Architecture Book III Version 2.01
    
ftp://www6.software.ibm.com/software/developer/library/es-ppcbook3.zip

--
David P. Reese, Jr.
daver@siginfo.org