
2 Overview of a BSP
2.2 Boot Sequence
19
2
allocated to the system memory pool, which is managed by memPartLib.
All cached dynamic allocations are derived from this memory pool.
– the top of cached memory as indicated by sysMemTop( )
– the interrupt stack size. The interrupt stack corresponds to the largest
amount of stack space that can be used by any interrupt-level routine that
may be called, plus a safety margin for the nesting of interrupts.
– the interrupt lockout level. For architectures that have a level concept, it is
the maximum level. For architectures that do not have a level concept, it is
the mask to disable interrupts. For more details, see the appropriate
VxWorks Architecture Supplement.
Step 5: Execute kernelInit( )
The kernelInit( ) routine is provided by Wind River in a VxWorks library archive
file. The purpose of this routine is to get the kernel up and running so that all
further initialization can be done as a task running under the kernel. The name of
this task is tRootTask, and the routine it executes is typically usrRoot( ).
The kernelInit( ) routine calls intLockLevelSet( ), disables round-robin
scheduling mode, and creates an interrupt stack (if supported by the architecture).
The routine then creates a root stack and a task control block (
TCB) from the top
of the memory pool, spawns the root thread usrRoot( ), and terminates the
usrInit( ) thread of execution. At this time, interrupts are enabled. It is critical that
all interrupt sources be disabled by usrInit( ), and that all pending interrupts be
cleared. Failure to do so causes system failure as described in Creating Additional
Diagnostic Routines, p.62.
Step 6: Execute usrRoot( ) as a task
The purpose of the usrRoot( ) routine is to complete the initialization of the kernel
and all hardware, then launch any application code. This routine is supplied by
Wind River in the usrConfig.c file, and the original copy should not be changed.
During development, usrConfig.c is often temporarily copied to the BSP directory,
and debugging changes are made to the temporary copy. usrConfig.c is also
configurable with the macros defined in config.h.
The usrRoot( ) routine calls the memInit( ) routine. Optionally, usrRoot( ) can call
the memShowInit( ) and usrMmuInit( ) routines.
Once the system is multitasking, the BSP calls its first routine, sysClkConnect( ).
sysClkConnect( ) immediately calls the sysHwInit2( ) routine. sysHwInit2( ) is
NOTE: Do not use a custom version of usrConfig.c in your final BSP.
Comentarios a estos manuales