public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] help me to port mbx860 ethernet
@ 2001-05-21  7:01 Nohee Ko
  2001-05-21  7:16 ` Gary Thomas
  2001-05-21  7:26 ` Jonathan Larmour
  0 siblings, 2 replies; 3+ messages in thread
From: Nohee Ko @ 2001-05-21  7:01 UTC (permalink / raw)
  To: ecos-discuss

hi.
I'm confused about routine below.
for (init_entry = __RedBoot_INIT_TAB__; init_entry !=
&__RedBoot_INIT_TAB_END__;  init_entry++) {
        (*init_entry->fun)();
    }
this routine are in /redboot/current/src/main.c .

what does this routine do?
It seems to do such like "RedBoot_init or things".
But I can't exactly understand this routine.
where is __RedBoot_INIT_TAB__,  _RedBoot_INIT_TAB_END__ ?
And what does "(*init_entry->fun)()" function do?

My board operates wrong when doing this routine ( actually right after
power on)
then, I can see weird message on my debug monitor.
==> +$T0540:fe00ef04;01:00004a8c;#b2

so please let me know about these things well.

thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [ECOS] help me to port mbx860 ethernet
  2001-05-21  7:01 [ECOS] help me to port mbx860 ethernet Nohee Ko
@ 2001-05-21  7:16 ` Gary Thomas
  2001-05-21  7:26 ` Jonathan Larmour
  1 sibling, 0 replies; 3+ messages in thread
From: Gary Thomas @ 2001-05-21  7:16 UTC (permalink / raw)
  To: Nohee Ko; +Cc: ecos-discuss

On 21-May-2001 Nohee Ko wrote:
> hi.
> I'm confused about routine below.
> for (init_entry = __RedBoot_INIT_TAB__; init_entry !=
> &__RedBoot_INIT_TAB_END__;  init_entry++) {
>         (*init_entry->fun)();
>     }
> this routine are in /redboot/current/src/main.c .
> 
> what does this routine do?
> It seems to do such like "RedBoot_init or things".
> But I can't exactly understand this routine.
> where is __RedBoot_INIT_TAB__,  _RedBoot_INIT_TAB_END__ ?
> And what does "(*init_entry->fun)()" function do?
> 

This is a set of initialization functions, built using the RedBoot_init()
macro.  Each entry in the table is just a function pointer.

> My board operates wrong when doing this routine ( actually right after
> power on)
> then, I can see weird message on my debug monitor.
> ==> +$T0540:fe00ef04;01:00004a8c;#b2

One way to figure out what's happening here is to use GDB.  Once this
error occurs, disconnect from your "terminal" environment (minicom, hyperterm, etc)
and connect using GDB.  Then GDB can let you see what's happening on the board.

  powerpc-eabi-gdb -nw install/bin/redboot.elf
  (gdb) set remotebaud 38400
  (gdb) tar rem /dev/ttyS0
  (gdb) info reg

Another way to find out more would be to add some 'print' statements to
the RedBoot loop:

    for (init_entry = __RedBoot_INIT_TAB__; 
         init_entry != &__RedBoot_INIT_TAB_END__;  init_entry++) {
        printf("Calling init - table: %p, fun: %p\n", init_entry, init_entry->fun);
        (*init_entry->fun)();
    }

> 
> so please let me know about these things well.
> 
> thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ECOS] help me to port mbx860 ethernet
  2001-05-21  7:01 [ECOS] help me to port mbx860 ethernet Nohee Ko
  2001-05-21  7:16 ` Gary Thomas
@ 2001-05-21  7:26 ` Jonathan Larmour
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Larmour @ 2001-05-21  7:26 UTC (permalink / raw)
  To: Nohee Ko; +Cc: ecos-discuss

Nohee Ko wrote:
> 
> hi.
> I'm confused about routine below.
> for (init_entry = __RedBoot_INIT_TAB__; init_entry !=
> &__RedBoot_INIT_TAB_END__;  init_entry++) {
>         (*init_entry->fun)();
>     }
> this routine are in /redboot/current/src/main.c .
> 
> what does this routine do?
> It seems to do such like "RedBoot_init or things".

Yes.

> But I can't exactly understand this routine.
> where is __RedBoot_INIT_TAB__,  _RedBoot_INIT_TAB_END__ ?

They get defined in redboot's main.c:

CYG_HAL_TABLE_BEGIN( __RedBoot_INIT_TAB__, RedBoot_inits );
CYG_HAL_TABLE_END( __RedBoot_INIT_TAB_END__, RedBoot_inits );
extern struct init_tab_entry __RedBoot_INIT_TAB__[],
__RedBoot_INIT_TAB_END__;

You can see the definition of CYG_HAL_TABLE_* in
hal/common/current/include. It manipulates ELF symbols.

> And what does "(*init_entry->fun)()" function do?

It iterates over the contents of the table, calling the function in each
one.
 
> My board operates wrong when doing this routine ( actually right after
> power on)
> then, I can see weird message on my debug monitor.
> ==> +$T0540:fe00ef04;01:00004a8c;#b2

This indicates your board hit an exception at 0xfe00ef04. Perhaps
disassemble your image using powerpc-eabi-objdump -d to find exactly where
this address is.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-05-21  7:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-21  7:01 [ECOS] help me to port mbx860 ethernet Nohee Ko
2001-05-21  7:16 ` Gary Thomas
2001-05-21  7:26 ` Jonathan Larmour

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).