public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] What is RedBoot_INIT_TAB,
@ 2001-05-31  8:35 Narayana, Venkat A.
  2001-05-31  8:54 ` Gary Thomas
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Narayana, Venkat A. @ 2001-05-31  8:35 UTC (permalink / raw)
  To: 'ecos-discuss@sources.redhat.com'

Hi,
I am trying to make a ROM startup for my XScale based board
and i am getting an error, while single-stepping this code, which is in
main.c/cyg_start fucn:

for (init_entry = __RedBoot_INIT_TAB__; init_entry !=
&__RedBoot_INIT_TAB_END__;  init_entry++) {
        (*init_entry->fun)();
    }

I found that RedBoot_INIT_TAB is defined, in CYG_HAL_TABLE_BEGIN macro,
but by the time i reach the above point, i.e cyg_start function, i haven't
seen anything
which is poulating this Table. So the question is, if no one is putting some
data(actual a 
function pointer), the why is it that we are calling init_entry->fun,
function?
Is there something i didn't understood or missed?
Could i choose to call this guy, only when the board is ' warm_reset'?

Your help is greatly appreciated.

Thanks in Advance,
Venkat N.

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

* RE: [ECOS] What is RedBoot_INIT_TAB,
  2001-05-31  8:35 [ECOS] What is RedBoot_INIT_TAB, Narayana, Venkat A.
@ 2001-05-31  8:54 ` Gary Thomas
  2001-05-31  9:03 ` Jonathan Larmour
  2001-05-31 10:02 ` [ECOS] Executable Size Carlos Camargo
  2 siblings, 0 replies; 10+ messages in thread
From: Gary Thomas @ 2001-05-31  8:54 UTC (permalink / raw)
  To: Narayana, Venkat A.; +Cc: ecos-discuss

On 31-May-2001 Narayana, Venkat A. wrote:
> Hi,
> I am trying to make a ROM startup for my XScale based board
> and i am getting an error, while single-stepping this code, which is in
> main.c/cyg_start fucn:
> 
> for (init_entry = __RedBoot_INIT_TAB__; init_entry !=
> &__RedBoot_INIT_TAB_END__;  init_entry++) {
>         (*init_entry->fun)();
>     }
> 
> I found that RedBoot_INIT_TAB is defined, in CYG_HAL_TABLE_BEGIN macro,
> but by the time i reach the above point, i.e cyg_start function, i haven't
> seen anything
> which is poulating this Table. So the question is, if no one is putting some
> data(actual a 
> function pointer), the why is it that we are calling init_entry->fun,
> function?

This table is filled in using the RedBoot_init() macro.  E.g. this is used
by the network initialization code in the file "redboot/current/src/net/net_io.c"

Depending on your configuration, you may or not have any entries in the table.

I'd suggest that you put some prints around the call and see what it's calling
and whether or not it gets back.  For example:

        printf("Calling %p/%p\n", init_entry, init_entry->fun);
        (*init_entry->fun)();
        printf("Back\n");

The extra value printed (init_entry) is to see whether or not things are properly
aligned.  This particular table has only 4 byte entries, but I've seen the compiler
do funny things like try and align table elements on 16 byte boundaries, etc.

> Is there something i didn't understood or missed?
> Could i choose to call this guy, only when the board is ' warm_reset'?

No, it needs to be there always.

Please run the test I've outlined. Let us know what happens.

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

