Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • In our case, the boot code starts at startup
    • Other names are start, download_entry and __rtems_entry_point
  • 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 (question) 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 ((question) overwrites r2?)
  • Set up initial stack
  • Set up argument registers r3, r4 and r5
  • Branch to boot_card()

boot_card()

...

While the RTEMS structure provides for allowing this function to be supplied by the RTEMS BSP, we use the version that the distribution comes with. It is found in the $RTEMS_ROOT/src/c/src/lib/libbsp/shared directory called bootcard.c.

In the following, functions prefixed with bsp_ are supplied by the RTEMS BSP.

  • Command line is in first argument
    • In our system this is always a null pointer
  • Disable interrupts
  • Store command line
  • Call 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 bsp_pretasking_hook()
  • Wiki Markup
    \[Enable RTEMS debugging capabilities\]
  • RTEMS initialization before loading device drivers
  • Call bsp_predriver_hook()
  • Initialize device drivers
  • Call bsp_postdriver_hook()
  • Start multitasking
    • Thread with entry point Init runs
    • Not clear how this returns. Perhaps when the last task is deleted?
  • Call bsp_cleanup()
  • Return to start code
    • Not clear what's in the lr at this point, i.e., where do we return to?

...