8

Target Server



8.1    Introduction

A Tornado target server runs on the host and manages communications between Tornado host tools (such as the shell, debugger, and browser), and the target system itself (Figure 8-1). A target server includes the host-resident target symbol table, and an object-module loader that inserts application modules into a running target system.

Figure 8-1:   Target Server in Development Environment

The target server communicates with the target system through the target agent, which runs on the target system either as a VxWorks task or externally from VxWorks. In order to communicate with the target agent, the target server uses a communication back end configured for the same communication protocol and transport layer as the target agent.

A target server must be configured for a target and started before host tools can interact with the target. It must be configured with a communications back end that supports the communication protocol and transport layer used by the target agent, or it will not work. When a target server is started, it identifies the target agent by the network name of a target board on which the target agent is running.

A target server need not be on the same host as the Tornado tools, as long as the tools have network access to the host where the target server is running.

Target servers are registered with, and made accessible to users by, the service formally known as the Tornado target registry (also frequently referred to as the Tornado registry, or simply the registry). For information about the registry, see 2.2 Setting Up the Host; and the wtxregd reference documentation in .


*      
NOTE: This chapter describes various ways to configure, start, and manage target servers using the Tornado GUI. For detailed information about the operation of the target server, and its command options, see the tgtsvr reference material in .

Before configuring and starting a new target, make sure that the host and target are connected properly (see 2.3 Setting Up the Default Target Hardware).



8.2    Configuring and Starting a Target Server

A target server must be configured and started before any tool (such as the debugger) can communicate with a target system. There are two ways to configure and start a server:

The Configure Target Servers dialog box provides the simplest means of configuration. The command line provides the complete set of options available for a server. Command line usage also allows you to start target servers before Tornado.


*      
NOTE: When you start a VxWorks target simulator from the Tornado GUI, you are automatically prompted to start or configure a target server for the simulator.

8.2.1   Using the Configure Target Servers Dialog Box

The Configure Target Servers dialog box is a GUI tool for configuring and starting a target server. To display the box, select Tools>Target Server>Configure.

When you press the New button, Tornado displays the dialog box with default options.(Figure 8-2).

Figure 8-2:   Configure Target Servers

If you are using the default wdbrpc back end (for IP and serial connections) you only need to enter the following information:

  • A name for your configuration (the Description field).

  • The target name or IP address the target server will use to connect to the target.

  • The communication port, if your target and host are communicating over a serial link.

Tornado supplies a default for the Description field, but descriptive configuration names are more useful, particularly if you plan to use more than one target-server configuration. You can configure a target server so that the configuration name appears as a menu option Target Server in the Tools menu with the Add description to menu checkbox.

The fields and lists displayed in the property panel section of the box change based on the selection you make from the Change Property drop-down list. These options are discussed later in this section.

Each time you specify a configuration option, the Command Line box displays the corresponding tgtsvr command and its parameters. The text in the box cannot be edited, but you can use the Other Options field to add options that are not exposed through the GUI (see Miscellaneous).

You can also use the Command Line box display to copy the text to a batch file in order to launch a target server automatically with this configuration. You may also find it helpful to copy the text to the command line and explore various options in conjunction with the tgtsvr reference documentation (see Tornado API Reference: Tornado Tools Reference).

Control Buttons

To start a target server and save your server configuration, click the Launch button, which also saves the configuration. To save the configuration without starting a server, click OK instead. The name used for the configuration is in the Description field.

To discard all changes since you opened the Configure Target Servers dialog box, click Cancel.

The following controls are used to manage saved configurations and to create new ones:

Target Server Descriptions list

New button

Copy button

Remove button

8.2.2   Target-Server Configuration Options

This section describes all the configuration options you can specify in the Configure Target Servers dialog box. All options are listed in the Target Server Properties drop-down list.


*      
WARNING: The target server must be configured with the same communication back end as the one used by the VxWorks target agent. See Back End and 4.7 Configuring the Target-Host Communication Interface.

Authorizations

By default, anyone on a networked Tornado site who connects to the Tornado registry you are using can connect to any target server registered there. Use the properties in the Authorizations list to limit who can use your target server, or to prevent others from using it altogether.


