⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vxworks中文faq.txt

📁 vxworks中文FAQ
💻 TXT
📖 第 1 页 / 共 5 页
字号:
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:

gnuInfoGen.tcl (1 time) 
prjLib.tcl (4 times) 
prj_vxApp.tcl (1 time) 
prj_vxWorks.tcl (4 times) 
(From: Stas Maximov, stmax@pigeonpoint.com)



2.12.2 是否应该把Tornado整个目录都使用版本控制?
A:我认为把target目录作为一个整体是个好注意,
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)

2.13 Visual Studio集成

2.13.1 能把Visual Studio做为编辑器集成到T2中吗?(Tools --> options --> External Editor),怎样
管理它?
A: 我们使用Visual studio IDE来编译vxworks程序,特别在Tornado中丢失的浏览信息。
在msdev工程设置里把nmake改成make,设定当前浏览文件名和输出文件名(..\bin\sys.bsc resp. 
..\bin\sys.out),并在rebuild所有项里添加rebuild。把所需的目录和文件添加到你的msdev的工作区。
在tools->options菜单里添加你的include目录和tornado执行目录,并把它们放到列表首位。

警告:
我不得不用3.02版本的sed.exe替换Tornado中的2.05版本。msdev's的编译器(6.0)不认识某些头文件里的
"long long int"类型,我在regsI86.h做了一些改变。
#ifdef _MSC_VER
    __int64 base;
    __int64 mask;
#else
    long long int base;
    long long int mask;
#endif

