Running a bare board executable under PSIM

Andrew Cagney ac131313@redhat.com
Thu Sep 26 17:35:00 GMT 2002


> Hi,
> 
> I am trying to execute a program designed to run on a custom PPC603e
> board with no OS and no monitor under PSIM but am running into a snag.
> Part of my system reset exception handler copies initialized data from
> what will normally be Flash PROM into what will normally be SRAM.  The
> ELF version of this program has initialized data already at the correct
> (RAM) location (as is expected) so loading that file into the simulator
> doesn't seem to be the right thing to do.  The S-Record version of this
> program has the initialized data in the correct (Flash PROM) location
> but when I load and then try to run this program, it dies immediately
> with the following error:
> 
> /openprom/init/stack: Unfinished procedure create_ppc_aix_stack_frame

I believe that PSIM, for some reason, thinks that you have an AIX 
program and, hence, that it should create an initial AIX stack frame :-(

The emulation needs to be forced into something more useful.

I think you can get away with `-e bug'' or ``-e chirp''.

> My device tree (shown below) does not include this node.  Is that a
> problem?  Note that I do have the stack defined under /openprom/vm and
> that definitely works since I accidentally initialized the stack pointer
> to 0xF0000 instead of 0x100000 in the code and got some errors in PSIM
> as a result (a _very_ cool feature).
> 
> /openprom/init/register/msr 0x40
> /openprom/init/register/sp 0x100000
> /openprom/trace/dump-device-tree 0x0
> /openprom/options/env "operating"
> /openprom/options/model "603e"
> /openprom/options/oea-interrupt-prefix 0x1
> /openprom/vm/stack-base 0xf0000
> /openprom/vm/nr-bytes 0x10000

Specify `-t dump-device-tree', it will display both your settings and 
all the defaults.

> Note also that I have tried adding memory regions for SRAM and Flash
> PROM respectively (which aren't contiguous) to the device tree (see
> below) thinking that that might help but it doesn't seem to change
> anything.
> 
> /openprom/memory@0 0 0x100000
> /openprom/memory@fff00000 0xfff00000 0x100000
> 
> I wasn't sure if that first memory region should overlap the stack or
> not so I also tried the following:
> 
> /openprom/memory@0 0 0xf0000
> 
> Does anyone have any guidelines that I could follow to do the right
> thing in order to run a bare board executable under PSIM?
> 
> Also, when I dumped the device tree, I found that the default emulation
> is set to netbsd.  Is this really appropriate for a bare board
> executable?  It seems that all emulation choices have some level of
> monitor or OS support.  I don't really understand if this is good, bad,
> or indifferent.

It is bad.  (So it wasn't AIX, but rather netbsd).

> Thanks for the help!

Andrew




More information about the Gdb mailing list