Where exactly do system initialization handlers get registered?

Chris Johns chrisj at rtems.org
Sun Apr 3 06:10:56 UTC 2016


On 2/04/2016 6:05 AM, Joel Sherrill wrote:
> On Apr 1, 2016 1:29 PM, "Travis Wheatley" <travis.wheatley at emergentspace.com>
> wrote:
>> So.... other than looking at all uses of RTEMS_SYSINIT_ITEM in the entire
>> source tree and attempting to guess which ones are a part of the _Sysinit
>> group, is there a better way of identifying those bits of code?
>
> Objdump the special section for the actual list.
>
> But if printk is working, just print the address of the method before it is
> invoked. Then you can look that up.

This is not very user friendly. As a result I have just added a new 
command to the linkers section of The RTEMS Tools Project 
(rtems-tools.git). It is only available in git so you will need to clone 
and build by hand. A full tools rebuild of 4.12 with the RSB should pick 
it up.

The command is called 'rtems-exeinfo' and it only has a couple of 
options, -S and -I or you could use -a. On the hello.exe for a PC bsp I get:

  $ rtems-exeinfo -I \
   i386-rtems4.12/c/pc686/testsuites/samples/hello/hello.exe
RTEMS Executable Info 4.12.c81066f67f0e_modified
  rtems-exeinfo -I \
   i386-rtems4.12/c/pc686/testsuites/samples/hello/hello.exe
exe: i386-rtems4.12/c/pc686/testsuites/samples/hello/hello.exe
Init sections: 2
  .ctors
   0xffffffff RamSize
   0x00000000 rtems_i8259_masks
  .rtemsroset
   0x00100280 bsp_work_area_initialize
   0x001003b0 bsp_start_default
   0x001135b0 _User_extensions_Handler_initialization
   0x0010e3e0 rtems_initialize_data_structures
   0x0010e190 _RTEMS_tasks_Manager_initialization
   0x00115b20 _Message_queue_Manager_initialization
   0x00115040 _Semaphore_Manager_initialization
   0x00114e70 _POSIX_Keys_Manager_initialization
   0x00111c30 _Thread_Create_idle
   0x00114a30 rtems_libio_init
   0x001089b0 rtems_filesystem_initialize
   0x00100390 bsp_predriver_hook
   0x0010e4a0 _IO_Initialize_all_drivers
   0x0010dfd0 _RTEMS_tasks_Initialize_user_tasks_body
   0x00114c30 rtems_libio_post_driver

Warning, I think the tool needs some endian testing and work.

Notes:
  1. It would be nice to show the configuration tables.
  2. Only on 4.12, ie master.
  3. Source is
      https://git.rtems.org/rtems-tools/tree/linkers/rtems-exeinfo.cpp

Chris



More information about the users mailing list