Cross gcc Mailing List Archive

[Prev][Next][Index][Thread]

Re: RTEMS questions



>> Having got this far, cdtest runs but the global constructors aren't 
>> getting their printfs executed. The instantiation order reported by 
>> the non-global instances constructors show that they have been 
>> called.

Joel> Tony will correct me if I am wrong. :)  But it is possible they are 
Joel> running but the C library and/or console device driver are not 
Joel> initialized yet so the messages could be dropping on the floor.  You 
Joel> might want to try setting a boolean to indicate the code ran and dump it 
Joel> after the system is completely up. 

I've found it helpful to try to maintain an ordered list in bspstart.c
of what gets init'd when, especially since some of the interesting stuff
(in our case at least) gets run from various rtems hooks (eg: postdriver).

This is an abbreviated version of startup ordering.

 *  crt0 code
 *
 *      clear bss
 *  
 *      bsp_start()
 *          floss_interrupt_init()
 *
 *          debugger_init()
 *          bsp_write_protect_code()
 *
 *          floss_init()
 *
 *          rtems_libio_config()
 *
 *          rtems_initialize_executive_early()
 *              _CPU_Initialize()
 *              _Debug_Manager_initialization();
 *              _API_extensions_Initialization();
                    ...
 *              (*cpu_table->pretasking_hook)();
 *                  bsp_pretasking_hook()
 *                      bsp_libc_init();
 *                          allocate heap
 *                          RTEMS_Malloc_Initialize()
 *                          rtems_libio_init();
 *                          libc_init()
 *                      floss_symbol_init_all();
 *                      floss_loader_copy_all()
 *                  atexit(bsp_cleanup);
 *                  Stack_check_Initialize();
 *
 *              _Thread_Create_idle();
 *
 *              _MPCI_Create_server();
 *
 *              _API_extensions_Run_predriver();
 *
 *              (*_CPU_Table.predriver_hook)();
 *                   NULL
 *
 *              _IO_Initialize_all_drivers();
 *                   floss_tty_initialize();
 *
 *              if ( _System_state_Is_multiprocessing )
 *                  _MPCI_Initialization();
 *                      Shm_Initialization()
 *                  _MPCI_Internal_packets_Send_process_packet();
 *
 *              _API_extensions_Run_postdriver();
 *
 *              (*_CPU_Table.postdriver_hook)();
 *                  bsp_postdriver_hook()
 *                      floss_tty_server_setup();
 *                      __open(STDIN)
 *                      __open(STDOUT)
 *                      __open(STDERR)
 *
 *              install external interrupt handler
 *              floss_init_late();
 *                  floss_genie_init_late();
 *                      floss_genie_hwsim_init_all();
 *                  floss_query_init_all();
 *                  floss_chunk_init()
 *                  if ( floss_cpu() == 0 )
 *                      floss_loader_send_run_reply();
 *      main()
 *          __main()
 *
 *          	<<global constructors>>
 *
 *          rtems_initialize_executive_late();
 *              _System_state_Set( SYSTEM_STATE_BEGIN_MULTITASKING );
 *              _Thread_Start_multitasking();
 *
 *                     ... apps run here ...
 *
 *              _ISR_Enable( bsp_level );
 *      
 *          <<global destructors>>
 *
 *      bsp_cleanup()
 *          malloc_dump()
 *          floss_tty_flush_all()
 *          floss_done()
 *          floss_clock_exit()
 *


References:

Home | Subject Index | Thread Index