* Re: [ECOS] What is RedBoot_INIT_TAB,
  2001-05-31  8:35 [ECOS] What is RedBoot_INIT_TAB, Narayana, Venkat A.
  2001-05-31  8:54 ` Gary Thomas
@ 2001-05-31  9:03 ` Jonathan Larmour
  2001-05-31 10:02 ` [ECOS] Executable Size Carlos Camargo
  2 siblings, 0 replies; 10+ messages in thread
From: Jonathan Larmour @ 2001-05-31  9:03 UTC (permalink / raw)
  To: Narayana, Venkat A.; +Cc: 'ecos-discuss@sources.redhat.com'

"Narayana, Venkat A." wrote:
> 
> Hi,
> I am trying to make a ROM startup for my XScale based board
> and i am getting an error, while single-stepping this code, which is in
> main.c/cyg_start fucn:
> 
> for (init_entry = __RedBoot_INIT_TAB__; init_entry !=
> &__RedBoot_INIT_TAB_END__;  init_entry++) {
>         (*init_entry->fun)();
>     }
> 
> I found that RedBoot_INIT_TAB is defined, in CYG_HAL_TABLE_BEGIN macro,
> but by the time i reach the above point, i.e cyg_start function, i haven't
> seen anything
> which is poulating this Table. So the question is, if no one is putting some
> data(actual a
> function pointer), the why is it that we are calling init_entry->fun,
> function?
> Is there something i didn't understood or missed?
> Could i choose to call this guy, only when the board is ' warm_reset'?

Look for the RedBoot_init macro. You'll find instances in redboot and
probably some drivers.

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
<advert> Come to the Red Hat TechWorld open source conference in Brussels!
Keynotes, techie talks and exhibitions    http://www.redhat-techworld.com/

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

* [ECOS] Executable Size
  2001-05-31  8:35 [ECOS] What is RedBoot_INIT_TAB, Narayana, Venkat A.
  2001-05-31  8:54 ` Gary Thomas
  2001-05-31  9:03 ` Jonathan Larmour
@ 2001-05-31 10:02 ` Carlos Camargo
  2001-05-31 10:15   ` Jonathan Larmour
  2 siblings, 1 reply; 10+ messages in thread
From: Carlos Camargo @ 2001-05-31 10:02 UTC (permalink / raw)
  To: Narayana, Venkat A., 'ecos-discuss@sources.redhat.com'

Hi all.

I have a question:

I have arm evaluator 7t, i build ecos:

ecosconfig new e7t
ecosconfig tree
make

The Makefile is:

PKG_INSTALL_DIR = /root/ecos-work/install
XCC = arm-elf-gcc -mcpu=arm7di                        
ifeq ($(XCC),sh-elf-gcc)
#CFLAGS        = -ggdb
else
#CFLAGS        = -g
CFLAGS		= -static
endif

CXXFLAGS      = $(CFLAGS)

EXTRACFLAGS   = -Wall -I$(PKG_INSTALL_DIR)/include
-ffunction-sections -fdata-sections

EXTRACXXFLAGS = $(EXTRACFLAGS) -fno-exceptions
-fno-rtti -fvtable-gc -finit-priority

LDFLAGS       = -nostartfiles -L$(PKG_INSTALL_DIR)/lib
-Wl,--gc-sections
LIBS          = -Ttarget.ld -nostdlib

LD            = $(XCC)
XCXX          = $(XCC)



When i compile the hello world example the executable
size is 1.1M, is this posible??? How i Can erase
drivers for ecos in linux???

Thanks

Carlos Camargo


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

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

* Re: [ECOS] Executable Size
  2001-05-31 10:02 ` [ECOS] Executable Size Carlos Camargo
@ 2001-05-31 10:15   ` Jonathan Larmour
  2001-05-31 10:45     ` Carlos Camargo
  0 siblings, 1 reply; 10+ messages in thread
From: Jonathan Larmour @ 2001-05-31 10:15 UTC (permalink / raw)
  To: Carlos Camargo; +Cc: 'ecos-discuss@sources.redhat.com'

> 
> When i compile the hello world example the executable
> size is 1.1M, is this posible??? 

The executable size may be 1.1M, but that's because of debug information.
Use arm-elf-size on the executable to get the true size.

But you're correct that more unnecessary stuff could be stripped out by
judicious configuration of eCos using the Configuration Tool. But that's up
to you. At least, the situation is not what you think anyway.

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
Come to the Red Hat TechWorld open source conference in Brussels!
Keynotes, techie talks and exhibitions    http://www.redhat-techworld.com/

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