并按你的需求调整Makefile(http://www.xs4all.nl/~borkhuis/vxworks/Makefile),例如用cpp代替c.
Gerald van Kampen (kam@oce.nl):

2.13.2 Visual Studio不把filetype .cc类型的文件认做C文件,怎样能告诉Visual Studio这种文件也是C
文件?以便"source browser"和"class view"能识别它。
A:缺省,CPP和C文件自动被MS编译器识别,如果让编译器识别别的类型的文件,使用/Tp或/tp选项声明该
类型文件也是CPP文件。我认为/Tc选项声明该类型文件是C文件。
(From: Don Wade, donwade@nortelnetworks.com)

2.13.3 当使用Visual Studio作为开发环境时,Visual Studio不能识别GNU编译器的输出?
A:使用如下程序过滤GNU编译器的输出,文件为gnu2msdev.cpp
(http://www.xs4all.nl/~borkhuis/vxworks/gnu2msdev.cpp)编译该文件的规则如下,可执行文件为
gnu2msdev.exe(http://www.xs4all.nl/~borkhuis/vxworks/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)

2.14 Windsh

2.14.1 怎样给winshe创建一个启动文件?
A:在%HOME%/.wind目录下创建一个windsh.tcl文件,如果变量%HOME%不存在,在你的启动文件里创建它。
一个可能就是使用Tornado目录下的.wind目录或你工程目录下的一个目录。为了避免把工程的特别项放到
Tornado目录树里,在windsh.tcl文件里,你应该在开始执行如下命令。
例如:cd "whatever directory"
请确定目录使用的是"/"而不是"\"。
(From: Mike Beede, mbeede@ciprico.com)

2.14.2 当我在windsh调用一个有浮点参数的函数时出现参数引用错误?
A:shell缺省每个变量都是整型,你可以声明你的参数为浮点型,就好了。如:
foo((float) 20.01)
(From: ywu@imatron.com)

2.14.3 怎样改变命令提示符?
A:执行如下命令:
shellPromptSet "VxWorks command prompt .... "

2.14.4 怎样从主机SHELL下得到目标机上的目录显示?
A:在命令前加"@",它将在目标机端执行,而不是在主机端。所以命令'@ls'显示当前目标机的目录。等等。
甚至还可以使用主机SHELL下没有的命令。

2.14.5 当我试图执行一个函数时出现"undefined symbol"错误,执行过程如下:
-> 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:一个可能是你的ace_main是一个munged C++符号,如果它在CPP文件里编译的,改成C类型的(extern "C")
尝试按如下例子来解决问题:
extern "C" int ace_main(unsigned int)
{
    ... code here...
}
再重新编译、连接。
(From: ddewar@my-deja.com) 
另一个解决办法是,执行sp ace_main,并在你按下回车键前,按下Ctrl+D把签名加到mangled C++名字末尾。
(From: Dave Korn)

2.15 WindView
2.15.1 当我使用WindView查看时间时,有时它好象定时器中断一样花了很多时间,是什么引起的?
A:WindView这个错误已经被WindRiver公司修正了。
(From: Anthony D. Truong, AnthonyDTruong@email.msn.com)

2.15.2 怎样创建WindView用户事件?
A:WindView 2.0.1的用户手册关于用户事件的说明是错误的,经过实践,下面的方法可以工作的很好。
首先,函数/过程必须象如下格式出现在eventbase.tcl文件里
proc userFormat00060 eventData {
}
你的例子显示你的用户事件是包含两个整数的结构。一种把它们格式化的方法如下:
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]
}

另一种如下:
proc userFormat00060 eventData {
    set data [userEventFormat $eventData {n4 n4}]
    set data1 [lindex $data 0]
    set data2 [lindex $data 1]
    return "int1 = $data1, int2 = $data"
}

如果你的主机和目标机字节序不同,你应该转换数据。你可以仔细查看TORNADO目录下的TCL文件,以便得到
更多信息。
(From: Lori Fraleigh, lori@rti.com)

2.15.2 怎样把raw hex格式的数据改成缺省数据格式?
A:如下信息可能有帮助,http://www.xs4all.nl/~borkhuis/vxworks/windview.html
(From: DrDiags, drdiags@covad.net)

2.15.3 任务在WindView中被列出几次?
A:如果你使用过去的mortem模式,这个问题是已知的。缓存在被填满前被upload,并开始循环。WRS告诉我们
的解决办法是右击每个第二个显示,并隐藏它。
(From: Tim Shaw, Tim.Shaw@dsto.defence.gov.au)




3.BSP FAQ
3.1 不同BSP
3.2 处理器
3.2.1 Power PC
3.2.1.1 问题关于MPC860BSP(新手上路):在读前辈程序的时候遇到这样一些语句: 
lis r3, 0x0090 
ori r3, r3, 0x0000 #plp=9, 50M clk 
stw r3, PLPRCR(r4) #PLPRCR 
不知道LIS、ORI、STW是什么语言?望指教!谢谢 
A:是PowerPC汇编, 
lis r3, 0x0090 ;放数据0x0090到r3 
Rejoicer:应该将立即数附给r3,然后左移位,注意,低位就为0 
ori r3, r3, 0x0000 #plp=9, 50M clk ;后两数之间取"或"放入前面r3 
Rejoicer:r3低位或0x00(立即数) 
stw r3, PLPRCR(r4) #PLPRCR ;PLPRCR(r4)按位右移#PLPRCR,放入r3 
Rejoicer: 将r3的内容写到 地址 r4 + PLPRCR 指向的寄存器(PLPRCR寄存器)中,(估计r4放的IMMR值)

3.2.1.2 如果要在mpc860上加一个硬盘,用什么方法呢? 谢谢! 
A:你加一个网络文件系统,然后通过网络文件系统可以访问你机器的硬盘

3.2.1.3 mpc860在下载中遇到的问题,我用veisionice仿真器下载程序的时候,发现程序老是下不下去。
在检查中,我发现CLKOUT只有1。25M。我用的是外围5M晶体振荡器,MODCK [1-2] 设置为10。[MF+1]为8。
我的主频是40M。应当说在没有程序运行的情况下,CLKOUT应该为5M。这是怎么回事?请大家指教。 
A:clkout的输出(输入CLK的分频系数)也是通过860的一个寄存器配置来得到的,你可以查一下860的相关
的寄存器看一下。

3.2.1.4 860中的程序调用,在860的BSP文件 romInit.s中,在程序末尾有条指令是跳转到 romStart(),
在这之前有个计算 romstart() 入口地址的公式. 
romstart入口地址= romstart - romInit + ROM_TEXT_ADRS 
我对这个公式的理解不是很明白,谁能解释一下,在汇编里调用某个C函数,那该怎么来实现或\ 
计算跳转地址.单独在一个汇编程序里,我可以理解,但一个汇编调用一个C程序我糊涂了 
who can help me ? thanks 
A:可以这样理解ROM_TEXT_ADRS=romInit,这样则romstart=romstart,上述些方式为了防止ROM_TEXT_ADRS
不等于romInit情况下,还能得到正确的romstart地址. 这里不涉及C程序还是汇编程序.只是传了一个
地址.romstart已在前面声明为一个外部函数. 原标号只是相对地址,不信你自己跟一下,或查看一下生成
的bootrom.bin文件,分析一下机器码你所提到的三个地址:romInit,romStart,ROM_TEXT_ADRS,其实只有
第三个是绝对地址,前两个都只是标号,也即相对地址.在romIinit.s中由于取指令还得从NVRAM中取,
所以必须用绝对地址,那么romStart的绝对地址在哪里呢?只有算一算了,我们只知道romInit肯定是在
ROM_TEXT_ADRS所标识的地址,而且肯定是bootRom目标程序中的最低地址,所以romStart的绝对地址是
(romStart - romInit) + ROM_TEXT_ADRS

3.2.1.5 vxworks下,是否有api可以获取网卡mac地址呢?
A1:如果是MPC860,可以试一下这个函数 
char macBuffer[8]; // MAC地址 
sysCpmEnetAddrGet(0, macBuffer); 
或直接读网卡MAC地址的寄存器. 
A2:为什么一定要用api呢, 
不管是860 scc 口,还是8260 Fcc口,都可以读参数区的PADDR1_H,-M -L得到嘛, 
如果你是做BSP的,一般都会从利用这个变量unsigned char sysFccEnetAddr [6] 
syslib.c 
A3:vxworks操作系统是通过BSP来了解自己的网口地址的,具体说是通过系统函数sysCpmEnetAddrGet(),
这个函数属于BSP的范畴,它的函数实现是可以修改的。


3.2.2 I960 
在GNU中是否有编译选项或其它编译方法,针对i960实现字节对齐的工程?我使用如下编译开关
-mno-code-align, -mno-strict-align, 但是没用?
A: 我有类似的问题,我花了很多时间来解决问题,这个文档可能对你有帮助。
http://www.xs4all.nl/~borkhuis/vxworks/i960struct.html
(From: Fred Roeber, froeber@bbn.com)

3.2.3 MIPS
当我编译时,我碰到碰到许多 "... uses different e_flags ..." 消息,这些消息是什么意思?
A: 来自Windriver的解释
(From: Xjasartist@yahoo.com)
The message "uses different e_flags ... fields than previous modules ..." can occur for MIPS 
and PowerPC architectures. It should not cause any problems for MIPS processors most of the time. If you look in the release notes for your MIPS BSP, you may find a comment something 
like:

There are several types of warnings generated by compiler. These are harmless. 
During compilation of vxWorks image: 
uses different e_flags (0x0) fields than previous modules (0x10000001)

For the case of MIPS, what's happening is that each ELF object module keeps track of which OMF 
affecting flags were used or specified anywhere in the original source file. Inside the linker, 
there is a function which copies the appropriate flags from the original object module to the 
one which is being created. For MIPS, the function is mips_elf_merge_private_bfd_data(). If two 
different files have different sets of flags, this might be a sign of a problem, so when the 
compiler finds this condition it prints the warning message above.

Usually when this error message comes up with MIPS, it is from one of two different flags.


First is 0x1, which specifies that somewhere in the code a .noreorder directive was given. For 
MIPS, the name of this flag is EF_MIPS_NOREORDER. There should not be any problems related to 
this flag differing between the original object modules and the final module.


Second is 0x10000000, which is E_MIPS_ARCH_2. What this means is that some modules were compiled
 to use the ARCH 2 functionality. When you are using an ARCH 2 or ARCH 3 processor, this should 
 also not be a problem.

The MIPS specific flags are:

/* Processor specific flags for the ELF header e_flags field.  */

/* At least one .no

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -