
3 Porting a BSP to Custom Hardware
3.2 Getting a Minimal Kernel Running
67
3
ROM as early as possible and thus save download cycles. In this case, starting the
WDB agent before the kernel is desirable.
Keep in mind, there are several disadvantages to starting the agent before the
kernel. These are:
■
Once the hardware initialization code is written, bringing up the kernel takes
less time than bringing up the agent. Because most developers consider a
working kernel to be the more significant milestone, they usually start with the
kernel.
■
Starting the agent before the kernel is not a significant help to getting the basic
kernel working. This is because the basic kernel adds little to what you have
written already: the basic kernel adds only a timer driver and possibly an
interrupt controller, which are simple devices.
■
Starting the WDB agent before the kernel limits you to system-mode
debugging.
Starting the agent before the kernel is described in the Wind River Workbench User's
Guide for VxWorks: Setting Up Your Hardware and the VxWorks Kernel Programmer’s
Guide: Kernel. The following sections provide important additional information.
Caveats
Because the virtual I/O driver requires the kernel, add the following line to
config.h:
#undef INCLUDE_WDB_VIO
There is an important caveat if you are planning to use the target agent serial-line
communication path. When the kernel is first started, interrupts are enabled in the
processor, but driver interrupt handlers are not yet connected. You must ensure
that the serial device you use for agent communication does not generate an
interrupt. If your board has an interrupt controller, use it to mask serial interrupts
in sysHwInit( ). Be aware that the target agent attempts to use all drivers in an
“interrupt on first packet” mode. As a result, you should modify the serial driver
to refuse to go into interrupt mode, even if the agent requests that mode.
System-Mode Debugging Techniques
After you have the agent working, you can use it to debug the VxWorks image to
which it is linked. To save download time, link the VxWorks code you want to
test—driver code, in particular—into the ROM image. To avoid re-making ROMs,
consider adding hooks to your BSP and driver routines as follows:
Comentarios a estos manuales