Re: [uClinux-dev] do_initcalls() where is vmlinuz set up to populate between __initcall_start to end

2007-10-16 Thread Phil Wilshire

HI John,

A simple way to do this is to use the module_init macro

static int __init my_init_stuff(void)
{
return 0;
}

module_init(my_init_stuff);

You can see all the init calls as they happen
using the initcall_debug command line option

root=/dev/mtdblock0 rw initcall_debug=1 ...

Or by setting the variable ( just as a test)

initcall_debug to 1 in

init/main.c

Regards
  Phil Wilshire



[EMAIL PROTECTED] wrote:

[EMAIL PROTECTED] wrote on 2007-10-15 06:03:59 PM:


On Monday 15 October 2007, [EMAIL PROTECTED] wrote:
Yes I have puzzled through this and read a lot of material and code 

but

have not quite found this answer.
you're wondering how the initcall mechanism works and how to use it 

yourself ?

-mike


Mike

Absolutely!

I see most of how the initcall mechanism works.  I have read through 
Christopher Hallinan's book, Embedded Linux Primer and followed the init 
thread
through ~/init/main.c and ~/include/init.h for ARM (he doesn't show a full 
working example, I guess you buy Montevista for that.)but am having no 
luck having the linker pick up the __setup_parameter macro by itself.


as in static init __init bjcs_leds().

I guess I need to rule out is there a linker thing to do extra seemingly 
not.

Do I have to have to have the module in a favorite place?
Did I screw up my syntax? (Highest probability!)

In your code on blackfin is there a good example?

Thanks John

(P.S. I have presented as 20/20 hindsight I should have taken your 
course.)

___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev



___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] do_initcalls() where is vmlinuz set up to populate between __initcall_start to end

2007-10-16 Thread John . Jeffers
Thanks I am getting closer.

The debug does not work for 2.4.32-uc0 I did stick a printk in 
do_initcalls() to show the called addresses of the modules which works.
Is there a best place in the file structure (on the host) 2.4.32-uc0 to 
put the static int __init my_init_stuff()
so link picks up the module_init macro.
Cheers John

 HI John,
 
 A simple way to do this is to use the module_init macro
 
 static int __init my_init_stuff(void)
 {
return 0;
 }
 
 module_init(my_init_stuff);
 
 You can see all the init calls as they happen
 using the initcall_debug command line option
 
 root=/dev/mtdblock0 rw initcall_debug=1 ...
 
 Or by setting the variable ( just as a test)
 
 initcall_debug to 1 in
 
 init/main.c
 
 Regards
Phil Wilshire
 

___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


[uClinux-dev] do_initcalls() where is vmlinuz set up to populate between __initcall_start to end

2007-10-15 Thread John . Jeffers
Hi 

Yes I have puzzled through this and read a lot of material and code but 
have not quite found this answer.

With 20070130-dist 2.4.32 and uClib on a Coldfire m5235 board with some 
special kernel/driver modules for LEDs etc.

For the ram between __initcall_start and end to populate with the calls to 
the devices with the *__initcall Macro's to load into the ram section.

1) does one have to put the module in a special place? (I suspect not)

2) It is obvious that the MTD driver is one of these and I have not quite 
found where the directive to ld is for it in the scripts.  Perhaps it is 
enough for it to just compile and link and *__initcall does the rest?

3) If not where is the piece of script? that gathers all of these.

4) Is it better simply to add a call to initialize the module in a similar 
fashion to the timers in main.c.

What do other people do for these cases? Anyway the printk's in what I 
presume is a correctly formulated module do not announce themselves as 
MTD's do. 

Thanks Ahead of time!

Cheers John
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev


Re: [uClinux-dev] do_initcalls() where is vmlinuz set up to populate between __initcall_start to end

2007-10-15 Thread Mike Frysinger
On Monday 15 October 2007, [EMAIL PROTECTED] wrote:
 Yes I have puzzled through this and read a lot of material and code but
 have not quite found this answer.

you're wondering how the initcall mechanism works and how to use it yourself ?
-mike


signature.asc
Description: This is a digitally signed message part.
___
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev