This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: help me to port mbx860 ethernet



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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]