*      
CAUTION: The target-server authorization mechanism assumes a collaborating group of users; it is not secure against malicious use. If you are concerned about interference from malicious users, isolate your PC from any network that such users may be able to reach.

To enable the authorization mechanism, you (and anyone else who wishes to participate in the Tornado authorization scheme from a Windows host) must define an environment variable WIND_UID as identification; see Sharing and Reserving a Target Server.

Figure 8-3:   Authorizations Properties

The Authorizations property list (Figure 8-3) offers the following controls:

Lock on Startup

User ID File

Back End

The Back End property list is used to specify how a target server will communicate with a target (Figure 8-4).

Figure 8-4:   Back End Properties

The fields displayed for the Back End property list vary depending on the communications method you choose from the list labeled Available Back Ends. The default, wdbrpc, is suitable for targets with IP connectivity.

The standard back ends are described in Table 8-1. Other back ends may be available separately; contact your nearest Wind River office (see the back cover).

Table 8-1:   Communications Back Ends for Target Server 


Back End Option
Description

wdbrpc
WDB RPC back end. This back end is the default. It is the most frequently used back end, and supports any kind of IP connection (for example, Ethernet). Polled-mode Ethernet drivers are available for most BSPs to support system mode debugging for this type of connection.
wdbpipe
WDB Pipe back end. The back end for VxWorks target simulators. It supports either system-level or task-level views of the target, depending on the configuration of the target agent.
wdbserial
WDB Serial back end. A back end for serial hardware connections; does not require SLIP on the host system. This back end supports either system-level or task-level views of the target, depending on the target-agent configuration.
netrom
WDB NetRom. A back end that communicates over a proprietary communications protocol for NetROM, a networked ROM emulator. This back end supports either system- or task-level views of the target, depending on target-agent configuration.
loopback
Testing back end. This back end is not useful for connecting to targets; it is intended only to exercise the target-server daemon during tests.


*      
WARNING: The target server must be configured with the same communication back end as the one built into the VxWorks image. See 2.4 Host-Target Communication Configuration and 4.7 Configuring the Target-Host Communication Interface.

The following Back End properties appear for all standard back ends:

Timeout

Re-try

The wdbserial back end (see Figure 8-4) also has the following properties:

Serial Port

Speed (bps)

All back ends also require:

Target IP Name/Address

Core File and Symbols

The Core File and Symbols property list gathers properties that have to do with the host-resident copy of the target-system executable.

Figure 8-5:   Core File and Symbols Properties

File Path From Target

File


Global Symbols, All Symbols, or No Symbols

Synchronize Target/Host Symbol Tables


Object Module Format

Memory Cache Size

In order to avoid excessive data-transfer transactions with the target, the target server maintains a cache on the host system. By default, this cache can grow up to a size of 1 MB. Change the cache size using the options in the Memory Cache Size property list (Figure 8-6).

Figure 8-6:   Memory Cache Size Properties

Default

Specify

Target Server File System

The Target Server File System (TSFS) is a full-featured VxWorks file system that provides target access to files located on the host system. See the tgtsvr reference entry in the online Tornado Tools Reference and VxWorks Programmer's Guide: Local File Systems for more information.

The TSFS provides the most convenient way to boot a target over a serial connection (see 2.5.7 Booting a Target Without a Network).

Figure 8-7:   Target Server File System Properties


*      
WARNING: To use the TSFS, you must include the WDB target server file system component when you build the VxWorks image. See 4.4 Creating a Custom VxWorks Image).

Enable File System

Root


Read only

Read / Write

Console and Redirection

Tornado supports virtual I/O to the host from target applications (see Virtual I/O). By default, any virtual output from the target is broadcast to all shell windows.

However, you can use the target server to create a dedicated console for virtual I/O. The option buttons in the Console and Redirection property list (Figure 8-8) direct virtual I/O to various locations:

Figure 8-8:   Virtual Console Properties

Redirect Target IO

Create Console Window

Redirect Target Shell


*      
NOTE: See the tgtsvr reference entry in Tornado API Reference: Tornado Tools Reference for detailed information about these options and for other I/O options available with command-line usage.

Logging

The Logging property list (Figure 8-9) allows you to log WDB and WTX requests.