* Re: [ECOS] Executable Size
  2001-05-31 10:15   ` Jonathan Larmour
@ 2001-05-31 10:45     ` Carlos Camargo
  2001-05-31 11:26       ` Jonathan Larmour
  0 siblings, 1 reply; 10+ messages in thread
From: Carlos Camargo @ 2001-05-31 10:45 UTC (permalink / raw)
  To: Jonathan Larmour; +Cc: 'ecos-discuss@sources.redhat.com'

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1218 bytes --]

Hi..
Jonathan thanks for your answer..

When i compile the twothreads example:

arm-elf-gcc -mcpu=arm7di -c -o twothreads.o -g -Wall
-I/root/ecos-work/install/include -ffunction-sections
-fdata-sections twothreads.c
arm-elf-gcc -mcpu=arm7di -nostartfiles
-L/root/ecos-work/install/lib -Wl,--gc-sections -o
twothreads twothreads.o -Ttarget.ld -nostdlib  


and i execute arm-elf-size twothreads:

   text	   data	    bss	    dec	    hex	filename
  45880	   1956	  23544	  71380	  116d4	twothreads

When i Buils whitout "-g" option 


arm-elf-gcc -mcpu=arm7di -c -o twothreads.o -static
-Wall -I/root/ecos-work/install/include
-ffunction-sections -fdata-sections twothreads.c
arm-elf-gcc -mcpu=arm7di -nostartfiles
-L/root/ecos-work/install/lib -Wl,--gc-sections -o
twothreads twothreads.o -Ttarget.ld -nostdlib 


   text	   data	    bss	    dec	    hex	filename
  45880	   1956	  23544	  71380	  116d4	twothreads

But, i don`t understand this information, when i use
man size don´t provide information about this format

Thanks Carlos Camargo



__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

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

* Re: [ECOS] Executable Size
  2001-05-31 10:45     ` Carlos Camargo
@ 2001-05-31 11:26       ` Jonathan Larmour
  0 siblings, 0 replies; 10+ messages in thread
From: Jonathan Larmour @ 2001-05-31 11:26 UTC (permalink / raw)
  To: Carlos Camargo; +Cc: 'ecos-discuss@sources.redhat.com'

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 935 bytes --]

Carlos Camargo wrote:
> 
>    text    data     bss     dec     hex filename
>   45880    1956   23544   71380   116d4 twothreads
> 
> But, i don`t understand this information, when i use
> man size don´t provide information about this format

Try "info size" which is a little bit better.

But basically, text==code, and data+bss==your program data. This totals
71380 bytes in this case (rather large for such a simple case, but easily
reduced by tailoring your eCos configuration if you choose).

For a program programmed into ROM/Flash, you would find the total ROM usage
to be text+data, and the total RAM usage to be data+bss.

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
Come to the Red Hat TechWorld open source conference in Brussels!
Keynotes, techie talks and exhibitions    http://www.redhat-techworld.com/

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

* Re: [ECOS] What is RedBoot_INIT_TAB,
  2001-06-21  8:51 [ECOS] What is RedBoot_INIT_TAB, Narayana, Venkat A.
  2001-06-21  8:59 ` Gary Thomas
