...
- In our case, the boot code starts at
startup
- Other names are
start
,download_entry
and__rtems_entry_point
- Other names are
- Boot code vaguely follows the "Initialization Software Requirements" outlined in the PowerPPC 440x5 Embedded Processor Core User's Manual v7.1 from IBM
- Why only "vaguely"?
- Clear MSR
- Disable debug events
- Configure instruction and data cache registers
- Set up decrementer and timer registers
- Clear exception registers ECR and XER
- Invalidate instruction and data caches
- Clear the CPU reservation bit
- Set up CCR0, CCR1, MMUCR, CRF
and CTR
- Set up TLB pages
- Set up debug events
- Set up EABI and SYSV environment
- Clear out BSS section
- Load vector offset register
- Set up TOC (
overwrites r2?)
- Set up initial stack
- Set up argument registers r3, r4 and r5
- Branch to ~claus:
boot_card()
boot_card()
- Command line is in first argument
- In our system this is always a null pointer
- Disable interrupts
- Store command line
- Call ~claus:
bsp_start()
- Determine RTEMS work area and heap location and size
- Initialize RTEMS data structures
- Initialize the C library
- This also installs the heap
- Call ~claus:
bsp_pretasking_hook()
Wiki Markup \[~claus:Enable RTEMS debugging capabilities\]
- RTEMS initialization before loading device drivers
- Call ~claus:
bsp_predriver_hook()
- Initialize device drivers
- Call ~claus:
bsp_postdriver_hook()
- Start multitasking
- Thread with entry point ~claus:
Init
runs - Not clear how this returns. Perhaps when the last task is deleted?
- Thread with entry point ~claus:
- Call ~claus:
bsp_cleanup()
- Return to start code
- Not clear what's in the
lr
at this point, i.e., where do we return to?
- Not clear what's in the
...
bsp_start()
- Set up default character output function
- Get CPU type and revision cached
- Initialize device driver parameters
- Rate of timer source for
clock.c
bsp_timer_internal_clock
bsp_timer_average_overhead
bsp_timer_least_valid
- Rate of timer source for
- Initialize default raw exception handlers
- Call ~claus:
app_bsp_start()
bsp_pretasking_hook()
bsp_predriver_hook()
bsp_postdriver_hook()
- Call
rtems_libio_supp_helper()
to open/dev/console
forstdin
,stdout
andstderr
, if it exists - Call ~claus:
app_bsp_postdriver_hook()
- Call
bsp_cleanup()
RCE BSP
app_bsp_start()
- Replace the character output function with one that writes to the
syslog
- Replace the character output function with one that writes to the
app_bsp_pretasking_hook()
- Initialize ~claus:
RceDebug
- Initialize ~claus:
RcePic
- Initialize ~claus:
app_bsp_predriver_hook()
- Initialize ~claus:
RceEthernet
- Initialize ~claus:
RceBsdnet
- Initialize ~claus:
app_bsp_postdriver_hook()
app_bsp_cleanup()
...