Professional Documents
Culture Documents
1
Overview
1-1
Overview
1.1 Integration Issues VxWorks Boot Sequence Tornado Directory Structure Conventions and Validation
1-2
What is a BSP?
Provides VxWorks with primary interface to hardware environment. BSP Responsibilities:
q q
Hardware initialization on power-up. Support for VxWorks access to hardware drivers. Integration of hardware-dependent and hardwareindependent software in VxWorks. Source, include, and make les. Derived les. Binary driver modules.
1-3
Generic drivers manage devices which can be moved from one target environment to another (e.g. LAN chip). BSP drivers manage devices which are specic to the target environment (e.g. interrupt controller). Complete support for BSP specic drivers. Integration of generic device drivers.
Copyright Wind River Systems
1-4
A BSP provides support for accessing drivers through VxWorks. This is how a BSP provides access to the system hardware environment.
VxWorks Libraries
TCP/IP MUX
wind Kernel
SCSI Driver
BSP
Hardware SCC Timer
LAN Driver
SCSI Controller
LAN Controller
1-5
Provide code at specic location in memory which processor will jump to on reset or power-up. Set processor in a specic state. Initialize memory and memory addressing. Disable interrupts. Pass control to additional bootstrapping code. Load required VxWorks segment(s) into RAM. Place hardware in quiescent state before initializing VxWorks kernel.
Copyright Wind River Systems Wind River Systems
1-6
Driver denes ISR(s), but BSP connects ISR(s) to interrupt vector table. BSP creates structures (objects) which are passed to driver for initialization. Offset constants and access macros for hardware registers provided by BSP and used by driver.
Access to full range of device features (possibly at a later time). Separate development/production congurations.
Copyright Wind River Systems Wind River Systems
1-7
Example - Portability for LAN driver code would allow developer to:
q q
Transport LAN driver to new hardware environment. Provide new LAN driver for familiar hardware environment.
Compile-time exibility. Run-time portability. Uses preprocessor macros to customize system. Provides ability to produce optimized modules without changing source code. Uses pointers to access routines. Provides portability for compiled object modules.
Compile-time exibility:
q q
Run-time portability:
q q
1-8
Combining techniques allows compile-time macros to implement runtime vectored routines. This is the preferred method at WRS.
Source les. Include les. Make les. Generic code is written in C. Architecture specic and performance optimized code is assembly. All includes and denitions specic to a CPU board are localized in two les. Controls building of all images.
Copyright Wind River Systems Wind River Systems
Source les:
q
Include les:
q
Make le:
q
1-9
The two BSP specic include les are distinguished by denitions which are xed once the physical hardware environment is xed, and denitions which allow conguration of the hardware environment after the physical hardware environment is xed. All images are built using a compact primary makele which accesses make sub-les.
Primary BSP les. Driver source les. Modules in VxWorks archive libraries. Hardware initialization object modules. VxWorks boot object modules. VxWorks images. VxWorks binary symbol table.
A complete BSP port will generate all of these les. End users will recreate some of these les when conguring the system.
Tornado BSP Training Workshop Copyright Wind River Systems Wind River Systems
1-10
If text segment write protection for VxWorks has been activated, there is an object module to guarantee that text and data do not share a common memory page. This functionality supports VxVMI. If this functionality has not been included this will be a null object module, however, it is still required. There is an ASCII le derived from an nroff le containing BSP specic information.
BSP Development
Development should occur in incremental steps:
q
First set up development environment (down-load path(s), debug strategies, etc.). Write pre-kernel initialization code. Optionally activate WDB agent and Tornado tools using polled serial or ethernet interface. Start minimal VxWorks kernel adding support for a system clock, and install interrupts. Complete BSP providing all necessary support for hardware environment (full network support etc.). Clean-up, testing and documentation.
1-11
Pre-kernel Tornado ethernet interface provided by NetROM which will be discussed later in the course.
The BSP Developers Kit. Appropriate reference BSP. A Validation Test Suite (VTS). Template BSP (all architectures). Template device drivers.
Specic device drivers which are not part of reference BSP can also be purchased from WRS.
1-12
BSP Validation
BSP validation:
q q
WRS validated. Non WRS validated. Classied as Tornado Certied, and may be distributed displaying this information. Contact WRS to obtain validation requirements. Automated test suite which runs on host and target to exercise BSP and report defects. Included in BSP Developers Kit. VTS distribution includes source to allow extension.
Copyright Wind River Systems Wind River Systems
1-13
Validation Test Suite. BSP Porting Kit Manual. Sample driver source code. Template BSP les (all architectures).
Overview
Integration Issues 1.2 VxWorks Boot Sequence Tornado Directory Structure Conventions and Validation
1-14
Loadable images. ROM-based images - compressed/uncompressed. ROM-Resident images. Boot code is burned into ROM or Flash. Boot code is a stand-alone VxWorks application.
ROM-based images load themselves into RAM from ROM or Flash. ROM-resident images execute out of ROM or Flash.
q
Only the data segment of the VxWorks image is loaded into RAM.
Copyright Wind River Systems Wind River Systems
1-15
Text segment - Executable instructions. Data Segment - Initialized global and static variables. BSS (Block Started by Symbol) Segment - Un-initialized global and static variables. (ANSI C/C++ requires these variables to be initialized to zero.).
These are generic components common to all VxWorks images. Component details will depend on the Object Module Format for the image:
q q
BSS segments of VxWorks images are zeroed by initialization code after appropriate image segments are relocated.
Some Terminology
VxWorks boot image - A VxWorks image designed to load another VxWorks image containing application code (often referred to as boot code).
q q
Burned into ROM or loaded into Flash. May execute in ROM/Flash (ROM-resident). May execute out of RAM.
Loadable VxWorks image - VxWorks images loaded by VxWorks boot image. VxWorks ROM image - VxWorks image burned into ROM or loaded into Flash. May execute in ROM/Flash (ROM-resident) or RAM.
Copyright Wind River Systems Wind River Systems
1-16
Disables interrupts (via the processor). Initializes target memory. Loads appropriate VxWorks image segments. Jumps to code to place target in a quiet state.
1-17
Boot code compressed - Decompression during copy Boot code uncompressed - Copy Boot code is ROM-resident - Copy data segment only
Boot program executes and loads VxWorks image into RAM. Jumps to VxWorks load point. System initialization code statically linked into loaded VxWorks image executes and completes initialization.
1-18
Memory allocated in RAM for boot code is reclaimed by VxWorks. VxWorks startup sequence is sometimes referred to as a boot sequence. Image stored in ROM/Flash is a boot-ROM image. Loaded image will be a end-user or application image.
RAM
LOCAL_MEM_LOCAL_ADRS
RAM_LOW_ADRS
RAM_HIGH_ADRS
Boot Program
1-19
LOCAL_MEM_LOCAL_ADRS is the beginning of RAM. RAM_LOW_ADRS is the load point for VxWorks. It is also the start of the text segment of VxWorks. FREE_RAM_ADRS marks the end of the VxWorks image. Usually the system memory pool or the target server memory pool begins here. RAM_HIGH_ADRS is the load point for the boot program. It is also the start of the text segment for the boot program unless the boot image is ROM-resident, in which case it is the start of the data segment for the boot module.
Control transfers to VxWorks initialization code in RAM. System initialization code statically linked into VxWorks image executes (in RAM) and completes initialization.
1-20
RAM
LOCAL_MEM_LOCAL_ADRS
RAM_LOW_ADRS
1-21
LOCAL_MEM_LOCAL_ADRS is the beginning of RAM. RAM_LOW_ADRS is the load point for VxWorks. It is also the start of the text segment of VxWorks. FREE_RAM_ADRS marks the end of the VxWorks image. Usually the system memory pool or the target server memory pool begins here.
1-22
RAM
LOCAL_MEM_LOCAL_ADRS
RAM_LOW_ADRS
1-23
LOCAL_MEM_LOCAL_ADRS is the beginning of RAM. RAM_LOW_ADRS is the load point for VxWorks. It is also the start of the data segment of VxWorks. FREE_RAM_ADRS marks the end of the VxWorks image. Usually the system memory pool or the target server memory pool begins here.
Place hardware environment in a quiet state. Initialize and start the wind kernel. Spawn a task to complete system initialization.
System initialization task will initialize support for enduser specied facilities, and start the end-users application.
Tornado BSP Training Workshop Copyright Wind River Systems Wind River Systems
1-24
Loadable VxWorks images do not assume that they have been loaded by VxWorks boot code, so most initialization performed by boot-strap code must be duplicated in loaded image. The system initialization task will install drivers and ISRs, create devices, initialize the I/O system, etc. Usually, it will spawn a user application initialization task just before it terminates. The specics of a VxWorks boot image will be discussed later in the course.
Overview
Integration Issues VxWorks Boot Sequence 1.3 Tornado Directory Structure Conventions and Validation
1-25
Tornado Modularity
Tornado is composed of a set of modular components. Modularity aids in portability, exibility of use, and maintenance. Tornado modules are:
q q
Host Support Package (HSP). Generic (target independent) VxWorks. Architecture Module. Board Support Package. Wind Debug Agent (WDB Agent).
1-26
The Host Support Package is the host-specic component of Tornado (cross-compiler, dynamic loader, Tornado tools, etc.). The generic VxWorks component is independent of host or target environments (wind kernel, semaphore libraries, I/O system, etc.). The architecture module provides support for target processor(s). The Board Support Package provides support for target hardware. The WDB agent provides target agency for the host resident Tornado tools. Because it is independent of VxWorks it can be run as task or a virtual ROM monitor.
Tornado Modularity
HSP
Generic VxWorks
WDB Agent
Arch BSP
1-27
1-28
Tornado
1-29
The shared XDR code is used in the transfer of data between tools and the target. The Tornado directory tree can be installed anywhere that is convenient.
bin
host
GUI, Tcl, and Help support les Standard Tcl distribution UNIX man pages on Tornado tools Source for VxColor demo
1-30
The directory host-os is named for your hosts hardware and operating system.
target
man UNIX man pages src Partial VxWorks source code unsupported Tools, drivers
1-31
The directory bspName is named for your targets Board Support Package.
Generic device driver code is designed to be usable with multiple BSPs (network drivers, serial drivers, etc.). BSP (device driver) code is tightly coupled to the target environment and is not designed to be used with other BSPs.
BSP specic code will always reside in ../<bspName>. Generic device driver code not supplied by WRS will reside in the <bspName> directory or a subdirectory of <bspName>.
Tornado BSP Training Workshop Copyright Wind River Systems Wind River Systems
1-32
Generic device driver code supplied by WRS will reside in subdirectories under ../src/drv and ../h/drv.
Overview
Integration Issues VxWorks Boot Sequence Tornado Directory Structure 1.4 Conventions and Validation
1-33
Coding conventions Documentation guidelines. BSP packaging. Driver guidelines. Package validation. Installation test. Functional test (VTS). Code review process and WRS validation process.
Copyright Wind River Systems Wind River Systems
Validation test:
q q
1-34
Users guide in BSP development kit contains discussion of BSP conventions and validation issues.
Summary
BSP responsible for supporting system hardware environment:
q q
Provides VxWorks with primary interface to hardware environment. Components consist of:
q q
1-35