@ 2001-06-21 12:02 ` Jonathan Larmour
  1 sibling, 0 replies; 10+ messages in thread
From: Jonathan Larmour @ 2001-06-21 12:02 UTC (permalink / raw)
  To: Narayana, Venkat A.
  Cc: 'Gary Thomas', 'ecos-discuss@sources.redhat.com'

"Narayana, Venkat A." wrote:
> 
> Hi Gary,
> 
> > >
> > > for (init_entry = __RedBoot_INIT_TAB__; init_entry !=
> > > &__RedBoot_INIT_TAB_END__;  init_entry++) {
> > >         (*init_entry->fun)();
> > >     }
> > >
> > > I found that RedBoot_INIT_TAB is defined, in
> >
> > This table is filled in using the RedBoot_init() macro.  E.g.
> > this is used
> > by the network initialization code in the file
> > "redboot/current/src/net/net_io.c"
> >
> > Depending on your configuration, you may or not have any
> > entries in the table.
> 
> RedBoot_init macro, defines 'struct init_tab_entry' variable in
> 'ecos.table' section. Pls correct me here...my understanding is that
> RedBoot_init(net_init, RedBoot_INIT_LAST) expands into
>   "struct init_tab_entry _init_tab_9999net_init", where this struct
>    has 1 member, which is a function ptr.
> I am going thru the redboot/src/net files, but i am unable to find
> any place, from where _init_tab_9999net_init->net_init is called.
> i.e, who calls net_init and from where?

It gets put in a special section (courtesy of the HAL table magic), which
is iterated through on line 226 of redboot's main.c.

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
Come to the Red Hat TechWorld open source conference in Brussels!
Keynotes, techie talks and exhibitions    http://www.redhat-techworld.com/

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

* RE: [ECOS] What is RedBoot_INIT_TAB,
  2001-06-21  8:51 [ECOS] What is RedBoot_INIT_TAB, Narayana, Venkat A.
@ 2001-06-21  8:59 ` Gary Thomas
  2001-06-21 12:02 ` Jonathan Larmour
  1 sibling, 0 replies; 10+ messages in thread
From: Gary Thomas @ 2001-06-21  8:59 UTC (permalink / raw)
  To: Narayana, Venkat A.; +Cc: ecos-discuss

On 21-Jun-2001 Narayana, Venkat A. wrote:
> Hi Gary,
> 
>> > 
>> > for (init_entry = __RedBoot_INIT_TAB__; init_entry !=
>> > &__RedBoot_INIT_TAB_END__;  init_entry++) {
>> >         (*init_entry->fun)();
>> >     }
>> > 
>> > I found that RedBoot_INIT_TAB is defined, in 
>> 
>> This table is filled in using the RedBoot_init() macro.  E.g. 
>> this is used
>> by the network initialization code in the file 
>> "redboot/current/src/net/net_io.c"
>> 
>> Depending on your configuration, you may or not have any 
>> entries in the table.
> 
> RedBoot_init macro, defines 'struct init_tab_entry' variable in
> 'ecos.table' section. Pls correct me here...my understanding is that
> RedBoot_init(net_init, RedBoot_INIT_LAST) expands into
>   "struct init_tab_entry _init_tab_9999net_init", where this struct
>    has 1 member, which is a function ptr.
> I am going thru the redboot/src/net files, but i am unable to find
> any place, from where _init_tab_9999net_init->net_init is called.
> i.e, who calls net_init and from where?

It's never called by name - that's the whole point of using tables.
The call happens in the main initialization, in the code fragment
quoted above.

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

* RE: [ECOS] What is RedBoot_INIT_TAB,
@ 2001-06-21  8:51 Narayana, Venkat A.
  2001-06-21  8:59 ` Gary Thomas
  2001-06-21 12:02 ` Jonathan Larmour
  0 siblings, 2 replies; 10+ messages in thread
From: Narayana, Venkat A. @ 2001-06-21  8:51 UTC (permalink / raw)
  To: 'Gary Thomas'; +Cc: 'ecos-discuss@sources.redhat.com'

Hi Gary,

> > 
> > for (init_entry = __RedBoot_INIT_TAB__; init_entry !=
> > &__RedBoot_INIT_TAB_END__;  init_entry++) {
> >         (*init_entry->fun)();
> >     }
> > 
> > I found that RedBoot_INIT_TAB is defined, in 
> 
> This table is filled in using the RedBoot_init() macro.  E.g. 
> this is used
> by the network initialization code in the file 
> "redboot/current/src/net/net_io.c"
> 
> Depending on your configuration, you may or not have any 
> entries in the table.

RedBoot_init macro, defines 'struct init_tab_entry' variable in
'ecos.table' section. Pls correct me here...my understanding is that
RedBoot_init(net_init, RedBoot_INIT_LAST) expands into
  "struct init_tab_entry _init_tab_9999net_init", where this struct
   has 1 member, which is a function ptr.
I am going thru the redboot/src/net files, but i am unable to find
any place, from where _init_tab_9999net_init->net_init is called.
i.e, who calls net_init and from where?

Thanks and Regards
Venkat N

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

end of thread, other threads:[~2001-06-21 12:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-31  8:35 [ECOS] What is RedBoot_INIT_TAB, Narayana, Venkat A.
2001-05-31  8:54 ` Gary Thomas
2001-05-31  9:03 ` Jonathan Larmour
2001-05-31 10:02 ` [ECOS] Executable Size Carlos Camargo
2001-05-31 10:15   ` Jonathan Larmour
2001-05-31 10:45     ` Carlos Camargo
2001-05-31 11:26       ` Jonathan Larmour
2001-06-21  8:51 [ECOS] What is RedBoot_INIT_TAB, Narayana, Venkat A.
2001-06-21  8:59 ` Gary Thomas
2001-06-21 12:02 ` 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).