Академический Документы
Профессиональный Документы
Культура Документы
1
Getting Started
1-1
Components of Tornado
Getting Help
Booting
Starting Tornado
WDB Agent
Getting Started
1.1 Components of Tornado Getting Help Hardware / Software Conguration Booting Starting Tornado WDB Agent
1-2
What is Tornado?
What is VxWorks?
What is Tornado?
Real-Time System
Development Tools
Networking
1-3
Interprocessor communication Remote le access Remote command/function execution Booting across network
Development Tools
Tornado Development Tools:
q q
- Launch Tornado tools - Access target interactively - Source-level debugger - Display system information - Congure applications or VxWorks - Analyze multitasking application - Simulate VxWorks target on host OS
Add new functionality Customize user interface some target-resident tools are available.
Copyright Wind River Systems Wind River Systems
1-4
Most Wind River tools can be customized with the Tool Command Language (Tcl), a scripting language similar to the Bourne Shell or C.
Tcl and the Tk ToolKit, by John Ousterhout, has more information on Tcl.
add user-dened commands. customize Tornado GUIs with new menu-items, buttons, etc.
Tornado is available on Solaris 2.51, 2.6, and 2.7; Windows 95, 98 and NT; and HP-UX 10 hosts.
Some GUI customizations may be incompatible between UNIX and Windows platforms.
Real-Time System
Memory Mgmt. File Systems
I/O System
Kernel
Device Drivers Network Stack
1-5
Multitasking kernel:
q q
Preemptive priority based scheduling Fast Small and congurable (micro-kernel architecture)
Performance Enhancements
All tasks reside in a common address space. RAM text data bss fooLib
int fooVal; void fooSet (int x) { fooVal = x; } tTaskB fooSet (99) tTaskA fooSet (4)
1-6
In UNIX/NT, a process has its own memory locations for data and bss but shares text with all other processes executing the same code.
In VxWorks, when a task accesses the text, data, or bss segments of a module, it accesses the same physical memory locations as any other task using the same code.
All tasks reside in a common address space. + Makes intertask communication fast and easy. + Makes context switch faster (no need to save and restore virtual address contexts). - A deviant task can corrupt other tasks.
All tasks run in supervisor (privileged) mode. + No system call overhead. All VxWorks facilities are invoked as normal subroutines.
Cross-development Cycle
Host RS-232 Target
Tornado
VxWorks
ethernet
Editing Compiling/assembling/linking, within the project facility or from the command line. Tracking source code (ClearCase, PVCS, Visual Source Safe, ...) Loading Execution Source level debugging Performance monitoring
Typical development cycle consists of iteratively writing and compiling code on the host, downloading to target, testing code on target and going back to host for further writing and modication of the code.
Tornado Delivery
Boot ROMs for supported boards
q q
Board specic Use network to download VxWorks from host Turnkey for standard boards Tornado tools, which run on the host The VxWorks OS, which runs on the target Wind River Supplied BSPs
1-8
Some SPARC boards use OpenBoot to download the boot ROM program, which can then boot VxWorks.
The GNU ToolKit family of compilers, linkers, etc., is automatically installed in the Tornado directory tree. In Tornado 2.0, the C compiler is the same GCC version 2.7.2 used in Tornado 1.0.1; for C++ code, the compiler is based on EGCS 1.0.2, or EGCS 1.0.3 for the PC simulator.
See the Wind River Products Installation Guide for the details of installing Tornado.
Information on known problems, changes introduced with current CDROM version, and product bulletins can be found at www.wrs.com/ corporate/support/prodbullet/T2.0.
Portability
HSP
Generic VxWorks
WDB Agent
Arch BSP
1-9
Architecture specic (e.g., MC680X0, PPC, i960, x86, ARM). Board specic (e.g., hardware initialization, VMEbus interface, clock/timer functions). Host specic (cross-compilers, tornado tools & target server).
The WDB debug agent provides target agency. Because it is independent of VxWorks, you can perform system-level debugging with the remote source-level debugger.
BSP is an acronym for Board Support Package. It is the board-specic part of VxWorks. HSP is an acronym for Host Support Package. It is the host-specic part of Tornado.
1-10
The shared XDR code is used in the transfer of data between the host tools and the target. The eXternal Data Representation is a standard format for sending data over the network used by RPC (Remote Procedure Call) applications.
The Tornado directory tree can be installed anywhere that is convenient. By convention, the location of this installation directory, /usr/wind in this example, is referred to as the wind directory. For a Windows host, the wind directory might be C:\Tornado.
include src
host
host-os Host-specic tools bin Tornado and GNU host executables lib Tornado Tool libraries resource GUI, Tcl, and Help support les tcl Standard Tcl distribution
1-11
The directory host-os is named for your hosts hardware and operating system. Valid types are: x86-win32 sun4-solaris2 parisc-hpux10 All Windows hosts Solaris hosts HP-UX hosts
proj
target
h VxWorks header les lib Libraries provided by VxWorks src Partial VxWorks source code unsupported Tools, drivers
1-12
The boot program and VxWorks start-up source code are in wind/ target/cong/all.
This le may include other les from the BSP directory as well as generic drivers under wind/target/src/drv (e.g., the clock/timer routines are in the wind/target/src/drv/timer directory). Source code for network interface and SCSI drivers is not provided in the standard distribution.
Each VxWorks library, consisting of usually one, but sometimes more object modules, has corresponding header les. Examples:
Library -----------------taskLib memPartLib semLib sysLib Routine ----------------taskSpawn malloc semTake sysHwInit Include le(s) ------------------taskLib.h stdlib.h semLib.h sysLib.h
Getting Started
Components of Tornado 1.2 Getting Help Hardware / Software Conguration Booting Starting Tornado WDB Agent
1-13
Manuals.
Online information.
Users group.
Technical Support.
WindSurf
Overview
There are several classes of help resources: Manuals on host tools:
q q
Tornado Users Guide GNU ToolKit Users Guide WindView Users Guide VxWorks Programmers Guide VxWorks Network Programmers Guide VxWorks Reference Manual BSP Reference (HTML)
1-14
Wind River Products Installation Guide. Customer Support Users Guide Tornado Release Notes. Tornado API Guide. Debugging with GDB GNU Make All of the Tornado and VxWorks manuals are available in HTML format in wind/docs. Manuals can be accessed using Help menu on Windows and UNIX. Some context-sensitive help is available on Windows hosts using the F1 key.
Other Resources
Usenet newsgroups covering VxWorks and embedded programming topics, for example comp.os.vxworks. Training courses:
q q
Tornado Device Driver Workshop Tornado BSP Training Workshop Tornado Tools Training Workshop installation problems and media errors WRS software, documentation, and service errors understanding WRS product functionality
WindSurf self-help web pages: search engine, FAQ, patches, document updates, known problems list, ...
Tornado Training Workshop Copyright Wind River Systems Wind River Systems
1-15
comp.os.realtime - general real-time topics comp.arch.bus.vmebus comp.arch.embedded Use the Support menu item within Tornado This helps you ll out a Tornado Support Request form, then sends email to support@wrs.com. In the USA, call 1-800-USA-4WRS. Hours are from 5 A.M. to 5 P.M. Pacic time. Outside of the USA, contact your local WRS ofce.
WindSurf may be reached from the Wind River Systems home page, http://www.wrs.com; from there go to the Customer Support page. Access to WindSurf requires registration for a password and user ID.
Getting Started
Components of Tornado Getting Help 1.3 Hardware / Software Conguration Booting Starting Tornado WDB Agent
1-16
wtxregd manages a list of target servers. Tools contact the registry to look up target servers by name.
Specify target boot parameters and boot target. Congure and launch target server.
q
Each target server manages host tools interaction with a particular target.
Copyright Wind River Systems Wind River Systems
1-17
A typical conguration would run one registry daemon per development project.
The Tornado architecture allows the registry, target servers, and Tornado tools to run on different networked hosts.
Static electricity and overheating can damage boards. Connectors must be rmly in place (serial cables, ethernet cables, VME, etc.). System controller in slot 0 (left-most slot). Having empty slots between boards requires jumpering the backplane.
Copyright Wind River Systems Wind River Systems
VME specic:
q q
1-18
VME:
q
If there are empty slots between boards (and the backplane is not jumpered correctly), VMEbus interrupts and arbitration will not work properly. Some boards enable bus arbitration via jumpers. In this case, the board in the left-most slot must be jumpered differently from the others.
Obtain target IP addresses Assign host names to targets (optional) If booting with RSH, list your targets name in ~/.rhosts. If necessary, modify routing tables.
1-19
Environment variables which must be set include Tornado installation directory WIND_REGISTRY host where registry daemon runs WIND_HOST_TYPE sun4-solaris2 or parisc-hpux10 PATH $WIND_BASE/host/$WIND_HOST_TYPE/bin:... LD_LIBRARY_PATH Solaris shared library path, SHLIB_PATH HP-UX shared library path. The Getting Started chapter of the Tornado Users Guide discusses how to congure the environment variables for your host.
q
WIND_BASE
wtxregd is the Wind Registry daemon, which tracks available target servers and must be running on the host specied by the WIND_REGISTRY environment variable. The local host is the default.
Contact your network administrator about obtaining IP addresses for, and assigning host names to, VxWorks target computers.
When using Tornado, specify the registry host you wish to use on the Tools => Options... => Tornado Registry page. Consult Windows 95/98/NT documentation to install and congure TCP/IP for a PC.
Tornado Training Workshop Copyright Wind River Systems Wind River Systems
1-20
The torVars.bat script, located in host\x86-win32\bin, sets environment variables needed for command-line use of the tools. Here is an example torVars.bat le:
set WIND_HOST_TYPE=x86-win32 set WIND_BASE=D:\TTwo set PATH=%WIND_BASE%\host\%WIND_HOST_TYPE%\bin;%PATH%
In this case, Tornado was installed in the directory D:\TTwo. Too avoid needing to source the le for each command-line shell, one may dene the environment variables in autoexec.bat (Windows 95) or using the System control panel (Windows NT).
The hosts le which you may edit to associate IP addresses with hostnames is:
q q
Getting Started
Components of Tornado Getting Help Hardware / Software Conguration 1.4 Booting Starting Tornado WDB Agent
1-21
Rebooting
Boot ROM
Targets boot ROM code executes on power up. Boot ROMs do not contain the VxWorks system under which your application runs. VxWorks system image is an object module on the host. The boot ROM code:
q q
Allows setting of boot parameters. Downloads VxWorks into target memory via the network. Starts executing VxWorks.
1-22
Boot Conguration
Host (Columbia) wind/target/cong/bspName/vxWorks
team1%
90.0.0.70
RS-232
ei 1-23
Boot device Host internet address Path of VxWorks image User name Target internet address CPU number
Network interface to use. Address of host from which to boot. File to transfer over network. For le access purposes. Denes the targets address. Each board in chassis gets a different number. The shared memory master is CPU 0.
At Power-On of Target
1-24
On power-on, the boot ROMs I/O is through a serial port. To connect to a serial port on a UNIX workstation, use tip (SunOS), cu, or kermit. Above is shown a PC using HyperTerminal.
[VxWorks Boot]: h ? - Print this list @ - boot (load and go) p - print boot params c - change boot params l - load boot le g adrs - go to adrs d adrs [,n] - display memory ... n netif - print network interface device address $dev (0,procnum) host:/le h=# e=# b=# g=# u=usr [pw=passswd] f=# tn=targetname s=script o=other Boot ags: 0x02 - load local system symbols 0x04 - dont autoboot 0x08 - quick autoboot (no countdown) 0x20 - disable login security 0x40 - use dhcp to get boot parameters 0x80 - use tftp to get boot image 0x100 - use proxy arp available boot devices: ei0 sm
Boot Parameters
[VxWorks Boot]: p boot device unit number processor number host name le name inet on ethernet (e) host inet (h) user (u) ftp password (pw) ags (f) target name (tn) : : : : : : : : : : : ei 0 0 wolverine c:\tornado2\target\cong\mv162\vxWorks 147.11.12.204:ffffff00 147.11.12.165 todd covert 0 t12-204
1-25
Check hardware to determine type of boot device. Some examples: Manufacturer 3Com Lance Excelan Digital Intel Boot Device Code elPci ln ex dc ei
Windows users may use / instead of \ as a le separator. Unix users would of course use /.
User name For rsh protocol ~/.rhosts (UNIX Host) A password must be specied to boot using the FTP protocol.
Keeping this line in a le on the host machine allows cut and paste (in hosts windowing system) for boot. Can also make new boot ROMs with correct default parameters (see the Reconguration chapter).
Tornado Training Workshop Copyright Wind River Systems Wind River Systems
1-26
Booting
[VxWorks boot]: @ boot device unit number processor number host name file name inet on ethernet (e) host inet (h) user (u) ftp password (pw) flags (f) target name (tn) : : : : : : : : : : : ei 0 0 wolverine c:\tornado2\target\config\mv162\vxWorks 147.11.12.204:ffffff00 147.11.12.165 todd covert 0x8 t12-204
Attached TCP/IP interface to ei0. Attaching network interface lo0... done. Loading... 424504 + 29664 + 29404 Starting at 0x20000... Attached TCP/IP interface to ei unit 0 Attaching network interface lo0... done. NFS client support not included. VxWorks Copyright 1984-1998 Wind River Systems, Inc. CPU: VxWorks: BSP version: Creation date: WDB: Motorola MVME162 5.4 1.2/0 Apr 17 1999 Ready.
1-27
The numbers following Loading... are the sizes of the VxWorks images text, data, and bss (uninitialized data) segments.
The rst Attaching network interface without the done, verify that the correct network interface is being used. On VME systems with separate ethernet cards, check that the system controller is congured properly and that the ethernet board is properly jumpered. Loading... without the size of the VxWorks image, check the ethernet cable and connection. The Starting at with no further indication that VxWorks is running, verify that the VxWorks image is valid. The second Attaching network interface without the done, check the network driver in the newly loaded VxWorks image.
After booting, start a target server and start using Tornado tools.
Rebooting
Type reboot( ) at a WindSh prompt. Type CTRL-X in target console or UNIX WindSh. Press abort button on board. Press reset button on chassis. On a power-on or other cold reboot, RAM is zeroed out to avoid parity errors reading uninitialized memory. A warm reboot skips this step.
q q
Typing reboot( ) or CTRL-X generates a warm reboot. In a VME environment, typically an abort generates a warm reboot, while a reset causes a cold reboot for all CPUs on the bus.
Copyright Wind River Systems Wind River Systems
1-28
1-29
The various booting methods are discussed in the VxWorks Network Programmers Guide and the Tornado Users Guide.
Specify the 0x40 bit in the ags boot parameter to obtain critical boot parameters via DHCP. Specify 0x80 in ags to boot with TFTP. To do both, include 0xC0 in ags. Setup of the DHCP server host is also required; see the Networking chapter and the VxWorks Network Programmers Guide for details.
VxWorks includes a DHCP server component, which can also used as a BOOTP server.
Getting Started
Components of Tornado Getting Help Hardware / Software Conguration Booting 1.5 Starting Tornado WDB Agent
1-30
Accessing Tools
Use a control panel to manage your Tornado session:
q q
Create and manage target servers. Start Tornado tools. Invoke online manuals. File requests for Technical Support. Browse relevant Web sites.
For UNIX hosts, the control panel is the Launcher. Start control panel with: % launch & For PC hosts, the Tornado integrated development environment (IDE) serves as the control panel. Invoke the IDE with from the Start menu.
Tornado Training Workshop Copyright Wind River Systems Wind River Systems
1-31
To customize Tornados development environment, add Tcl commands to the appropriate les in the .wind directory. See the Tornado Users Guide for details.
UNIX: Launcher
Menu Bar Button Bar
Display Panels
1-32
To launch a tool, click on a target servers name in the Targets panel and then click on the appropriate tool icon. Several optional product icons are shown. They are added automatically when a product is installed.
Launch new or saved target servers. Save target server congurations. Restart/kill target servers. Use Support menu to request Technical Support via email.
q
Use Admin menu to install WRS products, ftp WRS, or edit a users le.
1-33
Use the Tools menu to launch new or saved target servers, and access Tornado tools.
Use the File and Edit menus to view and modify les.
Tools can also be accessed using the Launch toolbar once a target server is congured.
Target Server
After booting a target, you must start a target server to access the target using the Tornado tools. Target server provides host-based management of target resources needed by development tools:
q q
Communication with debug agent on target. Dynamic module loading and unloading. Host-resident symbol table for target. Allocation of memory on target for host tools. Cache of target program text segment memory. Virtual I/O facilities.
This scheme is exible: Minimizes tools impact on target. Tools independent of type of communication link.
q q
1-34
All Tornado tools use the Wind River Tool Exchange Protocol (WTX) to communicate with the target server. The WTX protocol is documented in the Tornado API Guide.
manipulating information it has cached. sending requests to the WDB agent on the target.
Tornado Architecture
Host Target
VxWorks tgtsvr
WDB Agent
1-35
the WIND_REGISTRY environment variable the Tools => Options... => Tornado Registry page
(UNIX) (Windows)
The target server (tgtsvr) mediates tools interactions with the target. The target server provides: communication over Ethernet, serial, NetROM, and custom connections. host-resident table of target symbols. dynamic module loading and unloading. cache of program text stored in targets RAM. virtual I/O path with target. wtxregd, the Wind Registry Daemon, manages the information a tool needs to connect to a target server. Tools initially contact the registry to nd out how to contact a particular target server.
q q q q q
1-36
To invoke the target server conguration window, click on the Target => Create menu item from the Launcher.
Use the target server conguration window to launch and save target server congurations.
Enter targets name in the Target Name eld. Select desired options. Launching the target server will save the conguration.
Backend list
1-37
To launch a saved conguration, select it from the Saved Congurations list and click on Launch.
1-38
To invoke the Target Server conguration window select Target Server/ Congure from the Tools menu in the Tornado development environment.
Enter targets name in the Target Name / IP Address eld. Select desired options, using the Change Property toolbar. Optionally, specify Log File, Timeout and Re-try(Count) elds.
To launch a conguration, click on Launch, and the conguration will be saved. To save the conguration without launching it, click on OK.
Selecting Add description to menu checkbox will add the target server name to the Tools -> Target Server menu. Selecting this menu item will launch your target server.
Connecting To Target
Once the target server is successfully connected to the target,
q
(UNIX) An xterm will appear with connection information (provided the Verbose option was specied), or (Windows) A dedicated target server window will display status. Look in taskbar system tray for .
1-39
Getting Started
Components of Tornado Getting Help Hardware / Software Conguration Booting Starting Tornado 1.6 WDB Agent
1-40
Reading or modifying memory. Setting or clearing break points. Creating, starting, stopping, and deleting tasks. Calling functions. Gathering system object information. Specify task, external, or dual debug mode. Select communication strategy consistent with target server back end. Set amount of target memory reserved for agents use.
Copyright Wind River Systems Wind River Systems
Agent is congurable:
q q
1-41
The target server and WDB agent communicate via the Wind Debug (WDB) Protocol.
The agent uses memory to satisfy tools requests, for example, to download code, create a variable, spawn a task, or process a command.
By setting aside a dedicated pool of memory for the agent, Tornados intrusion on the target is minimized.
To obtain information on VxWorks system objects from the target, a tool sends a Gopher script which the WDB agent interprets to gather and return the requested information. This scheme allows any object to be examined and minimizes the use of target resources. The small Gopher language is part of the WTX protocol documented in the Tornado API guide.
Tool
VxWorks
1-42
The WDB debug agent executes on the target and provides agency for commands issued by the target server.
All tools connect to the target server, which executes on a host and handles the details of communicating with the WDB agent. Tornado supports TCP/IP, serial, and NetROM connections.
Usually the WDB agent runs as a task, because this conguration gives the best performance. However, this conguration only provides tasklevel debugging. It is called task or internal mode.
Because the WDB agent does not depend on VxWorks, it is possible to perform system-level debugging--e.g, debugging ISRs or code which executes before the kernel is running. Run WDB agent outside of VxWorks to debug at the system-level. This conguration is called external or system mode.
Agent Conguration
In the default VxWorks image, the WDB agent is dened, enabling WDB Agent support. All target agent components are in /development tool components/WDB agent components/. Set WDB mode component to the appropriate debug strategy (select at least one of the two):
q q
.../select WDB mode/WDB system debugging .../select WDB mode/WDB task debugging
.../select WDB connection/WDB END driver connection .../select WDB connection/WDB serial connection
1-43
The default conguration for most targets includes both the system and task mode agents, with communication via END driver connection.
To debug before the system is multi-tasking, set mode to system debugging only. See the Tornado Users Guide for details.
To debug interrupt service routines, you must choose a mode with an external agent.
Selecting both task and system modes causes VxWorks to create both external and task mode WDB agents. The agents will dynamically pass control back and forth, as you exit and enter system-level debugging.
When debugging over a serial line, use the highest reliable data rate.
See the Getting Started chapter of the Tornado Users Guide for details.
Summary
Tornados three components:
q q
VxWorks real-time operating system Networking Development tools Located in wind/target/cong/bspName Contains board-specic les
1-44
Summary
Target hardware setup is described in BSP documentation. Host environment.
q
Set environment variables for UNIX or commandline use. Congure network facilities: IP addresses and hostnames.
Critical boot parameters: boot device VxWorks pathname host internet address target internet address user name processor number
q q q q q q
1-45
Summary
Use control panel to manage a Tornado development session:
q q
Create, restart, and kill target servers. Start Tornado tools like WindSh, Browser, etc..
Target resources used by host tools. Target information. Communication with target. Tool-target interactions.
1-46
Summary
Congure WDB Agent:
q q
1-47