Figure 8-9:   Logging Configuration Properties

Backend Log File

Max Size

WTX Log file

Max Size

Filter

Miscellaneous

The Miscellaneous property list (Figure 8-10) provides for Tornado 1.0.1 tools compatibility, and for use of options that are not available through the Configure Target Servers dialog box.

Figure 8-10:   Miscellaneous Configuration Properties

Use portmapper

  • Any host running a Tornado 2.0 registry that will be accessed by any host running Tornado 1.0.1.

  • Any host running a Tornado 2.0 target server that will be accessed by any host running Tornado 1.0.1.


Other Options


*      
NOTE: By default, when there is not enough memory in the WDB pool to satisfy an allocation request from the target server, the WDB pool automatically grows to accommodate the request. You can disable this automatic growth by typing -noG or -noGrowth in the option box.

Target Memory Pool

By default, when there is not enough memory in the WDB pool to satisfy an allocation request from the target server, the WDB pool automatically grows to accommodate the request. You can disable automatic growth in the dialog box, or by typing -noG or -noGrowth in the option box.

Figure 8-11:   Target Memory Pool Configuration Properties

8.2.3   Using the Command Line

In general, you will probably do most of your work from the Tornado IDE. In this case, you do not need to worry about environment variables: Tornado manages its internal environment automatically. However, if you also want to run some portions of Tornado from the command line (such as the compilation tools, or the shell), you must make sure that the appropriate variables are set in order for the tools to work properly. The file torVars.bat in c:\tornado\host\x86-win32\bin captures the requisite definitions, so that all you have to do is run torVars.bat to set the environment variables appropriately for your own Tornado installation.

You may want to start a server from the command line or from a batch file, so that your target is ready to use as soon as you enter the Tornado development environment. To do so, run c:\tornado\host\x86-win32\bin\tgtsvr.exe. You must specify the network name of your target as an argument (see Establishing the VxWorks Target Name and IP Address; and the tgtsvr reference in ).

There are a number of useful command-line options to tgtsvr that control the behavior of your target server. These include the -V (verbose) option for troubleshooting, the -B option for alternative methods of communicating with the target, and several options for redirecting I/O. For detailed information on these and other command-line options, see the tgtsvr reference entry.



8.3    Target Server Icon and Log Console Window

When a target server is started, the target server icon is displayed in the in the Windows taskbar (Figure 8-12). The context menu for the icon provides options for displaying the Log Console window, displaying information about the target, and shutting down the target server. The tooltip for the icon displays the name of the target server. Double-clicking on the icon opens the Log Console window. When the target server reports error messages, a yellow exclamation point is superimposed on the target server icon.

Figure 8-12:   Target Server Log Console and Icon

The Log Console window displays target server log output (Figure 8-12). The Hide button hides the target server Log Console window. The Stop button stops the target server. The About button displays version information about the target server, and basic information about the target system (BSP, CPU, and operating system).



8.4    Stopping a Target Server

There are various ways of stopping a target server, including:


*      
WARNING: Close any Tornado tools that use a particular target before you kill it. Killing a target server does not immediately destroy any attached tools, but the tools lose the ability to interact with the target. There is no way to reconnect a new target server to such orphaned tool sessions.



8.5    Selecting a Target Server

If a target server for your target has already been configured and started, you can select it with either the Tornado Launch toolbar or by various means from the Tools menu.

For information about configuring and starting a target server, see 8.2 Configuring and Starting a Target Server.

Tornado Launch Toolbar

The Tornado Launch toolbar has a pull-down list box that shows all the target servers that are currently running and known to the Tornado registry that your system is using (Figure 8-13; also see 2.2 Setting Up the Host). Click on the drop-down list box to display the available target servers; then select a target server from the list. If no target servers are listed, or none of the ones listed represent the target you need, you must configure and start a target server.

Figure 8-13:   Tornado Launch Toolbar

Tools Menu

When you start a browser, shell, or debugger from the Tools menu you can specify which target server to use. Tornado displays a dialog box with summary information about the target server currently selected with the Targets drop-down list for that tool.

