Port-macppc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Trying to boot on PowerMac 7200/90



Hello

I'm having trouble trying to get PowerMac 7200/90 up and running NetBSD.
So far I managed to change ofwboot.xcf to work with PPC601 and reduced
the size of a customized kernel down to about 2.7 MB. Trying to netboot
this kernel results in the follwing

1 The modified loader called 'b4.xcf' behaves correctly
2 It reads the stripped down kernel called 'wg2' over tftp,
3 it seems to load the kernel to memory
4 then execution is passed on to the kernel
5 fron this point on nothing seems to happen as if the kernel got stuck
6 There is no difference if real-mode? setting is set true or false. The
results are the same
7 Loading a kernel of size larger than 4 MB is not possible (openprom limit)

Some more details
Altivec code is disabled in kernel
No changes were made to segment / BAT  / handing in kernel
Actually nothing except config file trimming
Loading a gzipped kernel makes no difference, it executes up to the same point

Last lines are
2323616+307016| [161024+154352]=0x2cf7a4
 start=0x100000
before cache            # debug message from the loader ofwboot/boot.c
before chain            # debug message from the loader ofwboot/boot.c
before entry call       # debug message from the loader ofwboot/Locore.c
                        # nothing more shows up ...

ofwboot/boot.c
void
main(void)
{
        ...
        ...
        entry = marks[MARK_ENTRY];
        ssym = (void *)marks[MARK_SYM];
        esym = (void *)marks[MARK_END];

        printf(" start=0x%x\n", entry);
        printf("before cache\n");
        __syncicache((void *) entry, (u_int) ssym - (u_int) entry);
        printf("before chain\n");
        chain((boot_entry_t) entry, bootline, ssym, esym);

        OF_exit();
}

ofwboot/Locore.c
OF_chain(void *virt, u_int size, boot_entry_t entry, void *arg, u_int len)
{
        /*
         * This is a REALLY dirty hack till the firmware gets this going
         */
#if 0
        OF_release(virt, size);
#endif
        printf("before entry call\n");
        entry(0, 0, openfirmware, arg, len);
}

ofwboot/Locore.c - support for PPC601.
This is based on posts in this group in the past
__asm(
"       .text                   \n"
"       .globl  _start          \n"
"_start:                        \n"
"       sync                    \n"
"       isync                   \n"
"       lis     %r1,stack@ha    \n"
"       addi    %r1,%r1,stack@l \n"
"       addi    %r1,%r1,8192    \n"
"                               \n"
"       mfmsr   %r8             \n"
"       li      %r0,0           \n"
"       mtmsr   %r0             \n"
"       isync                   \n"
"                               \n" /* test for 601 */
"       mfspr   %r0,287         \n" /* mfpvr %r0 PVR = 287 */
"       srwi    %r0,%r0,0x10    \n"
"       cmpi    0,1,%r0,0x02    \n" /* 601 CPU = 0x0001 */
"       blt     1f              \n" /* skip over non-601 BAT setup */
                                
        /*non PPC 601 BATs*/
"       mtibatu 0,%r0           \n"
"       mtibatu 1,%r0           \n"
"       mtibatu 2,%r0           \n"
"       mtibatu 3,%r0           \n"
"       mtdbatu 0,%r0           \n"
"       mtdbatu 1,%r0           \n"
"       mtdbatu 2,%r0           \n"
"       mtdbatu 3,%r0           \n"
"                               \n"
"       li      %r9,0x12        \n"     /* BATL(0, BAT_M, BAT_PP_RW) */
"       mtibatl 0,%r9           \n"
"       mtdbatl 0,%r9           \n"
"       li      %r9,0x1ffe      \n"     /* BATU(0, BAT_BL_256M, BAT_Vs) */
"       mtibatu 0,%r9           \n"
"       mtdbatu 0,%r9           \n"
"       b 2f                    \n"
        
        /* PPC 601 BATs*/

"1:     mtibatu 0,%r0           \n"
"       mtibatu 1,%r0           \n"
"       mtibatu 2,%r0           \n"
"       mtibatu 3,%r0           \n"
"                               \n"
"       li      %r9,0x7f        \n"
"       mtibatl 0,%r9           \n"
"       li      %r9,0x1a        \n"
"       mtibatu 0,%r9           \n"
"                               \n"
"       lis %r9,0x80            \n"
"       addi %r9,%r9,0x7f       \n"
"       mtibatl 1,%r9           \n"
"       lis %r9,0x80            \n"
"       addi %r9,%r9,0x1a       \n"
"       mtibatu 1,%r9           \n"
"                               \n"
"       lis %r9,0x100           \n"
"       addi %r9,%r9,0x7f       \n"
"       mtibatl 2,%r9           \n"
"       lis %r9,0x100           \n"
"       addi %r9,%r9,0x1a       \n"
"       mtibatu 2,%r9           \n"
"                               \n"
"       lis %r9,0x180           \n"
"       addi %r9,%r9,0x7f       \n"
"       mtibatl 3,%r9           \n"
"       lis %r9,0x180           \n"
"       addi %r9,%r9,0x1a       \n"
"       mtibatu 3,%r9           \n"
"                               \n"
"2:     isync                   \n"
"                               \n"
"       mtmsr   %r8             \n"
"       isync                   \n"
"                               \n"
        /*
         * Make sure that .bss is zeroed
         */
"                               \n"
"       li      %r0,0           \n"
"       lis     %r8,_edata@ha   \n"
"       addi    %r8,%r8,_edata@l\n"
"       lis     %r9,_end@ha     \n"
"       addi    %r9,%r9,_end@l  \n"
"                               \n"
"5:     cmpw    0,%r8,%r9       \n"
"       bge     6f              \n"
"       stw     %r0,0(%r8)      \n"
"       addi    %r8,%r8,4       \n"
"       b       5b              \n"
"                               \n"
"6:     b       startup         \n"
);

