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.12 Version Control
1.13 Visual Studio integration
1.14 Windsh
1.15 WindView
Index
ldppc:built in linker script:43: syntax errorHow 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.
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.
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_LABELNow change into your build directory, do a "make clean", and then rebuild and reinstall the compiler.
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.outThe 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),d0You can imagine what a C++ application using the "this"
pointer everywhere gets compiled into!
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:
$(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.
.extern symbol for each undefined symbol and include that into
the link before the libraries
[ ! -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.
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:
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). 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... 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...)
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.
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, bpringlemeir@yahoo.com)
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.
A: gdb compiles 'out of the box' for vxworks.
configure --target=mips-wrs-vxworks". Change 'mips' to
your processor architecture.
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)
C:\project\Project3\default\elftobin <vxWorks_rom> vxWorks_rom.bin seg1 : Expected load address 0xfff00100 but file address is 0x00111670How 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:
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)
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:
set
tool sfgnu should be replaced by set tool gnu. Between
the 2 if-statement the line set tool sfgnu should be aqdded
again. Now only in case of MIPS the tool variable is changed. This should be
made more sofisticated, but if you are using only one MIPS-type processor
this should work.
if { $cpuType($cpuId) == "RC32364" } {
set name [wtxPath target lib obj$cpuType($cpuId)sfgnuvx]spyLib.o
} else {
set name [wtxPath target lib obj$cpuType($cpuId)gnuvx]spyLib.o
}and replace RC32364 with the name of your own processor-type.
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: VPATHAfter a change of include dirs only the compiler options have to be updated. The update of VPATH is automated by the rule above.
Value:$(filter-out -I.,$(filter -I%,$(CFLAGS)))
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_PARTIALIMAGEThen modify the linker command line for LD_PARTIAL in target $(PROJECT_OUT) in the file rules.vxApp:
Value: -Wl,-Map,$(basename $(notdir $(PRJ_FILE))).link
$(LD_PARTIAL) $(LD_PARTIAL_FLAGS_FOR_PARTIALIMAGE) \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.
$(PRJ_OBJS_FOR_LD_PARTIAL) $(PRJ_LIBS) -o partialImage.o
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, bpringlemeir@yahoo.com)
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:
DOC_FILES = sysLib.c sysTffs.c tycoDrv.c myFile.c
docs: @echo Processing @for %f in (sysLib sysTffs tyCoDrv) do @if exist %f.c @echo %f.c & \ $(CPP) $(CASFLAGS) -C $(DOCFLAGS) %f.c > %f.i & \to:
docs: @echo Processing @for %f in ($(basename $(DOC_FILES))) do @if exist %f.c @echo %f.c & \ $(CPP) $(CASFLAGS) -C $(DOCFLAGS) %f.c > %f.i & \
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>.wpjThis 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>.wpjBe 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:
#include <xxx.h> to #include
"xxx.h" #include <xxx.h> to #include
"xxx.h" may be a good idea.
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)
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.
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)
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.See also the remark here.
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.
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.
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)
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 lfappears. 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.
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)
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:
#ifdef _MSC_VER
__int64 base;
__int64 mask;
#else
long long int base;
long long int mask;
#endif
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
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.
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.
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)
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. 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.
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)
| 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. | |
| 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? | |
| 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? | |
| 1.5 | A | When I try to install the GNU source CD I get an error meesage 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. | |
| 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? | |
| 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. | |
| 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 |