Figure 8-14 shows the Launch Shell dialog box that appears when you click Tools>Shell; clicking Browser or Debugger produces a similar dialog box. Thus, you can use the Tools menu to connect a tool to an alternate target without changing the currently selected target in your Tornado session.

Figure 8-14:   Specifying the Target for a Shell

You can also use the Manage Target Servers dialog box to select a target server. See 8.6 Managing a Target Server.



8.6    Managing a Target Server

A number of target-server management commands are available to control your target servers and other networked Tornado target servers. To reach these commands, click Tools>Target Server> Manage. Tornado opens the dialog box shown in Figure 8-15.

Figure 8-15:   Manage Target Servers Dialog Box

At the top of the Manage Target Servers dialog box is a target selector--a drop-down list that you can use to select any of the targets registered with the Tornado target registry you are using. To help you see what target is selected, the Manage Target Servers dialog box displays the target information summary (the same information as the target summary available from the browser; see 9.5 Target-Information Window). You can update the display with the (exclamation mark) button.

Once you select a target, you can select a command from the Select Action drop-down list box (Figure 8-15), then click Apply to execute the command on the selected target. Click Close to dismiss the dialog box.

The following commands are available on the Select Action drop-down list:

Reserve

Unreserve

Unregister

Kill


*      
WARNING: Close any Tornado tools that use a particular target before you kill it. Killing a target server does not immediately destroy any attached tools, but the tools lose the ability to interact with the target. There is no way to reconnect a new target server to such orphaned tool sessions.

Reboot

Sharing and Reserving a Target Server

A target server may be made available to the following classes of user:

  • the user who started the server

  • a single user, who may or may not have started the server

  • a list of specified users1

  • any user


*      
CAUTION: The target-server authorization mechanism assumes a collaborating group of users; it is not secure against malicious use. If you are concerned about interference from malicious users, isolate your PC from any network that such users may be able to reach.

To participate in the Tornado authorization scheme, you must set the environment variable WIND_UID to a unique numeric user ID; see your Windows documentation.

If some Tornado users at your site use UNIX hosts, they do not need to set the WIND_UID environment variable; on UNIX hosts, the Tornado authorization scheme uses the system user ID.

When a target server is available to anyone, its status is unreserved. This status is visible in the browser (9.5 Target-Information Window) and in the target-selection dialog for any Tornado tool (for example, Figure 8-14). Any user can attach a tool to the target, and any user can also restrict its use.

When you configure a target server, you can arrange for the server to be exclusively available to your user ID every time you start it, by clicking the Lock on Startup option button in the Authorizations property panel of the Configure Target Servers dialog box. See 8.2.2 Target-Server Configuration Options. Target servers started this way have the status locked.

If a target server is not locked by its creator, and if no one else has reserved it, you can reserve the target server for your own use: click on the Reserve command of the Manage Target Servers dialog box (see 8.6 Managing a Target Server). The target status becomes reserved until you release the target with the Unreserve command in the same dialog box. Unreserve on a target that is not reserved has no effect, nor does Unreserve on a target reserved or locked by someone else.

This simple reserve/unreserve locking mechanism is sufficient for many development environments. In some organizations, however, it may be necessary to further restrict some targets to a particular group of users. For example, a QA organization may need to ensure certain targets are used only for testing, while still using the reserve/unreserve mechanism to manage contention within the group of testers.

Authorized User File

To restrict a target server to a list of users, create a file listing authorized users, and configure the target server to base authorization on that file (see Authorizations). The file should consist of one line for each user, with each line containing the user name, followed by a space, followed by the user's numeric identification.

For users on UNIX hosts, the user names are host sign-on names, as used by system files like /etc/passwd (or its network-wide equivalent), and the numbers are the system user IDs. For users on Windows hosts, the names are mnemonic aids, and the numbers are arbitrary identifiers.

You can also use one special entry in the authorization file: a plus sign (+) to explicitly authorize any user to connect to the target server. (This might be useful to preserve the link between a target server and an authorization file when access to that target need only be restricted from time to time.)


1:  Strictly speaking, there is another layer of authorization defining who is meant by "any user." The file c:\tornado\.wind\userlock is a Tornado-wide authorization file, used as the default list of authorized users for any target server that does not define its own authorized-users file. This file has the same format described below for individual authorization files.