Subject: Re: How do I run netbsd ofppc under psim simulator?
To: None <port-ofppc@netbsd.org>
From: nldudok1 <nldudok1@olifantasia.com>
List: port-ofppc
Date: 02/19/2002 00:40:11
Thanks for the tips/files, I get a bit further now.
The kernel starts up but still hits a trap. I changed the tree to enable
realmode and a real disk image(don't know if it is a good disk image).
/options/real-mode? true
/phb/ide@1/cdrom@0
./device_type "block
./name "cdrom
./file "/var/ftp/incoming/ppcdisk
Here the results of running:
[nldudok1@quark incoming]$
/var/ftp/incoming/psim/freebsd/bin/powerpc-netbsd-run
-f /var/ftp/incoming/trees/cagney_tree_real
/var/ftp/incoming/netbsd_ofppc_ca
gney_half_stripped
Copyright (c) 1996, 1997, 1998, 1999, 2000
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 1.5 (MYCONF_PATCHCAEGNEY_HALF) #0: Mon Feb 18 14:37:56 CET 2002
root@vmware_netbsd2:/usr/src/cross/src/usr/src/sys/arch/ofppc/compile/MYCONF
_PATCHCAEGNEY_HALF
CPU: Version 0 (Revision 0)
total memory = 65536 KB
avail memory = 58424 KB
using 844 buffers containing 3376 KB of memory
mainbus0 (root)
ofbus0 at mainbus0
ofbus1 at ofbus0 (cpus)
cpu@0 at ofbus1 not configured
ofbus2 at ofbus0 (phb@0x80000000)
ofbus3 at ofbus2 (ide@1)
ofdisk0 at ofbus3 (cdrom@0)
ofdisk1 at ofbus3 (cdrom@0)
ofcons0 at ofbus2 (com@2)
trap type 300 at 21e2e8
Press a key to panic.
panic: trap
syncing disks... done
dumpsys: TBD
rebooting
chrp: boot called, exiting.
[nldudok1@quark incoming]$
I thought it was not possible to just "run" a netbsd kernel. So I was
trying to get a standalone ofboot started in psim which then starts the
openboot prompt which loads the kernel from a disk image.
This way I hope to be able to boot not only netbsd but also a freebsd or
linux kernel with user tools.
So I compiled ofwboot.elf from macppc branch but it complains about no
dma-alloc method and dies cleanly:
[nldudok1@quark incoming]$
/var/ftp/incoming/psim/freebsd/bin/powerpc-netbsd-run -f
/var/ftp/incoming/trees/cagney_tree_real
/var/ftp/incoming/ofwboot/ofwboot_netbsd_1.5_macppc_stripped.elf
>> NetBSD/macppc OpenFirmware Boot, Revision 1.2
>> (matt@duel.local, Thu Nov 16 17:26:57 PST 2000)
/phb@0x80000000/ide@1/cdrom@0: no dma-alloc method
The ofwboot from the ofppc branch doen't have the offending dma-alloc
code so I tried that one but it crashes on a double interrupt:
[nldudok1@quark incoming]$
/var/ftp/incoming/psim/freebsd/bin/powerpc-netbsd-run -f
/var/ftp/incoming/trees/cagney_tree_real
/var/ftp/incoming/ofwboot/ofwboot_netbsd_1.5_ofppc_stripped
>> NetBSD/ofppc OpenFirmware Boot, Revision 1.3
>> (root@vmware_netbsd2, Mon Feb 11 02:12:51 CET 2002)
cpu 1, cia 0x0: double interrupt - MSR[RI] bit clear when attempting to
deliver interrupt, cia=0x0, msr=0x3000; srr0=0x0(cia), srr1=0x0(msr);
trap-vector=0x700, trap-msr=0x1000
/var/ftp/incoming/ofwboot/ofwboot_netbsd_1.5_ofppc_stripped: Caught
signal -1 at address 0x0
Unfortunately the patches made no changes here.
I stripped everywhere the note section with powerpc-objcopy.
I must say this is a netbsd 1.5 tree. The mainbus patches were rejected
because this whole part of the code is not there in netbsd 1.5, only in
recent cvs versions. I am going to try a fresh current cvs source tree
to see if that helpes, I should be able to run the complete patch.
Otherwise I think I might try an older version of binutils, I read that
a bug was introduced in 2.8.x which prevented the ofppc branch from
running. Maybe it is still there in 2.9.x
Most importantly I now have a hardware tree which should be ok. I found
out that your tree wasn't that different from the tree I got from the
japanese netbsd mailing list.
Any reading tips on technical part of the booting proces of a kernel on
openfirmware ppc or on psim?
The most usefull document I found so far was the psim usermanual on
sources.redhat.com. It is quite clear but also not quite complete.
Greetings,
Martin
Andrew Cagney wrote:
>> i all,
>> I am trying for a while now to boot a ppc netbsd kernel under the psim
>> simulator but I can't get it to work.
>> Can anybody tell me what I need (versions and configuration file) and
>> where to find it.
>> Most information I found references dead ftp sites. Especially I don't
>> know what hardware tree to use. And how to compile and invoke
>> ofwboot. The only version I have that doesn't crash rightaway
>> complaines about no dma in the ide controller and then dies.
>
>
> With the attached patch applied, and a current GDB,
> I can get as far as:
>
> bash-2.04# gdb /usr/src/sys/arch/ofppc/compile/GENERIC/netbsd.gdb
> GNU gdb 2002-02-10-cvs
> ...
> This GDB was configured as "powerpc-unknown-netbsd1.5ZA"...
> (gdb) target sim -r 0x400000
> Connected to the simulator.
> (gdb) load
> chirp: note descriptor missing load-base
> (gdb) run
> Starting program: /usr/src/sys/arch/ofppc/compile/GENERIC/netbsd.gdb
> NetBSD does not yet support the "gpl,clayton".
> Using generic OpenFirmware driver support.
> [ no symbols available ]
> Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002
> 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 1.5ZA (GENERIC) #0: Sat Feb 16 00:18:00 EST 2002
> boor@localhost:/usr/src/sys/arch/ofppc/compile/GENERIC
> total memory = 4096 KB
> avail memory = 1388 KB
> using 76 buffers containing 304 KB of memory
> mainbus0 (root): gpl,clayton
> cpu@0 at mainbus0 not configured
> memory@0 at mainbus0 not configured
> panic: unknown timebase
> trap: kernel read DSI @ 0x7c3143f6 by 0x29ef14 (DSISR 0x40000000, err=14)
> Press a key to panic.
>
> panic: trap
> trap: kernel read DSI @ 0x7c3143f6 by 0x29ef14 (DSISR 0x40000000, err=14)
> Press a key to panic.
> ^C
> Program received signal SIGINT, Interrupt.
> 0x80004004 in ?? ()
> (gdb)
>
> The first missing bit is a device tree description. Dig Dig. Found the
> attached. Use it with:
>
> target sim -f tree
>
> The next missing bit is a disk / root file system. Wonder what happens
> if I point it at /dev/wd0a ....
>
> Andrew
>
>
> ------------------------------------------------------------------------