Download VxWorks®

Transcript
VxWorks 5.5
BSP Developer’s Guide
romInit( ) plus a small offset (see sysToMonitor( ) in sysLib.c). The romInit( )
routine disables interrupts, puts the boot type (cold/warm) on the stack, clears
caches, and branches to romStart( ) in bootInit.c. The stack is placed to begin
before the text section and grows in the opposite direction. The routine romInit( )
must do as little device setup as possible to start executing C code. Hardware
initialization is the function of the sysHwInit( ) routine in sysLib.c.
bootInit.c: romStart( )
The text and data segments are copied from ROM to RAM in these ways:
■
If the text segment is not ROM-resident, the text and data segments are copied.
■
If the text segment is ROM-resident, only the data segment is copied.
■
Unused memory is cleared to initialize it.
■
If necessary, decompression is done.
Atypically, the i960 invokes sysInit(bootType), which eventually invokes
usrInit(bootType), as on all other architectures.
sysALib.s: sysInit( )
VxWorks calls sysInit( ) in normal rebooting to avoid code redundancy, the i960
calls the routine during ROM initialization as well. The sysInit( ) routine, which
must always be the first routine defined in sysALib.s, invalidates caches if
applicable, initializes the system interrupt tables with default stubs, initializes the
system fault tables with default stubs, and initializes all the processor registers to
known default values. It enables tracing, clears all pending interrupts and finally
invokes usrInit(bootType).
This routine must duplicate the hardware initialization done by romInit( ). If not,
then features set up in the boot ROM code could transfer to the VxWorks image.
This is very undesirable as the configuration and initialization actions of the boot
ROM would have influence over the run-time VxWorks images. It would likely
result in the user rebuilding boot ROMs for configuration changes. It might also
result in the user having to use paired sets of boot ROMs and VxWorks images.
usrConfig.c and bootConfig.c: usrInit( )
The usrInit( ) routine (in usrConfig.c) saves information about the boot type,
handles all the initialization that must be performed before the kernel is actually
started, and then starts the kernel execution. It is the first C code to run in VxWorks.
It is invoked in supervisor mode with all hardware interrupts locked out.
34