
VxWorks
BSP Developer’s Guide, 6.0
132
A.2 The Development Environment
There are a number of problems that can occur due to your choice of development
environment. Many of these problems are related to the relationship between the
addresses where the linker expects the code to run and the addresses at which the
code is actually located. In most situations, these addresses should be identical.
However, for a short period of time, the locations can be different.
For example, when the target processor receives a
RESET signal, it starts to execute
at a specific reset vector address, typically determined by the processor design.
This address is usually where flash is located on the board. However, it is often best
if the boot image is executed from RAM. For this reason, many boot loaders have
a short section of position-independent code (PIC) that copies the entire image
from flash to RAM, and then transfers control to the RAM copy.
When the boot loader loads the actual OS image, the image is placed at a given
location in RAM and the loader causes execution to be transferred to the OS image.
The RAM address that the image is loaded at must match the address used in the
object file. If these addresses do not match, or if the image must be started with
some offset from the normal start location, the OS image that is loaded will not run
correctly.
For more information on setting up your development environment, see 2.4 The
Development Environment, p.43.
Image Locations
There are several locations that are relevant to the image you are debugging:
■
the flash reset address for the boot loader
■
the RAM address for the boot loader
■
the RAM address for the OS image
The boot loader is put into flash at the processor's reset address, and then copied
into RAM when the system boots. When the boot loader executes, it reads a
VxWorks image file and puts the image into RAM at a third address.
It is important that the two RAM addresses are each large enough to contain the
entire image. For example, if the OS image is to be loaded at 0x00040000 (128 KB)
and the boot loader's RAM image is at 0x00100000 (1 MB), the OS image must be
no larger than 896 KB (1 MB minus 128 KB), or the OS image will overwrite the
boot loader before the boot loader starts executing the OS image.
Comentários a estes Manuais