I tried the same openprom settings, the same loader and kernel on a machine
with PPC604, results are attached below.
I did not investigate the trap, which seems to be the result of
lack of hardware support as a consequence of kernel config trimming down.

What I'm thinking of is to place some printf like messages as early as possible
in the kernel source to find out where it got stuck. I think of
placing them as early
as in arch/powerpc/oea/ofwoea_machdep.c ofwoea_initppc.

Your comments are welcome
I know it is at least neccesary to change BAT configuration to something
else as PPC601 BAT max size is limited to 8 MB. So segment mappings have to
be used instead. Do you happen to know of non Linux source codes to take a
peek into ? MkLinux ?


-------------------------output -------------------------------------
0 > setenv load-base f00000 ok
0 > setenv real-base 600000 ok
0 > reset-all ok

Open Firmware, 1.0.5
To continue booting the MacOS type:
BYE<return>
To continue booting from the default boot device type:
BOOT<return>
 ok
0 > boot enet:,\b4.xcf wg2
file: 192.168.2.31,/b4.xcf
loading XCOFF
tsize=EBF0 dsize=268 bsize=2A30 entry=E00000
SECTIONS:
.text    00E00000 00E00000 0000EBF0 000000E0
.data    00E0F000 00E0F000 00000268 0000ECD0
.bss     00E0F268 00E0F268 00002A30 00000000
loading .text, done..
loading .data, done..
clearing .bss, done..

>> NetBSD/macppc OpenFirmware Boot, Revision 1.10
>> (n4%pmg4.wg.net@localhost, Mon Aug 18 20:50:19 UTC 2008)
>> Open Firmware version 1.x
bootline=wg2
Trying wg2
no active packagefile: 192.168.2.31,/b4.xcfnet_mountroot
bootp: socket=0
bootp: d=e112f8
bootpsend: d=e112f8 called.
bootpsend: calling sendudp
bootprecv: checked.  bp = 0xe10858, n = 322
bootprecv: got one!
vend_rfc1048 bootp info. len=312
bootpsend: d=e112f8 called.
bootpsend: calling sendudp
bootprecv: checked.  bp = 0xe10858, n = 322
bootprecv: got one!
vend_rfc1048 bootp info. len=312
'native netmask' is 255.255.255.0
mask: 255.255.255.0
client addr: 192.168.2.33
subnet mask: 255.255.255.0
net gateway: 192.168.2.31
server addr: 192.168.2.31
server path: /export/client/root
file name: wg2
Using IP address: 192.168.2.33
myip: pmga (192.168.2.33), gateip: 192.168.2.31, netmask: 255.255.255.0
root addr=192.168.2.31 path=/export/client/root
2323616+307016| [161024+154352]=0x2cf7a4
 start=0x100000
