[ECOS] Redboot manual question? Thank you

HuangQiang jameshq@liverpool.ac.uk
Thu May 2 02:08:00 GMT 2002


>The vectors startup code copies appropriate pointers from the "vectors"
>section of your executable into the "fixed_vectors" (at 0x20).  These
>are pointers used by the absolute code at 0x0..0x1F.  Most of them
>simply jump indirect via a pointer somewhere else.  In the case of
>your executable, this would be somewhere in your code which got loaded
>at 0x10000.  The instruction at 0x18 looks like this
>  0x18:   ldr     pc, [pc, #18]   ; 0x38
>where location 0x38 gets filled in with the pointer from your program
>when it starts up.

Thanks for your reply.

As said in the vectors.s (below)

//==========================================================================
// Hardware exception vectors.
//   This entire section will be copied to location 0x0000 at startup time.
//
        .code   32
        .section ".vectors","ax"

the entire vectors section will be copied to location 0x0000 at startup
time, how this could be done? I use arm-elf-objdump and looked into the list
and saw(user program RAM startup) the code start from 0x10000 as set in the
memory layout 0x10000. So how could the vector table be copied into 0x0000?
(As said in the email:
  >The vectors startup code copies appropriate pointers from the "vectors"
 >section of your executable into the "fixed_vectors" (at 0x20).)
)
When the user program is loadded by redboot and it start from
vectors.s(branch to the reset_vector as the first line) and then start
excuting the user program. How is the vector table copied to 0x00(RAM)? Is
this done by the redboot or the user program?


//==========================================================================
// Hardware exception vectors.
//   This entire section will be copied to location 0x0000 at startup time.
//
        .code   32
        .section ".vectors","ax"


Thanks a lot and look forward to your reply.



-----Original Message-----
From: Gary Thomas [mailto:gthomas@redhat.com]
Sent: 01 May 2002 19:06
To: HuangQiang
Cc: eCos Discussion
Subject: Re: [ECOS] Redboot manual question? Thank you


On Wed, 2002-05-01 at 10:40, HuangQiang wrote:
>
> hi all:
>    As been said in the redboot manual for ARM E7T board page 62:
> RedBoot also reserves RAM(0x00000000 ~ 0x0000bfff) for RedBoot runtime
uses.
> So when download the ecos user program via arm-elf-gdb a.out -> load ->
> continue. then where will be the user program loadded to?(what location in
> RAM?) But the ecos user program also setup the vector table in vectors.s
> file. If the ecos user program is not loadded into RAM 0x00, how will
these
> vector table be used?(for example: ecos user program loadded into 0x10000,
> then when a IRQ occurs, ARM processor will fetch the IRQ from 0x18, but
now
> the vector table is located somewhere after 0x10000 (RAM)(coz the ecos
user
> program with the vector table (in vectors.s) is loadded into 0x10000 RAM)
> How can this happens?

A quick look at arm/vectors.S would help.

The vectors startup code copies appropriate pointers from the "vectors"
section of your executable into the "fixed_vectors" (at 0x20).  These
are pointers used by the absolute code at 0x0..0x1F.  Most of them
simply jump indirect via a pointer somewhere else.  In the case of
your executable, this would be somewhere in your code which got loaded
at 0x10000.  The instruction at 0x18 looks like this
  0x18:   ldr     pc, [pc, #18]   ; 0x38
where location 0x38 gets filled in with the pointer from your program
when it starts up.


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss



More information about the Ecos-discuss mailing list