Re: Cannot call C function in "Simple" boot loader
From: Steven Rostedt (rostedt_at_SPAMgoodmis.org)
Date: 04/19/04
- Next message: Dan Kegel: "Re: Embedded linux with best developer tools?"
- Previous message: Michael Schnell: "Re: Linux 2.6 Kernel in Real-time Environment"
- In reply to: Frank: "Cannot call C function in "Simple" boot loader"
- Next in thread: Frank: "Re: Cannot call C function in "Simple" boot loader"
- Reply: Frank: "Re: Cannot call C function in "Simple" boot loader"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 19 Apr 2004 11:18:34 -0400
Hi Frank,
I see you're still struggling over the PPC board and vxworks boot loader.
Frank wrote:
> I am trying to boot up a monta vista linux kernel with vxworks boot
> loader. The vxworks boot loader can load the "Simple" boot loader and
> execute it with no
> problem. But when relocate.S tried to call the C function
> decompress_kernel() in misc-simple.c, it was stucked and can't go
> through. I guess there are some stack setup or something else I didn't
> do it right. Could you give any advice on what could be the problem
> during C function calling?
Lots of reasons. Did the relocate work? Is the cache off? If it is not
then the relocation may only happen in the data cache and the
instruction cache may not know about it, so that when you jump to the
code, you go nowhere.
>
> BTW, I found this comment in relocate.S:
>
> ===========================================================================
> /* Move this code somewhere safe. This is max(load + size, end)
> * BIG ASSUMPTION: Addresses below 0x80000000 are assumed to be
> * in RAM, and addresses above 0x80000000 are assumed to be in
> * Flash. The cmpw instruction below does a signed integer
> * comparison, so when comparing a RAM address to a Flash address
> * the RAM address will always be greater. This allows the
> * relocation to work when the load address is in Flash.
> * r8 == load address
> */
> GETSYM(r4, start)
> GETSYM(r5, end)
> sub r6,r5,r4
> add r6,r8,r6 /* r6 == phys(load + size) */
> ===========================================================================
>
> I don't quite understand the assumption, i.e. addresses below
> 0x80000000 are RAM and above are Flash. Where is this assumption
> reflected in this Simple boot loader? For the board I am using,
> addresses below 0xFFE00100 are RAM and addresses above 0xFFEE00100 are
> Flash. How should I change the code (or Makefile?) according to my
> hardware spec?
Ignore this unless you have over 2 Gigs of RAM. This is just a easy way
to determine if the code is in RAM or Flash. Yes the flash is usually
above the 0xffe00000 region which is over 0x80000000, and unless you
have more that 2 gigs of RAM or your board maps ram from other than zero
physical address (both unlikely), then you can assume that this
assumtion is correct.
-- Steve
- Next message: Dan Kegel: "Re: Embedded linux with best developer tools?"
- Previous message: Michael Schnell: "Re: Linux 2.6 Kernel in Real-time Environment"
- In reply to: Frank: "Cannot call C function in "Simple" boot loader"
- Next in thread: Frank: "Re: Cannot call C function in "Simple" boot loader"
- Reply: Frank: "Re: Cannot call C function in "Simple" boot loader"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|