before cache
before chain
before entry call <- 7200/98 freezes here

Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
    2006, 2007, 2008
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 4.99.63 (wg2) #2: Mon Aug 18 19:23:11 UTC 2008
        n4%pmg4.wg.net@localhost:/n4/usr/obj.macppc/sys/arch/macppc/compile/wg2
total memory = 272 MB
avail memory = 258 MB
found Grand Central PIC at f3000000
bootpath: enet/wg2
mainbus0 (root)
cpu0 at mainbus0: 604e (Revision 2.4), ID 0 (primary)
cpu0: HID0 8000c084<EMCP,ICE,DCE,SGE,BHT>, powersave: 1
cpu0: 235.30 MHz
bandit0 at mainbus0
pci0 at bandit0 bus 0
pchb0 at pci0 dev 11 function 0
pchb0: vendor 0x106b product 0x0001 (rev. 0x03)
machfb0 at pci0 dev 13 function 0: vendor 0x1002 product 0x4749 (rev. 0x5c)
machfb0: 16 MB aperture at 0x82000000, 4 KB registers at 0x80800000
machfb0: 2048 KB SGRAM 30.783 MHz, maximum RAMDAC clock 230 MHz
mach64_get_mode: 640 736 1056 864 480 483 515 525
machfb0: initial resolution 1152x864 at 8 bpp
machfb0: initializing the DSP
wsdisplay1 at machfb0 kbdmux 1
vendor 0x121a product 0x0002 (video multimedia, revision 0x02) at pci0
dev 14 function 0 not configured
ppb0 at pci0 dev 15 function 0: vendor 0x1011 product 0x0021 (rev. 0x02)
pci1 at ppb0 bus 1
obio0 at pci0 dev 16 function 0: addr 0xf3000000
esp0 at obio0 offset 0x10000 irq 12: NCR53C94, 25MHz, SCSI ID 7
scsibus0 at esp0: 8 targets, 8 luns per target
mc0 at obio0 offset 0x11000trap: kernel ISI by 0x7c3142a4 (SRR1
0x40001032), lr: 0x2d355c
panic: trap
Stopped in pid 0.1 (system) at  netbsd:cpu_Debugger+0x10:       lwz
 r0, r1, 0
x14
db> trace
0x003d5620: at panic+0x21c
0x003d5670: at trap+0x100
0x003d5700: kernel ISI trap by _prop_dictionary_keysym32_pool+0x7bf91fb4: srr1=0
x40001032
            r1=0x3d57c0 cr=0x39033033 xer=0xe000be6f ctr=0x7c3142a6
0x003d57c0: at mc_attach+0x80
0x003d5800: at config_attach_loc+0x188
0x003d5830: at obio_attach+0x2b4
0x003d5950: at config_attach_loc+0x188
0x003d5980: at pci_probe_device+0x324
0x003d5a00: at pci_enumerate_bus+0x1f8
0x003d5a40: at pcirescan+0x24
0x003d5a60: at pciattach+0x1e8
0x003d5aa0: at config_attach_loc+0x188
0x003d5ad0: at bandit_attach+0x2d8
0x003d5bd0: at config_attach_loc+0x188
0x003d5c00: at mainbus_attach+0x120
0x003d5cd0: at config_attach_loc+0x188
0x003d5d00: at cpu_configure+0x158
0x003d5ec0: at configure+0x44
0x003d5ee0: at main+0x160
0x003d5f30: at 0x100094
db> reboot
rebooting

EXIT called ok
0 >


Home | Main Index | Thread Index | Old Index