RAM 6.0 BUX II Series Guía de usuario Pagina 73

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 189
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 72
3 Porting a BSP to Custom Hardware
3.2 Getting a Minimal Kernel Running
65
3
Initializing All Image Types
The remainder of the initialization code is common to both ROM- and RAM-based
images.
usrConfig.c: usrInit( )
From a BSP writer’s point of view, the main significance of usrInit( ) is that it clears
the bss segment so that uninitialized C global variables are now zero, and then calls
sysHwInit( ) (in sysLib.c) to initialize the hardware. If memory is set up properly,
there is little that can go wrong in this routine.
sysLib.c: sysHwInit( )
This is the heart of the BSP initialization code. This routine must reset all hardware
to a quiescent state so as not to generate uninitialized interrupts later when
interrupts are enabled.
Note that it is not sufficient to manipulate the processor’s interrupt mask. In the
general case, it is possible for multiple devices to be connected to the same
interrupt line. If this is the case, disabling the interrupt controller for that interrupt
line prevents interrupts at the time sysHwInit( ) is executing. However, when
interrupts are enabled later, or when the first device connected to a given interrupt
line is enabled, other devices using the same interrupt line may cause
unacknowledged interrupts, resulting in a system failure.
usrConfig.c: usrInit( )
After sysHwInit( ) completes, control returns to usrInit( ). The last task usrInit( )
performs is a call to kernelInit( ) to start the VxWorks kernel. This is the end of the
pre-kernel initialization code. The kernelInit( ) routine does not return. Rather, it
starts the kernel with usrRoot( ) as the first task.
At this point, if you want to bring the kernel up under control of the WDB agent,
you can start the agent. This is an optional step and is not typically performed. For
more information, see 3.2.5 Starting the WDB Agent Before the Kernel, p.66.
kernelInit( )
The kernelInit( ) routine source code is not normally available during BSP
development. Instead, the object module is extracted from a library. Because of
this, the source code cannot be modified to add debugging information.
However, kernelInit( ) is very important during BSP development because, deep
within the kernelInit( ) routine, interrupts are finally enabled. A very common
Vista de pagina 72
1 2 ... 68 69 70 71 72 73 74 75 76 77 78 ... 188 189

Comentarios a estos manuales

Sin comentarios