Outils pour utilisateurs

Outils du site


francois:starting_the_wtx_console_from_the_command_prompt

Starting the WTX console from the command prompt

wtxConsole

NAME

wtxConsole - console tool for target server.

SYNOPSIS

wtxConsole [-d.isplay displayName] [-h.elp] [-io.Redirect] [-n.oEcho]

[-r.egistry hostname] [-s.hellRedirect] [-t.itle titleName]

[-v.io vioNumber] [-w.aitUser] serverIdentifier.

DESCRIPTION

This tool is a console for the target server (see tgtsvr). It uses the API WTX to get a VIO channel on the target and provide two sockets file descriptors to the calling client.

The target VIO channel is redirected on these file descriptors. One is dedicated to outputs, the other one to inputs. By default the VIO channel number #0 is used by every console. The caller can force a given VIO number to be allotted, by using the -vio or -v option, followed by the required VIO number.

If the VIO number provided by the user is a negative number or is already used (and different from #0) by the target server, then the VIO number returned will be the first one available.

If started with -ioRedirect or -io, a redirection of the target standard I/O is automatically done in the console.

The console can also be used as a virtual target shell console. The shell is running on the target, and its I/O are done from the virtual console. To do this, use the -shellRedirect or -s flag.

The target server will automatically redirect the target shell I/O into the default target server console. Note that the target shell must be included when building the vxWorks target image. This feature is useful if the target is only accessible through back end and actions which cannot be done via hostShell (like loading object from a file system local to the target) have to be performed. When safely exiting, the console restores the original target I/O. When this option is set then the -n option (see below) is also set by default.

To avoid echoing when typing characters, use the -noEcho or -n option.

The console window can be displayed on a specified X server (including another host than the one where the target server is running) with the -display or -d option.

On Windows you can use the start shell command if you want to run the console in a new window.

The -title or -t option can be used to set a title in the console window bar. (This title is concatenated to the information diplayed by default, i.e. : “Console of target server - VIO node #VIO channel”).

The -waitUser or -w option is used to wait that Enter key is pressed when exiting. This is useful to see error messages printed when the wtxConsole is started on a newly created windows. (i.e. xterm -e wtxConsole -w **//target server**//)

When the target server is registered against a remote host Wind River Registry, using the -r option allows the console to get the target server description from the registry running on hostname.

OPTIONS

-d[isplay]displayName

Display where will be created the console window.

-h[elp]

Show this help message.

-io[Redirect]

Redirect target IO in the console (Default: /vio/0).

-n[oEcho]

Disable echo (set by default with -s).

-r[egistry]

Host name on which runs the registry the target server was registered against.

-s[hellRedirect]

Redirect target shell IO in the console.

-t[itle]titleName

Title displayed in the window title bar.

-v[io]vioNumber

Set the VIO channel number.

-w[aitUser]

Wait user input when exiting.

NOTES

If you want to have several consoles which redirect the target shell running at the same time, you must use the -s (target I/O redirection) option when starting the first console, and then just run the other ones with the -n (no echoing) option. This remark is only valid if you use the VIO channel #0 which is dedicated to the console use. For all the other VIO numbers, it is only possible to have one console redirecting the target I/O at a given time.

In the following example, we run three consoles on three different hosts. The first console uses the target VIO channel #0, redirects the target shell I/O on it, and the other ones just get connected to the VIO channel #0 (and then share all I/O with the first console).

cocyte% wtxConsole -s -t "first console" Penhors@menezbre
blavet% wtxConsole -n -t "second console" Penhors@menezbre
leguer% wtxConsole -n -t "third console" Penhors@menezbre

Please note that when the target server shutdowns, all the running consoles receive the TS_KILLED event from it. They can properly exit but cannot restore the target I/O to their original state, as the target server is unusable while it is exiting. At this stage, a reboot of the target can be necessary if you want to reset the target shell I/O to their default redirection (commonly, in the target console window).

The Control+C character is correctly handled (both on UNIX and Windows), and sent to the target VIO used by the console, like any other character.

Due to flush (stdin) performed by the kernel shell for each received command, it is not recommanded to redirect wtxConsole standard input to a host file on the current vio.

EXAMPLES

1. Start a console on target server Penhors@menezbre with the target shell I/O redirected and with the title My first console. The default VIO #0 will be used. The user enters the i command to show all the running tasks and their status, then enters the printLogo command and finally closes the console by pressing `Control+'. (on Win32, it would have been Ctrl+Break).

cocyte% wtxConsole -s -t "My first console" Penhors@menezbre

Please press Control+\ to close the console.

[vxKernel] -> i
NAME ENTRY TID PRI STATUS PC ERRNO PD ID
---------- ---------- ---------- --- ---------- ---------- --------- ----------
tMgrTask mgrTask 0x1f7ee8 0 PEND 0x1a34a8 0 0x1ea66c
tExcTask excTask 0x1f9400 0 PEND 0x1a34a8 0 0x1ea66c
tLogTask logTask 0x1fdb60 0 PEND 0x1a34a8 0 0x1ea66c
tShell shell 0x1f51e8 1 READY 0x16d2fc 0 0x1ea66c
tWdbTask 0x17df34 0x310760 3 READY 0x15b1dc 0 0x1ea66c
tNetTask netTask 0x2b0650 50 READY 0x15d350 0 0x1ea66c
value = 0 = 0x0
[vxKernel] -> printLogo
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
]]]]]]]]]]] ]]]]] ]]]]]]]]]] ]] ]]]] (R)
] ]]]]]]]]] ]]]]]]] ]]]]]]]] ]] ]]]]
]] ]]]]]]] ]]]]]]]]] ]]]]]] ] ]] ]]]]
]]] ]]]]] ] ]]] ] ]]]] ]]] ]]]]]]]]] ]]]] ]] ]]]] ]] ]]]]]
]]]] ]]] ]]] ] ]]] ]] ]]]]] ]]]]]] ]] ]]]]]]] ]]]] ]] ]]]]
]]]]] ] ]]]]] ]]]]] ]]]]]]]] ]]]] ]] ]]]] ]]]]]]] ]]]]
]]]]]] ]]]]]] ]]]]]] ] ]]]]] ]]]] ]] ]]]] ]]]]]]]] ]]]]
]]]]]]] ]]]]]] ] ]]]]]] ] ]]] ]]]] ]] ]]]] ]]]] ]]]] ]]]]
]]]]]]]] ]]]]]] ]]] ]]]]]]] ] ]]]]]]] ]]]] ]]]] ]]]] ]]]]]
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] Development System
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
]]]]]]]]]]]]]]]]]]]]]]]]]]]] VxWorks version 6.0-alpha
]]]]]]]]]]]]]]]]]]]]]]]]]]] KERNEL: WIND version 3.0
]]]]]]]]]]]]]]]]]]]]]]]]]] Copyright Wind River Systems, Inc., 1984-1999
value = 1 = 0x1
[vxKernel] -> <Control+\>
Termination signal received, safely exiting ...

2. Start a console on target server Penhors@menezbre with the target I/O redirected, without echoing and with the title My second console. The VIO number 3 will be used.

cocyte% wtxConsole -io -n -t "My second console" -vio 3 Penhors@menezbre

3. Start a console on target server Penhors@menezbre with wtxConsole stardard input and output redirected to host files.

target application to generate an echo on VIO channel 10:

echoTest.c
#include "ioLib.h"
#include "stdio.h"
#define VIO_NUMBER "/vio/10"
void echoTest ()
{
    int fd;
    int bread;
    char buf;
    fd = open (VIO_NUMBER, O_RDWR, 0);
    if (fd == -1)
    return;
    do
    {
        bread = read (fd, &buf, 1);
        if (bread != 0)
        {
            write (fd, &buf, bread);
        }
    }while (TRUE);
}

load the built test module and start the “echoTest” application. Then, start the wtxConsole with the following command line:

cocyte% wtxConsole -vio 10 Penhors@menezbre < inputFile > outputFile
francois/starting_the_wtx_console_from_the_command_prompt.txt · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki