VxWorks / Tornado II FAQ


1. Tool problems

1.1 Compiler and Linker

1.2 Debugger

1.3 FTP

1.4 Host tools

1.5 Installation

1.6 Make

1.7 Project facility

1.7.1 Hierarchical projects

1.7.2 Super projects

1.8 Target server

1.9 Target shell

1.10 Telnet

1.11 Tornado

1.11.1 Tornado (General)

1.11.2 Tornado (Windows)

1.11.3 Migration

1.12 Version control

1.13 Visual Studio integration

1.14 Windsh

1.15 Windview

Index


1. Tool problems

1.1 Compiler and Linker

Q: When I want to link some object files to one, there was one error

      ldppc:built in linker script:43: syntax error
      

How do I get rid of this error?

A: Make sure that you use the -r option for the linker.
(From: weber.dirk@t-online.de)


Q: How do I upgrade to a new version of the compiler?

A: Dave Korn has made a web-page about this for the PPC version of the compiler. You can find has page at: http://www.newgcc4vxworks4ppc.cjb.net/


Q: When compiling the code with another compiler I get many more warnings and errors. How can I get GCC to generate more warnings?

A: The first thing is to switch on all warnings. This can be done by adding -Wall to compiler properties.

Another way to get even more reports is to tell the compiler to see the files as C++ files. This can be done by adding "-x c++" to the compiler properties.
(From: Claudio Ortega, cortega@sinfomed.org.ar)

-Wall doesn't really turn on all warnings (or even very many). I've been using the flags recommended by Bruce Evans and since immortalized in FreeBSD's BDECFLAGS make variable:

# BDECFLAGS are a set of gcc warning settings that Bruce Evans has suggested
# for use in developing FreeBSD and testing changes.  They can be used by
# putting "CFLAGS+=${BDECFLAGS}" in /etc/make.conf.  -Wconversion is not
# included here due to compiler bugs, eg: mkdir()'s mode_t argument.
#
BDECFLAGS=      -W -Wall -ansi -pedantic -Wbad-function-cast -Wcast-align \
                -Wcast-qual -Wchar-subscripts -Winline \
                -Wmissing-prototypes -Wnested-externs -Wpointer-arith \
                -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings
    

This set of flags is *much* pickier than -Wall alone.
(From: W Gerald Hicks)


Q: When I compile my module everything is OK, but when I try to download this module I get an error on a missing symbol "__eabi".

A: In your module there probably is a function called "main". As per PPC "extended Application Binary Interface" (eabi) standard, the "main" function must call the special __eabi function, that supposed to set the needed environment to run Your program.

According to this, GNU compiler, inserts the call to __eabi in the "main" function.

Tornado DOES NOT provide that function, because in a real-time environment you doesn't expected to write the "main" function. VxWorks sets up the environment before the application code run and there is no need (and no sense) for "main".
(From: Ilia, iliab@telegate.co.il)


Q: I generated a version 2.95.2 version of the compiler. Everything goes fine until I start linking our image. Here is what I am getting for the ctdt tables during linking:

ctdt.o(.data+0x3c):fake: undefined reference to `global constructors keyed to _constructor_name_
      

... lots of those for all Cs and Ds. Has anybody seen this problem before?

A: The problem is caused by gcc having changed the way it gets static constructors run in between version 2.7.2 and 2.95.2. It no longer emits a function per module that constructs the static objects for that model, which is what the munching stage of the vxworks build/link is all about.
You can restore the earlier behaviour by making the following changes to the gcc 2.95.2 source code:

in [source code dir]/gcc/config/arm/vxarm.h, at the very end, add:-
/*     More DK patches: we undef these two in order to force the  */
/*  compiler to output our static constructors and destructors    */
/*  in the fashion to which it is accustomed....                  */

#undef ASM_OUTPUT_CONSTRUCTOR
#undef ASM_OUTPUT_DESTRUCTOR

/*     This one is so that GLOBAL_THING gets a $ in it's name     */
#undef NO_DOLLAR_IN_LABEL

Now change into your build directory, do a "make clean", and then rebuild and reinstall the compiler.
This worked for me, anyway, with the ppc version: it made the compiler revert to its older behaviour of making munchable constructors. Hope it helps for you too.
(From: Dave Korn)


Q: When compiling I see the following output in the build-window:

nm386 -g partialImage.o @B:\Sources\Components\Common\Common_Geni_Test\Src\prjObjs.lst | \
wtxtcl D:\Tornado\host\src\hutils\munch.tcl -asm 386 > ctdt.c
      ...
cc386 -nostdlib -r -Wl,-X  partialImage.o ctdt.o -o VxWorksGeniServerTestExe.out
      

The final step (linking partialImage.o to ...out) takes very long (about half an hour!!!). Any ideas why?

A: It probably is the munching, rather than the linking, that takes half-an-hour, a trick that someone else posted here before might buy some speedup: interpose "grep GLOBAL" in the pipeline of the munch command, i.e.

nm386 -g partialImage.o @B:\Sources\Components\Common\Common_Geni_Test\Src\prjObjs.lst | grep GLOBAL | \
wtxtcl D:\Tornado\host\src\hutils\munch.tcl -asm 386 > ctdt.c

(From: Dave Korn)


Q: How do define a structure without holes in it?

A: I use on VxWorks with GNU Compiler

struct ex {
INT8  source;
INT32 txSize;
INT32 datSize;
INT16 cmd;
} __attribute__ ((packed));

typedef struct ex PackedStruct;
    

Important note - using the compiler switch -fpack-struct should be avoided if possible. We recently removed this option from a large C++ application and realized a 30% to 100% performance improvement. This is because every access to multibyte values in structs or classes will be done byte by byte. Use the __attribute__ ((packed)) method instead!
(From: Mark Fanara, mfanara@home.cNOSPAMMom, and Francisco Pataro, fpataro@dnaent.com)


Q: How can I call a C++ function from within a C-file?

A: If you want to call a C++ function from a C file, the C++ function must be declared with extern "C"; otherwise the compiler mangles the function name by adding characters to the end that specify the types of arguments and returns that the function expects.
(From: Dave Korn)


Q: Is the -fvolatile flag really needed?

A: WRS indicated to us that we should use the -fvolatile for the kernel/bsp build. This is usually turned on by default in one of the target/h/make/ files.
We also picked up the -fvolatile flag in our application builds because we referenced some of the tornado make files. When we removed the flag for application builds we did come across a few subtle bugs where we had not explictly used the volatile keyword in the code. If you have written device drivers be careful.
The -fvolatile flag makes the compiler produce some very conservative code. Incrementing a variable via a pointer (p->x++) is not done in one instruction as you might think (68k example):

    addql #1,a0@(8)
    

with -fvolatile you get this:

    movel a0@(8),d0
    addql #1,d0
    movel d0,a0@(8)
    movel a0@(8),d0
    

You can imagine what a C++ application using the "this" pointer everywhere gets compiled into!
(From: Chris Varlese, cv@no.mail.net)


Q: I do a link with a lot of archives, now the linker has problems resolving the cross references between the archives.

A: Try one of the following:

  1. $(LIBS) is substituted into: $(LD_PARTIAL) -o vxWorks.tmp $(MACH_DEP) usrConfig.o version.o $(LIBS) (in target/h/rules.bsp for a non-project build). Now LD_PARTIAL is ccxxx, so you need to specify -Wl,--group-start to get cc to pass the argument to ld.
  2. Try adding a -Usymbol for each symbol that has to be pulled in early.
  3. If (2) make the ld line too unwieldy, generate a .s file that contains: .extern symbol for each undefined symbol and include that into the link before the libraries
  4. If your building on unix, it ought to be possible get ld to generate the required list of undefines! You need to add a loop! Something like this might work:
            [ ! -f undefs.s ] && echo "#" >undefs.s
            while
                    $(CC) -c $(CFLAGS) undefs.s
                    $(LD_PARTIAL) -o vxWorks.tmp $(MACH_DEP) usrConfig.o version.o \
                            undefs.o $(LIBS)
                    $(NM) vxWorks.tmp | grep ' __' | $(MUNCH) > ctdt.c
                    $(MAKE) CC_COMPILER="-fdollars-in-identifiers" ctdt.o
            do
                    $(LD) $(LDFLAGS) -e $(SYS_ENTRY) $(LD_LOW_FLAGS) -o vxWorks \
                       dataSegPad.o vxWorks.tmp ctdt.o tad_hook_list.o 2>&1 | tee ld.errs |
                            while read file undef ref to symbol
                            do
                                    [ "$undef" = "undefined" ] || continue
                                    [ "$ref" = "reference" ] || continue
                                    [ "$to" = "to" ] || continue
                                    oifs="$IFS"
                                    IFS="'/`"
                                    symbol="`echo $symbol`"
                                    IFS="$oifs"
                                    echo "\t.extern\t$symbol"
                            done | sort -u - undefs.s >undefs.new
                    cmp -s undefs.s undefs.new && break
                    mv undefs.new undefs.s
            done
            cat ld.errs
            

    Of course it need another set of escapes and ; \ on each line to run under make.

(I've also had to reconstruct the original rules.bsp contents - mine is somewhat different from the vxWorks original in this area!)
(From: David Laight, dsl@tadpole.co.uk)


Q: What does the warning "trigraphs occured" mean?

A: This has NOTHING to do with Tornado or VxWorks (per se)
You most probably have in your code (EVEN in COMMENTS) a trigraph sequence -- see K&R (Kernighan & Ritchie; A12.1 - This is new to the ANSI standard -- But as the GNU manual states "You don't want to know about this brain-damage..."
use the -ansi switch or -trigraphs switch upon compilation...
Or better yet, get rid of any comments that comtain a trigraph sequence '??X' (see K&R for definitions of X).
(From: Michael.Ben-Ari@ecitele.com)


Q: Why does the final stage of compilation take so long?

Q (long): The generation of a '.out' file is as follows:

  1. link the application and libraries to partialImage.o
  2. use partialImage.o to extract all static classes (munch)
  3. compile the above findings (ctdt.o)
  4. link the first obj file partialImage.o with ctdt.o

Our application ('.out) file is about 10 Mb of code, but this is mostly because of debug symbols, size386 returns a size of about 1 Mb.

The regeneration of our downloadable file takes in excess of 5 minutes. Step #1-3 runs at good speed (total 0:35)!!!, but the step #4 takes a lot of time, making the complete cycle 5:30.

A: I don't know why, but if we don't reuse the partialImage.o in step #4, but regenerate it, the whole cycle is completed in about 0:45!
(Has ld386 problems with opening large object files due to non optimal algorithms for symbol parsing??)

What I have done:
tornado\target\h\make\rules.vxApp contain the rules of how to make an application. I have changed the above mentioned step $4 which is was as follows:

$(LD_PARTIAL) $(LD_PARTIAL_LAST_FLAGS) partialImage.o ctdt.o -o $@
    

with the following:

$(LD_PARTIAL) $(PRJ_OBJS_FOR_LD_PARTIAL) $(PRJ_LIBS) ctdt.o -o $@
    

(From: Ole Asbjorn Fadum, OleAsbjornF@scanmar.no)

Some more information.
For a variety of reasons I've had to do a few build on a slow system. One bit that seemed exceptionally slow is the 'binToAsm' call (just after the 'deflate' generating vxWorks.Z.s). This is done by

    od -bv $infile |
    sed -e "s/^[0-9]*[ ]*//;
    s/ /, 0/g;
    /^[0-9a-fA-F][0-9a-fA-F]/s/^/ .byte 0/"
    

(ie use od to generate a list of octal bytes, remove the offset, change the spaces to comma, add the directive - an extra 0 is added to each number to ensure they are octal).
The above is terribly slow... Slightly faster (under solaris) is:

    od -An -v -tu1 $infile | tr ' ' ',' |
    sed -e 's/,00*\([0-9]\)/,\1/g;s/^,/      .byte   /'
    

However it is clear that a C program would be even faster... It was still sluggish using printf, so...

    char map[256][4];
    for (count = 0; count <= 256; count++)
        sprintf( map[ count ], "%d", count );

    for (;;) {
        count = read( input_fd, buf, BLK_SZ );
        if (count <= 0)
            break;
            for (off = 0; off < count; off++) {
            if (off & 15)
                putchar( ',' );
            else
                fputs( "\n      .byte   ", stdout  );
            fputs( map[ buf[ off ] ], stdout );
        }
    }
    

now the system is spending very little of its time doing this bit (it was a lot slower than the deflate!). If you are using gcc/gas you can pipe EXTRACT_BIN, COMPRESS, BINTOASM directly into AS - saving that massive intermediate file...
Build (compiling one small object) just took 6m50 - was over 10 minutes before I played with binToAsm!

Ages ago I sped up 'munch' - by grepping out most of the symbols it isn't interested in...

nmarm vxWorks.tmp | tee vxWorks.nm | grep " __" | munch > ctdt.c
    

(I use the symbol table from this stage for a variety of things...)
(From: David Laight, David.Laight@btinternet.com)


Q: How can I load a segment at a specific absolute address?

A: I have included a script to do this. The easiest way to get a script is to run your linker with the `--verbose' flag. Eg, "ldarm --verbose".
Edit the file to add a statement like this,

  .text  0x8000 : {
[omit]
        . = ALIGN(0x8000);
        /* Create a 8k section of all 0xffff, first value is jump. */
        FILL(0xffff);
        LONG(0xeb000004);
        . = ALIGN(0x2000);
[...]
    

This will place the data at what ever address you like. The new linker script must be passed with the -T option when the image is built.
You linker might be called ldppc or ldmips or ldx86 etc.
(From: Bill Pringlemeir, spam_account@sympatico.ca)


Q: I get an error when I use C++ style comment. How can I change this?

A: One way to do this is by removing the -ansi switch. However, you may wish to keep your source base ANSI compliant. I do use builtin alloca() and other functions occasionally; but I prefer the code to compile anywhere. Passing the "-Wp,-lang-c" argument should only enable CPP comments. Here is the comment from the pre-processor docs,

`-lang-c', `-lang-c89', `-lang-c++' 
`-lang-objc', `-lang-objc++' 
    
Specify the source language. `-lang-c' is the default; it allows recognition of C++ comments (comments that begin with `//' and end at end of line), since this is a common feature and it will most likely be in the next C standard. `-lang-c89' disables recognition of C++ comments. `-lang-c++' handles C++ comment syntax and includes extra default include directories for C++. `-lang-objc' enables the Objective C `#import' directive. `-lang-objc++' enables both C++ and Objective C extensions. These options are generated by the compiler driver gcc, but not passed from the `gcc' command line unless you use the driver's `-Wp' option .

(From: Bill Pringlemeir, spam_account@sympatico.ca)


Q: When I compile I get the errors about parameters/options to cc1.

A: This can be caused by another installation of Cygwin or DJGPP on your machine. When this version is in the path before the Tornado version of Cygwin its version of GCC (and CC1) gets called, and this version probably does not know these parameters or options.
This problem can be solved by removing the other installation or by ensuring that the Tornado version is the first version in the path.


Q: After upgrading from T2.0 to T2.2 the compilation becomes much slower

A: T2.2 comes with a dll from cygwin that provides a unix style API. (I dont remember the name), Windriver support said to replace this the latest dll from cygwin (they sent me one and it is the same as what cygwin distributes). It fixed the slow builds for me.
(From: Jansyn, jansynf@worldnet.att.net)


Q: When compiling C++ code (STL) the object size explodes

A: People are confusing C++ with STL. They are not the same. There is an embedded C++ standard that will significantly reduce the size of an executable if you follow the restrictions.
Compile with "-fno-exceptions". If you are using templates that require exceptions handling, i suggest you don't. Alternatively, you can look that the offending vxWorks STL file (maybe stl_alloc.h) and there is an "if 0" condition that should be changed to "if 1". Also disable RTTI with "-fno-rtti" as the another poster noted. You might also consider using "-fno-volatile", etc.
If you don't use templates, but just classes and polymorphism, you can make your own collections that are significantly smaller than STL. (even when you do use templates).
Other alternatives might be to look at PJ Plaugher's STL.
(From: Bill Pringlemeir, spam_account@sympatico.ca)


Q: Details on version GCC 2.96 distributed by WindRiver

A: I'll just clear up one thing here - the 2.96 that WRS distributes and the 2.96 that came with some Linux distros (notably some RH ones), are not the same at all. Wind decided to use the number 2.96 for their release (which is based on 2.95.x + some fixes from Wind's own testing and some additional features from semiconductor partners for specific CPUs) since it was not slated to be used by the FSF for any release - they were moving to the 3.x numbers. Unfortunately, Cygnus/RH had the same idea, hence this confusion.
(From: John, john_94501@yahoo.com)


Q: What is the Dia equivalent for the GCC option -mlongcall.

A: We're using Diab 5.0 and I think the options we use are
-Xcode-absolute-far
-Xdata-absolute-far
I believe these also work for the ARM/StrongARM/XScale architectures.
(From: Lori Fraleigh, lori@rti.com)


Q: Why can't I use inline assembler code in my program?

A: You need a space before the opcode:

  __asm__(" mtspr  154,3" );
  __asm__(" mfspr  3,154" );
Also, make sure you have the defines for the registers. The assembler doesn't know that r3 is a register. Try replacing r3 with just 3. These defines are in toolPpc.h, which should be included when you include asm.h, but maybe for some reason you're not getting them.
(From: Pete Kockritz, pkockritz@mac.com)


Q: I got the following error message from the compiler:

cpp.exe: Usage: C:\Tornado_PPC/host/x86-win32/lib/gcc-lib/powerpc-wrs-vxworks\cygnus-2.7.2-960126\cpp.exe [switches] input output
      
What is causing this and how can I solve it?

A: This is caused by spaces in the environment variables that specify the different path-locations used by the compiler. Make sure the PATH and TMPDIR variables don contain spaces (or for the PATH donĀ“t contain spaces in the location where the compiler is located).
(From: Daniel Cathell, daniel.cathell@lmco.com)


1.2 Debugger

Q: How do I use a "plain" version of GDB to debug my target, so without using Tornado?

A: gdb compiles 'out of the box' for vxworks.

This works on win32 if you have cygnus 'cygwin' installed. It works on Unix systems as is.

RDB is windriver's previous generation debugging protocol, now replaced by Tornado's 'wdb'. There seems to be no public released wdb bits, despite the fact that Tornado is clearly using gdb. You may have to configure RDB into your system (INCLUDE_RDB) and disable WDB (remove INCLUDE_WDB) to get it to go.
(From: Don Bowman, don@pixstream.com)


Q: How do I stop a task after creation, so I can debug it from the start?

A: Goto tools->options and on debugger tab and select always halt after attaching a task as well as Auto Attach to task -> Always.
Now put a global breakpoint (Shift F9) on 'subTask' and after it hit the breakpoint you have to detach from mainTask.
(From: Chacha Hindustani, Gurudev@mediaone.net)


Q: Why can't I see breakpoints when examining memory using the shell?

A: The shell is an unbreakable task, so all the time it is running the breakpoints are not installed. When a context switch causes a breakable task to run, the breakpoints will be resinstated.
So, to see the breakpoint in memory simply spawn the d() command or l() command. That will then run in a breakable task, and you should see the magic code inserted to cause an exception.
(From: John, john_94501@yahoo.com)


Q: Why is GDB so slow?

A: One of the things you have to do if you're on windows 2000 is set tgtsvr.exe to realtime priority to work around some problem
(From: Denis Perelyubskiy, kiev78@dslextreme.com)


Q: After installing visionClick I was not able to go to standby mode or hybernate in Windows 2000.

A: This is caused by the installation of DriverX by VisionClick. This driver can be removed/disabled.


1.3 FTP

FTP related questions have been moved to part 4.4.


1.4 Host tools

Q: I made a rom based version of VxWorks (vxWorks_rom), but when I try to convert this to a bin version (vxworks_rom.bin) using elftobin I get the following error:

C:\project\Project3\default\elftobin <vxWorks_rom> vxWorks_rom.bin
seg1 : Expected load address 0xfff00100 but file address is 0x00111670
    

How can I convert this image to a binary format?

A: This problem has only been reported for PPC architecture.
This problem is known as SPR#8845. There is an updated version of elftobin available for this problem. Ask you sales representative or service engineer for this version.


Q: How do I write a WTX tool?

A: I had write a WTX tool under Tornado 1.0.1 and Windows NT 4.0 and began by following the detailed example and explicit build/link instructions found in the Tornado API guide. Not even close to building, let alone working on my setup.
To be fair, I am compiling with Visual Studio C++, version 6, but there are still a lot of things missing, regardless of compiler versions. And I know I could be much more suave and sophisticated by using environment variables in the paths, but sometimes you just need to get it done. So here are the mods/clarifications:

  1. Source code placed in $(WIND_BASE)\host\src\wtxtest. Example source did not show up in my install, or anybody else's machine that I could check, as stated in the manual.
  2. Source code modified as shown below (mostly signal handler code mods and added includes, the other mods are specific to my application)
  3. Added the following to Project settings, C/C++, Preprocessor:
  4. Added the following to Project settings, Link, General (path was wrong): C:\Tornado_03\host\x86-win32\lib\wtxapidll-d.lib
  5. Added the environment variable WIND_REGISTRY to Win NT, set to my registry location. Lots and lots of pain and digging to find this one. Manual refers to a wtxEnvironSet() call that doesn't exist and is listed out of order in various places . Windsurf says it doesn't exist, and don't bother using it. The docs for the nonexistent function provide a confused set of references to all other tools using this function. WIND_REGISTRY was not set on my machine; all tornado tools are happy without it; my tool could not find the registry. Set it and poof!, registry found, tool works. Make sure you add the wtxProbe() call to check for the registry (and the variable being set), it will save a lot of grief.
  6. I also modified the tool sample code. This can be found here

(From: Christopher A Leddy, caleddy@west.raytheon.com)


Q: When I execute wtxwish I get an error about the init.tcl file.

A: Don't forget to set the TCL_LIBRARY and TK_LIBRARY environment variables to $(WIND_BASE)/host/tcl/tcl and $(WIND_BASE)/host/tcl/tk. The init.tcl file is located te TCL_LIBRARY path. The tk.tcl file is located in the TK_LIBRARY directory. Do not use the $(WIND_BASE) variable, but the actual path. Then execute the following from your TCL/TK directory:

wtxwish <yourTclFile>

(From: DrDiags, drdiags@flashcom.net)


Q: I am trying to run the vxsys program provided with tornado 2.0 under windows NT4.0 SP5. I get an error "the system try to access directly to the disk, this is not possible ....."

A: I think VxSYS is DOS utility, and doesn't work under Windows (at least NT4/5). You can't run it from DOS box, you need to actually boot DOS.
(From: Andray Kaganovsky, andreyk@home.com)


Q: How can I create (encrypted) passwords?

A: You can use vxencrypt that comes with Tornado to create passwords, but it is pretty weak.
I think it is sum( p[i] * i ^ i )) * 0x1e3a1d5 converted to ascii with a munged hex character set (presumably to make you think there are more than 2^32 encrypted passwords). I think I could reverse that using pen and paper.

You can also install your own encryption routine using loginEncryptInstall().
For a strong password [1], encrypt known plaintext using the password as the key. Unix traditionally uses DES - but that requires a moderate amount of code. I used 'TEA' - see http://vader.brad.ac.uk, since it is unencumbered.

[1] problematical since you have difficulty protecting the password file as none of the vxWorks filesystems support user-ids.

(From: David Laight)


Q: When building an application using the wtxapi DLL the applications crashes with an exception in the strlen function.

A: WTX applications should be run in a single thread. The WTX library is not thread safe.
(From: Lori Fraleigh, lori@rti.com)


Q: Why am I getting a WTX Error 0x100de (AGENT_COMMUNICATION_ERROR)?

A: This can be caused by the Cisco Deterministic Network Extender, which mucks about with MTU setting, causing Target Server transfers to fail for various reasons (the reduced MTU causes the packets from the target server to be fragmented, and WDB can't handle fragmented packets).
(From: Pete Flugstad, peteflugstad@nospam.mchsi.com)
Note: Another solution is to use SetMTU.exe utility provided by Cisco to restore the original MTU setting


1.5 Installation

Q: When I try to install the GNU source CD I get an error message about the file aux.h (permission denied). But that file does not exist. What is happening?

A: There is a problem with the microsoft SW (as could be expected :-). The name "AUX" is a reserved name. So any starting with "AUX." (with the dot) cannot exist. This is also true for any filename starting witgh a device name, for example you cannot open a filename with the name 'LPT1.TXT'.


Q: After I install Tornado or a patch to Tornado all my C-file types are removed and Tornado is used to open the files. How can I change this back to my normal editor?

A: Tornado overwrites the entries in the registry. This can be repared using the following .reg file.

WARNING: be very carefull before using this file! Read it first and if you don't understand it don't use it!

Another WARNING: This has been tested on Windows 95 and NT. When I have the time I will also check this on other platforms. If you use this on another platform (98, 2000) let me know if it works, or , if not, how to make it work.

Download the file first, then read it carefully, modify it so it executes your editor and then execute it. How can you modify it?
One way to do this is to execute the file, and then go to the Exporer and open View->Options->File Types. Here you search for the file-type "C Source File" and "C Header File". Change the open command to the one you like. Now edit the file c-files.reg and remove the part after line 20 (the first line starts with "[HKEY_CLASSES_ROOT\c_source_file]". The next time you execute this registry entry all file types will be restored to the one you just selected.
Another way is to find an entry in your File Types where your default ewditor is used. Copy this line to the file c-files.reg in the lines where a reference is made to vim (BTW: a very good editor, you can find more info on http://www.vim.org).
Now the file: c-files.reg


Q: When I double click on a file thatis opened in Tornado a new Tornado session is started every time. I would like Tornado to be re-used, and all files opened in the same Tornado session.

A: Yes, this is possible. The following registry file will do that for you.

WARNING: be very carefull before using this file! Read it first and if you don't understand it don't use it!

If Tornado is not installed at c:\Tornado, edit the file before merging it into your registry and adjust the path.
Now the file: TornadoFileTypes.reg


Q: Is it possible to install multiple architectures into one tree?

A: Yes, that is possible. There are however some points to take into account:


1.6 Make

Q: Make can't find my include files in a separate directory

A: Add the directories to the 'C/C++ Compiler' options, using -I<dir>. Now include the following item in the properties of the build specification:

Macros: Name: VPATH
Value: $(filter-out -I.,$(filter -I%,$(CFLAGS)))

After a change of include dirs only the compiler options have to be updated. The update of VPATH is automated by the rule above.
After this change save the workspace to ensure that the changes are active. Now (re-)generate the dependencies and start the compiler.

Bob Baker (Bob@dskti.com) wrote about his experiences with the problem:

We have been having lots of problems using tornado 2 when building an application with the 'No rule to make target' appearing. Having tried all the usual black magic cures. E.G. using ':' for VPATH separators instead of spaces. Using 'space :' or ': space' or 'space : space', changing the order of the macro's, forward slashes, back slashes, double slashes, pointing the PC screen south at dawn etc the problem turned out to be incompatibility between tornado 2 and win95/98. Simply copying the whole directory structure containing the application and project files onto an NT box solved the problem and produced a complete build. Copying onto another win95 and win 98 box and the builds failed. The point of failure was where the build was trying to access a file in a shared library on a network drive. I have tried different combinations of seperator in the VPATH and they all work on the NT box.


Q: Why does make not regenerate my project after I changed a file in the BSP directory (for example sysSerial.c) ?

A: Within Tornado you can define directories that are not scanned for include files. One of the default directories is the BSP directory (target\config). If you remove this from the exclude list the BSP files will appear in the dependencies list.
After you select to generate dependencies select the Advanced button. Now you get a window with an item called "Read-only dependency path. Remove the item .....\target\config from the list. Close the window, and regenerate all the dependencies. The next time one of the BSP files is changed the files will be generated correctly.
(From: gerard.kerkhofs@nicolet.NOSPAM.nl)

Another solution is not to remove this item, but to replace it with .....\target\config\comps. Now you get all the files in the BSP directory, but not the files in the comps directory, where a lot of "standard" files are placed.


Q: How do I generate a linker list from within my project?

A: The default linker commands as given in the properties of the build specification are not used by make. To get make to use extra options for the linker add the following item to the properties of the build spec:

Macros: Name: LD_PARTIAL_FLAGS_FOR_PARTIALIMAGE
Value: -Wl,-Map,$(basename $(notdir $(PRJ_FILE))).link

Then modify the linker command line for LD_PARTIAL in target $(PROJECT_OUT) in the file rules.vxApp:

$(LD_PARTIAL) $(LD_PARTIAL_FLAGS_FOR_PARTIALIMAGE) \
$(PRJ_OBJS_FOR_LD_PARTIAL) $(PRJ_LIBS) -o partialImage.o

This generates a linker output file names <Project>.link in the output directory. In this files the names are mapped to the original .o-files and not to partialImage.o, what would happen if the file was generated using the final link command.


Q: How do I generate a combined C and assembly file?

A: Add the following rule to your Makefile:

%.out:          %.o
                @objdump$(TOOLENV) -S $< < $@
    

This will generate a file called <file>.out containing C and assembly code. You need to have the -g flag for the compiler to get debug informtion in the output file. This information is needed by objdump.

But this is probably not enough. By default VxWorks puts a name in the object file. This name consists of the absolute path of the project directory with the complete path of the file name appended to it. (This can be seen with the command "objdump$(TOOLENV) --debugging <object file>", in the first few lines the filename is given.) This is caused by the fact that the compiler is called with the complete path of the sourcefile. This can be changed to ".." in the Makefile. But the Makefile is generated each time the configuration is changed.
To correct this the file prj_vxApp.tcl can be changed to write ".." to the Makefile istead of the complete path. This is done in the function makeGen. The original line in this function is:

puts $fd "PRJ_DIR        = [file dir  [prjInfoGet $hProj fileName]]"
    

This should be changed to:

puts $fd "PRJ_DIR        = .."
    

(With assistance from Bill Pringlemeir, spam_account@sympatico.ca)


Q: How do I add extra .o files to my project?

A: Add the files to the macto EXTRA_MODULES. The names can be sperated with spaces. Be sure to have the object files in the same directory as your other object files.
It is also possible to place the files in the same directory as your source files. In the macro you have to use ../<object files name>. The advantage of this is that you can do a make clean or rebuild all without loosing your own object files.


Q: I want to generate documentation using make man for some extra files in my BSP, but only the documentation for sysLib.c gets updated. I added my files to the line DOC_FILES in the BSP Makefile.

A: In the make environment the DOC_FILES variable is not used. The following changes should be made:

As far as I can see this problem only occurs on a Windows platform and not on a Unix platform.


1.7 Project facility

Q: The project facility cannot be used with sub-projects within a project. How do I manage these kind of projects?

A: See the Project Facility page for a description of this item.


Q: When I make changes to the file usrConfig.c the changes are not in my application. How can I have these compiled into my application?

A: Tornado 2.0 project does not use usrConfig.c It uses "configulettes" instead , they can be found in target/config/comps If you would like to use usrConfig.c , make the Makefile in target/config/yourBsp
(From: Roie Geron, roie@ecitele.com)


Q: How do I regenerate the project files outside of Tornado?

A: Use the following command to regenerate these files from the directory that contains the project file for a bootable project:

wtxtcl <Tornado base>/host/src/hutils/configGen.tcl <Project>.wpj
    

This is the command that is also used by Tornado. When the configuration is changed this command can be seen as the first command that is executed when a build is started.

For downloadable projects there is no standard command. A modified version of configGen can be used, called makeGen.tcl. Copy this file to the ..../host/src/hutils directory. The Makefile can be generated using the command:

wtxtcl <Tornado base>/host/src/hutils/makeGen.tcl <Project>.wpj

Be sure to use the complete pathname of the <Project>.wpj file


Q: When I generate dependencies some of the dependencies are missing. They are outside the Tornado tree, but the directories are included using -I and using the VPATH macro.

A: We met the same problem before, you can change the include definition from #include "xxx\xxx\xxx.h" to #include "xxx/xxx/xxx.h", then test it again.
(From: ellin_lin@263.net)

Something I found in this area is if this is occurs on a Windows Host, make sure the directory name used in the -I statement is capatilized exactly as if this was a UNIX machine. If your directory is MyDirectory and you put -ID:/MYDiRECtory, the project tool may not be able to find the header files (at least on WinNT). I also was told to put my -I. as the last -I flag, but I am not too sure about that one. Things I do now when creating test applications or building new projects, is that I put the -Ipath in my build properties before I even start to add source file, because I have seen dependency files that had no path associated with them, then of course you get the no rules to make error. Here is some other info I got, but once again you would have to take it with a grain of salt because it seems somewhat simplistic:

(From: DrDiags, drdiags@covad.net)


Q: How can we share WPJ files between developers, where the developers have different locations for their development trees?

A: We have faced this issue in a development which involved multisite development and could solve it by using the DOS Command "subst" in Windows environment .
With this command You can map any Directory in any Share C: or D: or anything to any other Share Name.
For example:
One user may be using C:\VxworksDev in his environment as the Dev Path Another user may be using D:\Development in his environment . They can Map their Development Paths to a Common Drive , Say "K:" by

         1st User : subst K: C:\VxworksDev
         2nd User : subst K: D:\Development 

Now both users will be having a Common Path K: and if the Original WPJ is created under this K: and if all the Include Paths comes Under this Structure , there wont be any issues.
(From: Babu T S, babuthanissery@hotmail.com)


1.8 Target server

Q: How do I start a target server outside of Tornado?

A: First create a shortcut that starts a DOS box. Then, in Tornado, configure your target server so it starts up nicely. Select and copy the text down at the bottom of the target server configuration dialog. Then, back in the dos box "properties", paste the target server command. Drag the shortcut into your startup folder and you're done.
(From: John Finley, john@kivala.com)


Q: Normally my code takes a couple of seconds to load. But now I added a small application and it takes ages before my application is loaded. How can I speed-up the download again?

A: Increase the Memory Cache Size in your target server configuration. The default size is 1 Mbyte. Increasing this will reduce the loading time to normal values again.
(From: Wade Oram, oram_w_t@ifrinternational.co.uk)


Q: When I start the Targetserver I get an WTX error. It also says synchronisation stopped. How can I fix this?

A: One solution to this problem is to use the remote registry, even if you are using a target server on your local machine. This can be done by setting the remote registry and using the real IP address of the host as the IP address for the remote registry.

Basically, "localhost" gets stored in the Windows registry for the name of the machine running the Tornado registry. The WTX tools on the host resolve localhost to the ip address 127.0.0.1 and pass this down to the target. The target then tries to communicate with 127.0.0.1 to enable the symbol table synchronization but ends up talking to itself and not the Windows host. Neat "feature".

If your Windows machines has multiple ethernet interfaces and the target is located on a non-primary interface, this still won't be enough. The machine name will get resolved to an ip address that the target doesn't know about. You will need to execute a routeNetAdd on the target before connecting the target server in order to get symbol table synchronization to work.
(From: Markus Mitterer, markus.mitterer@sbu1.storkgroup.com and lori@rti.com)


Q: When I enter a command in the shell I get the message "The target system is not initialized yet. Can't proceed."

A: The "target not initialized message" in the host shell goes away when you specify the "vxWorks" file (an intermediate file in building of the rom image) as the core file under the "Core Files" drop-down options in the target server configuration. I had been specifying the "vxWorks_rom" file. I also have "synchronize host/target symbol table" selected in the target server configuration and in the vxWorks image options and that works fine now.
(From: Luciana Messina, lucianam@ricochet.net)


1.9 Target shell

Q: When I exclude the shell from my project I get an error executing dosFsDevInit. How can I include DOS FS without the shell?

A: This looked mightly wierd at first, but a few thoughts later I had remembered that old dosFsLib (as opposed to DosFs 2.0) uses a in-RAM database of file names, using the hasLib(1) hash table. Hence if you exclude any kind of symbl tables, it may just occur that hashLib gets included in the link, but does get initialized.

One probable reason noone has come accross this is because it is very common to have INCLUDE_STAT_SYM_TBL turned on and that is a kind of a symbol table too. So you should either have the above, or simply add a call to hashLibInit() someplace before dosFsInit.
(From: Leonid Rosenboim, leonid@bitband.com)


Q: On startup WindShell is supposed to start the file windsh.tcl. I created this file in the directory .wind, but it is not executed. What am I doing wrong?

A: Nothing. There seems to be a bug in WindShell, so it is not looking in the directory in main Tornado directory, but on the C-disk. So if you move your windsh.tcl file to the directory C:\.wind this file will be executed.


Q: When I execute ping "myHost" there seems to be memory lost in the target shell. Why is the shell losing memory?

A: The shell has to allocate memory in the target for the text string (remember it has to pass the address of the string to the function). The shell can not determine when/if it is safe to free this allocated memory, so it is better to leave it. It can not reuse the string next time either, because the string might have changed, so it will allocate some more memory next time you call ping. You could try to use a variable:

pingaddress = "myHost"
memShow
ping pingaddress
memShow
    

(From: Urban Lindberg, urbanl@my-deja.com)


Q: How can I repeat a command with an increasing parameter?

A: You can write an extended repeat command and use that. The source for repeat lives in /target/src/usr/usrLib.c
Should be quite an easy task...
(From: Werner Schiendl,ws-news@gmx.at)


Q: How can I list all known 2 letter symbols using lkup?

A: If you want to list all the two letter symbols known to `lkup`, you can indeed enter:

lkup "^[a-z][a-z]$"
    

Notice the trailing "$" - that is key. Here this command shows me only the symbol "fd" ... unless I go create more two letter symbols. Trying:

lkup "^[a-z][a-z][a-z]$"
    

shows me all of div, tan, pow, cin, end, exp, sin, cos, log, abs.
(From: p_lavarre@my-deja.com)


Q: How do I increase the maximim linelength of the target shell from 128 characters?

A: I'm not sure what you need to do exactly but I've had a similar problem. I put some of the longer paths into a string and then passed the string as the variable on the command line. This allowed us to get by the 128 character limit. Also consider setting environment variables. The first is easier.
(From: Don Small, dmsmall@sandia.gov)


Q: How can I get my application to read data on the port the shell is using?

A: Finally I found a way to scan user input without the interference of shell :) ... the only way that worked for me is to delete shell task just before reading input and respawn shell after reading ... it works ...

/*******************************************************/
        shelltid = taskNameToId("tShell");

        taskDelete(shelltid);
        for( ; ; )
        {
                // read
        }
        shellInit(0,TRUE);
/*******************************************************/
    

(From: Mridul Gupta, mridulgupta1@yahoo.com)


Q: When I execute a command from the shell with a string in it, I experience a memory leak. Why does this happen?

A: When you use literal strings from the shell (such as filenames that can be passed to open()), the shell allocates some memory to store the string in.
Such it doesn't know when you've finished with the string, it cannot free the memory. To prove this to yourself, try allocating the string to a variable before the initial memShow() call:

-> filename="myFileName"

-> memShow

-> open filename, 2
    

(From: john_94501@yahoo.com)


Q: Are there any alternatives for the target shell?

A: One alternative can be found at http://www.xmission.com/~bgeer/bgsh.html: BGSH: A VxWorks Shell With Command Line Editing.
(From: Pekka Taipale, pjt@iki.fi)


Q: How can I execute shell commands from my program and use the output?

A: I wrote the following function to do this. It takes the shell command as a string, and the output file, executes the shell command and redirects the output to a file, it used in the shell by:

    -> shellToFile("ifShow","ifShow.out")

You can easily modify it to do what you want.

//
//
//  This function runs a shell command and captures the output to the
//  specified file
//

extern int consoleFd;
typedef unsigned int             (*UINTFUNCPTR) ();

extern "C" int shellToFile(char * shellCmd, char * outputFile)
{
int rtn;
int STDFd;
int outFileFd;

   outFileFd = creat( outputFile, O_RDWR);

   printf("creat returned %x as a file desc\n",outFileFd);

   if (outFileFd != -1)
   {
    STDFd=ioGlobalStdGet(STD_OUT);
      ioGlobalStdSet(STD_OUT,outFileFd);
      rtn=execute(shellCmd);
   if (rtn !=0)
    printf("execute returned %d \n",outFileFd);
      ioGlobalStdSet(STD_OUT,STDFd);

   }
   close(outFileFd);
   return (rtn);
}
    

(From: RonnoBonno, RHNAssociates@yahoo.com)


Q: How can I inspect static variables?

A: Do an nmxyz on the image (elf, a-out, ...) and extract the address, you may dump the content of it later, e.g.:

#> nmppc vxWorks | grep ftpsActive
0023dc60 d ftpsActive
    

(From: Toni Kurzberger, gonozal@gmx.at)


Q: When I start a telnet session the application that is running from within the shell is aborted.

A: The vxWorks target shell code is not not re-entrant, so there can only be one instance of it running at once. Therefore in order to be able to support the telnet operation the telnetd task restarts the shell task after switching its file descriptors to the telnet socket.
The behaviour you're seeing demonstrates that there isn't any protection that prevents the shell from being restarted while it's in the middle of executing a command, and in fact you really wouldn't want there to be because the same shell restart operation is used when you type a CTRL-C to abort a hung or runaway operation.
If you want your long-running operations to continue through a shell restart, you'll have to run them in their own task; the 'sp' command is designed for that.
(From: Andrew Johnson, anj@aps.anl.gov)


1.10 Telnet

Telnet related questions have been moved to part 4.7.


1.11 Tornado

1.11.1 Tornado (General)

Q: How do I redirect the virtual console output to a file?

A: The follwing has been written in the newsgroup by Dave Gurak dmgd@eci-esyst.com:

I have successfully redirected IO to the virtual console using ioGlobalStdSet.
However, since my NT console window which contains the tgtsvr has no method of redirecting this info to a file, (ala Unix xterm) ...
Once I realized that the windsh is a tcl interpretter and /vio/1 is echoed to the windsh, I found a solution.
All I did was override the windsh's definition of VIO_WRITE_Handler {event} to write to a file by changing "memBlockWriteFile $mblk -" to "memBlockWriteFile -append $mblk log.txt".
Included is my windsh.tcl file. Hope it's useful.

See also the remark here.


Q: How do I redirect standard I/O to another device?

A: Aaron Kunze made the code in this file (stdio_rd.c) available in the newsgroup. This file contains a number of examples on how to redirect I/O to a device. Other device can be included.


Q: How can I repeat a command from the host shell with increasing parameters?

A: You can use the built in Tcl interpreter for looping. From the shell, enter ? to get into Tcl mode.
To execute the command dumpBlock with an increasing parameter use the following commands:

-> ?
tcl> for {set x 0} {$x<100} {incr x} {
tcl>   shParse "dumpBlock $x"
tcl> }
tcl> ?
-> ...

The "?" toggles between Tcl and C mode.
(From: Markku Kotiaho kotiaho@m_a_i_l.com)
See also question 1.9-D.


1.11.2 Tornado (Windows)

Q: The TSR tool crashes when I try to report a TSR and attach a file.

A: There is a problem in the MAPI implementation of the attachment function in the Support Request tool. If possible use the SMTP interface to send TSR's.


Q: One of the windows of the debugger has disapeared. When I press the button in the toolbar or select the window using the Debug menu nothing happens.

A: The window is probably off-screen. The way to get it back on-screen is by using a program to give a 'Move Window' command to the window. A crude way to do that is the following program (this is an example I used to get the variable window back on screen again):

/* (C) Johan Borkhuis, 1999 */

#include <wtypes.h>
#include <winuser.h>

void
main(void)
{
    MoveWindow((HWND)0x194, 10,10, 94, 88, TRUE);
}
    

The parameters to MoveWindow are:


Q: When I am building the build process hangs somewhere during the build (for example on a the command vxrm.

A: The answer is to disable your anti-virus software. There is a known problem with some versions of Macaffee I'm told. Out of desperation, I disabled my Norton and voila! I could build again.

The interesting thing is that I was successfully running and building for a relatively long time and then all of a sudden it stopped. My colleagues continued to run fine and then all of sudden, one by one, they began to run into the same problem. I'm not sure what the trigger is but it may be related to the size of the project.

Check out TSR 159521 for more info.

(From: mchug06@attglobal.net)


Q: When I use Tornado under Windows 2000 the build process seems go wrong, when it works fine under 9x and Windows NT.

NOTE: there is a patch available from WindRiver. Look on http://www.wrs.com/csdocs/kplocator/patchList.shtml for more information about this patch.

A: Install the resource kit for Windows 2000. It includes an Application Compatibility tool. You can use this to tell Tornado it is running in an NT environment. It's located in the support directory of the Win2k CD. All you have to do is run apcompat.exe and tell it to run Tornado as if it were on Windows NT. Make sure to check the "Make the abov check box settings permanent" box.
For more information on the Application Compatibility Tool go to Microsoft's online knowledge base and read article Q251062.

Another solution might be to use an IP address in the remote registry instead of a hostname. It is also a good idea to use the remote registry feature, even if the registry is running on the same machine. (see question 1.8-C).
(From: Niall Leonard (niall@exchange.Scotland.ncr.com), Kirk Davies (kirk.davies@pobox.com), Arik Halperin (arikh@hlan.com) and Adam)


Q: I cannot start the debugger. On startup of Tornado I get the message "DebuggerSetUp Failed : StatusBarPaneTextSet". Also some other functions do not work.

A: Try installing Tornado again with Administrator privileges.


1.11.3 Migration

Q: When running prjMigrate while porting from T2.0 to T2.2 I get the following error message: Unknown CD: TDK-15060-ZC-02. How can I get rid of this error?

A: Look in the file infoLookupTables.tcl for a line that looks like:

      set versionCD{TDK-12840-ZC-00} 2.0.2
    

and add a line that has the CD id in the error message (I don't know if order is important). You might also want to look for something that looks like:

        set cpuList(walnut) PPC405
    

to see if there is one that represents your BSP and processor.
(From: Jansyn, jansynf@worldnet.att.net)


1.12 Version control

Q: After I check out a project no files are shown in the workspace window.

A: The project files (.wpj and .wsp) should be saved in "Unix"-style with only LF characters. Some version control systems (VSS for example) convert text files to DOS text files, with CR/LF. In VSS the project files and workspace files should be marked as binary. This can be done when clicking in the files, or by adding *.wpj and *.wsp to the list of binary files in the Tools->Options->FileTypes screen.

Another solution is to modify the TCL files that read and generate the project files. Within these file there is a command to set the mode to 'LF'-only. The command to do this is 'fconfigure'. In several files in the directory tornado/host/resource/tcp/app-config/Project the line:

fconfigure $fd -translation lf
    

appears. This line can be deleted (ot turned in to commentary by adding a hash sign at the start of the line). Then all project files will be saved in DOS file format and will also be read in DOS files format.
This line appears in the following files:

(From: Stas Maximov, stmax@pigeonpoint.com)


Q: Should I put the complete Tornado tree under version control or not?

A: Checking in the Tornado target tree as a whole is a good idea in my opinion.
The biggest advantage is, that service packs and patches are propagated automatically to other team members and _even_more_important_ to the build machine. An other advantage is, that if you need to debug something in an old version, you have the correct header files and libraries.

WARNING: If you check in the library files of VxWorks (which we did, for the reasons mentioned) - do not forget to check them out _before_ installing an add on package like WindWeb Server. Otherwise the installer will SILENTLY fail to update your libraries :-)
From: Werner Schiendl, ws-news@gmx.at)


1.13 Visual Studio integration

Q: We would like to integrate Visual Studio to be the editor that T2 uses. (Tools --> options --> External Editor). How can we manage this?

A: The following was written in the newsgroup by Gerald van Kampen (kam@oce.nl):

We do it the other way around. We use Visual studio IDE to build our VxWorks applications. Especially the browse information is missing in Tornado.
Below you'll find the external makefile with wich you can create your msdev project. In the msdev project settings change nmake with make, set the correct browser file name and output file name (..\bin\sys.bsc resp. ..\bin\sys.out) and type rebuild in the rebuild all options.
Add folders and files to your msdev's Workspace as needed.
In the tools -> options menu add directories for your include and tornado executable paths and place them at the top of the list.
Caveat's:

Adapt the Makefile to your needs (for example use cpp instead of c).


Q: Visual Studio does not recognise the filetype .cc as a C file. How can I tell Visual Studio that this type is also a C-type file, so that its "source browser" and "class view" features could be utilized?

A: By default , CPP and C files in Visual Studio will automatically invoke the MS complier. To associate other file types with the compiler use the /Tp (or is it /tp) option to declare that a foreign file type should be treated as a CPP file. I think /Tc is for associating foreign files with a "C" construct.
(From: Don Wade, donwade@nortelnetworks.com)


Q: When using Visual Studio as development environment and the GNU compiler to compile Visual Studio does not recognise the output of the compiler.

A: Using the following program to filter the output of the GNU compiler it is possble to compile the code: gnu2msdev.cpp
The rule to compile using this program is (the name of the comiled executable is gnu2msdev.exe:

%.o : %.cpp
        -$(CXX) $(C++FLAGS) $(ADD_FLAGS) -c $< -o $(@F) 2> $(TMP)\ccerr.txt
        @type $(TMP)\ccerr.txt | gnu2msdev

(From: f.pertin@staubli.com)


1.14 Windsh

Q: How do I create a startup file for Windsh?

A: Create a file windsh.tcl in the directory %HOME%/.wind. If the variable %HOME% does not exist create this in your startup file. One possibility is to use the .wind directory in the Tornado directory, or a directory in your project directory, to avoid putting project specific items in the general Tornado tree.
In the windsh.tcl you can give the commands that have to be executed at the start of Windsh, for example

cd "whatever directory"

Be sure to use forward slashes in pathnames instead of backward slashes.
(From: Mike Beede, mbeede@ciprico.com)


Q: When I call a function with float or double parameters from Windsh the parameters get corrupted.

A: The shell defaults every variable to integer. You can cast you argument into float. It will work. Like:

foo((float) 20.01)

(From: ywu@imatron.com)


Q: How do I change the command prompt?

A: Execute the following command:

shellPromptSet "VxWorks command prompt .... "
    


Q: How can I get a directory overview of the target from the host shell?

A: When a '@' is put in front of the command it is executed on the target instead of the host. So the command '@ls' will give you a directory overview of the current directory on the target. With the command '@cd <path>' the current directory can be changed, and with the command '@help' the help on the target can be executed. All command can be executed this way on the target, even the commands that are not available on the host shell.


Q: I get an "undefined symbol" error trying to execute a function, when the symbol is known:

-> ld <router
value = 134204756 = 0x7ffcd54 = bgpNode + 0x310
-> sp ace_main
undefined symbol: ace_main
-> lkup "ace_main"
ace_main(unsigned int) 0x07cbd934 text (router)
global constructors keyed to ace_main(unsigned int) 0x07cc0c80 text (router)
global destructors keyed to ace_main(unsigned int) 0x07cc0c48 text (router)
value = 0 = 0x0
    

A: A possibility is that you ace_main is a munged C++ symbol. If it is compiled in a .cpp file and is now given C linkage (extern "C") that could be the case. Then it is possible that the shell doesn't know how to decode C++ munged names. Try preceeding the definition of ace_main with extern "C" if this sounds like it could be the problem:

extern "C" int ace_main(unsigned int)
{
    ... code here...
}
    

Then recompile, relink and see if you can spawn a task using ace_main.
(From: ddewar@my-deja.com)

Or alternatively, type "sp ace_main" and then press Ctrl+D to add the signature to the end of the mangled C++ name before you press enter. Ctrl+D completes any partially typed symbol, and is *very* useful when you need to refer to mangled C++ names from the command shell.
(From: Dave Korn)


1.15 Windview

Q: When I look at the timing using WindView sometimes it looks like the timerinterrupt takes a lot of time. What causes this?

A: This is an error in WindView, and confirmed by WindRiver.
(From: Anthony D. Truong, AnthonyDTruong@email.msn.com)


Q (short): How to create WindView user events?

Q (long): I've been trying to customize the Show Event dialog box for user events as per the WindView 2.0.1 users guide section F.3.
I've created the eventbase.tcl file in the .wind directory (I have two .wind dirs, one in C:\.wind and one in C:\Tornado\.wind) to display two INTs stored in event 60. The contents of my eventbase.tcl file are:

set wvUsrEventFormat(60) {
    {"INT1" int}
    {"INT2" int}
}
    

I can only ever get the default display to work. I know the wvEvent() call is working as the events are logged and I can see the two integers as one long number in the default display of the ShowEvent box.
Is there more to the eventbase.tcl file than what's shown in the example? Or have I completely missed something fundamental?

A: The documentation for user events in the WindView 2.0.1 manual is wrong. After some experimentation, we've found that the following will work. First, the "function/procedure" that must appear in eventbase.tcl should look like this:

proc userFormat00060 eventData {
}

Your example shows that your user event is a structure containing two integers. One way to format them is to do the following:

proc userFormat00060 eventData {
    set data1 [string range $eventData 0 7]
    set data2 [string range $eventData 8 15]

    return [format "int1 is %s\r\n int2 is: %s" $data1 $data2]
}

Another way to do this is:

proc userFormat00060 eventData {
    set data [userEventFormat $eventData {n4 n4}]
    set data1 [lindex $data 0]
    set data2 [lindex $data 1]
    return "int1 = $data1, int2 = $data"
}

If your host and target are of different endian types, you will also need to byte swap the data. You can poke around the tcl files in the Tornado tree for more ideas.
(From: Lori Fraleigh, lori@rti.com)


Q: How can I modify the default format for user events from raw hex data?

A: Some of the text that follows may help. If you figure out how to make the GUI understand newlines in the ListBox widget, pass it on. I know in Tcl you can change how the widget deals with newlines inserted in text, but the Windows version of the GUI doesn't seem to allow you to manipulate how to place your formatted strings (i.e. your string is one long text string). See the following copy of information that was passed on to me.
(From: DrDiags, drdiags@covad.net)


Q: In WindView task are listed several times

A: This is a known problem if you're using post mortem mode, and the buffer is uploaded before it has filled and started cycling. The 'workaround' we were told from WRS is to right click on every second item and hide it.
(From: Tim Shaw, Tim.Shaw@dsto.defence.gov.au)


Q: Why does the export to Excel function not work?

A: as WRS-support told me once upon a time, 'export' only works with American version of Excel, so if you have it at hand ...
(From: "Michael Lawnick, Lawnick@softec.de)


Index

1.1 A When I want to link some object files to one, there was one error "ldppc:built in linker script:43: syntax error" How do I get rid of this error?
B How do I upgrade to a new version of the compiler?
C When compiling the code with another compiler I get many more warnings and errors. How can I get GCC to generate more warnings?
D When I compile my module everything is OK, but when I try to download this module I get an error on a missing symbol "__eabi".
E Problems using the compiler version 2.95.2 with current libraries
F How can I decrease the time of the last step in the compile process (the munching)?
G How do define a structure without holes in it?
H How can I call a C++ function from within a C-file?
I Is the -fvolatile flag really needed?
J I do a link with a lot of archives, now the linker has problems resolving the cross references between the archives.
K What does the warning "trigraphs occured" mean?
L Why does the final stage of compilation take so long with a large file?
M How can I load a segment at a specific absolute address?
N I get an error when I use C++ style comment. How can I change this?
O When I compile I get the errors about parameters/options to cc1.
P After upgrading from T2.0 to T2.2 the compilation becomes much slower
Q When compiling C++ code (STL) the object size explodes
R Details on version GCC 2.96 distributed by WindRiver
S What is the Diab equivalent for the GCC option -mlongcall.
T Why can't I use inline assembler code in my program?
U Getting strange error message from the compiler
1.2 A How do I use a "plain" version of GDB to debug my target, so without using Tornado?
B How do I stop a task after creation, so I can debug it from the start?
C Why can't I see breakpoints when examining memory using the shell?
D Why is GDB so slow?
E After installing visionClick I was not able to go to standby mode or hybernate in Windows 2000.
1.4 A I made a rom based version of VxWorks (vxWorks_rom), but when I try to convert this to a bin version (vxworks_rom.bin) using elftobin I get an error. How can I convert this image to a binary format?
B How do I write a WTX tool?
C How can I get a directory overview of the target from the host shell?
D Problems running VXSYS under NT
E How can I create (encrypted) passwords?
F When building an application using the wtxapi DLL the applications crashes with an exception in the strlen function.
G Why am I getting a WTX Error 0x100de (AGENT_COMMUNICATION_ERROR)?
1.5 A When I try to install the GNU source CD I get an error message about the file aux.h (permission denied). But that file does not exist. What is happening?
B After I install Tornado or a patch to Tornado all my C-file types are removed and Tornado is used to open the files. How can I change this back to my normal editor?
C Can I reuse a Tornado session when I open a file using the MS-Windows explorer?
D Is it possible to install multiple architectures into one tree?
1.6 A Make can't find my include files in a separate directory
B Why does make not regenerate my project after I changed a file in the BSP directory (for example sysSerial.c) ?
C How do I generate a linker list from within my project?
D How do I generate a combined C and assembly file?
E How do I add extra .o files to my project?
F I want to generate documentation using make man for some extra files in my BSP, but only the documentation for sysLib.c gets updated.
1.7 A The project facility cannot be used with sub-projects within a project. How do I manage these kind of projects?
B When I make changes to the file usrConfig.c the changes are not in my application. How can I have these compiled into my application?
C How do I regenerate the project files outside of Tornado?
D When I generate dependencies some of the dependencies are missing.
E How can we share WPJ files between developers, where the developers have different locations for their development trees?
1.8 A How do I start a target server outside of Tornado?
B Normally my code takes a couple of seconds to load. But now I added a small application and it takes ages before my application is loaded. How can I speed-up the download again?
C When I start the Targetserver I get an WTX error. It also says synchronisation stopped. How can I fix this?
D When I enter a command in the shell I get the message "The target system is not initialized yet. Can't proceed."
1.9 A When I exclude the shell from my project I get an error executing dosFsDevInit. How can I include DOS FS without the shell?
B On startup WindShell is supposed to start the file windsh.tcl, but it is not executed.
C When I execute ping "myHost" there seems to be memory lost in the target shell. Why is the shell losing memory?
D How can I repeat a command with an increasing parameter?
E How can I list all known 2 letter symbols using lkup?
F How do I increase the maximim linelength of the target shell from 128 characters?
G How can I get my application to read data on the port the shell is using?
H When I execute a command from the shell with a string in it, I experience a memory leak. Why does this happen?
I Are there any alternatives for the target shell?
J How can I execute shell commands from my program and use the output?
K How can I inspect static variables?
L When I start a telnet session the application that is running from within the shell is aborted.
1.11.1 A How do I redirect the virtual console output to a file?
B How do I redirect standard I/O to another device?
C How can I repeat a command from the host shell with increasing parameters?
1.11.2 A The TSR tool crashes when I try to report a TSR and attach a file.
B One of the windows of the debugger has disapeared. When I press the button in the toolbar or select the window using the Debug menu nothing happens.
C When I am building the build process hangs somewhere during the build (for example on a the command vxrm.
D When I use Tornado under Windows 2000 the build process seems go wrong, when it works fine under 9x and Windows NT.
E I cannot start the debugger.
1.11.3 A When running prjMigrate while porting from T2.0 to T2.2 I get an error message.
1.12 A After I check out a project no files are shown in the workspace window
B Should I put the complete Tornado tree under version control or not?
1.13 A We would like to integrate Visual Studio to be the editor that T2 uses. (Tools --> options --> External Editor). How can we manage this?
B How can I tell Visual Studio that .CC is also a C-file extension?
C When using Visual Studio as development environment and the GNU compiler to compile Visual Studio does not recognise the output of the compiler.
1.14 A How do I create a startup file for Windsh?
B When I call a function with float or double parameters from Windsh the parameters get corrupted.
C How do I change the command prompt?
D How can I get a directory overview of the target from the host shell?
E I get an "undefined symbol" error trying to execute a function, when the symbol is known.
1.15 A What causes the long timerticks in WindView?
B How to create WindView user events?
C How can I modify the default format for user events from raw hex data?
D In WindView task are listed several times
E Why does the export to Excel function not work?


VxWorks Homepage
© J.A. Borkhuis, 2000 - 2005
Send me an e-mail if this page was helpfull