当前位置:首页 > VxWorks6创建RTP例程 - 图文
. VxWorks6.6动态创建RTP例程
VxWorks6.6中的RTP程序与WINDOWS的exe程序类似,我们可以使用操作系统的进程创建函数API,在程序中动态创建和调用。下面主要通过Download Kernel moudle来测试该API使用,整个调试过程与Tornado2.2基本相似,具体操作流程如下面描述。 1、创建Downloadable Kernel module工程
2、新建main.cpp文件
3、main.cpp代码如下 [cpp] view plaincopyprint?
1. #include
3. #include
7. int main (void) 8. {
9. int nRtp;
10. // 注意这里的文件路径使用虚拟路径,否则将出现nRtp=-1不成功的状态! 11. const char *argv[] = {\12. const char *envp[] = {\
=0x100000\
13. nRtp = (int)rtpSpawn(argv[0], argv, envp, 100, 0x10000, 0, 0); 14. if (nRtp == -1) 15. {
16. printErrno(errnoGet());
17. printf (\18. } 19. else 20. {
21. printf (\22. } 23. return 0; 24. }
4、编译工程
Build Started in Project 'testvxe': 2011-09-23 17:05:40 Generation of makefiles started.
Generation of makefiles finished (Elapsed Time: 00:00). Platform: Wind River VxWorks 6.6
Command: make --no-print-directory BUILD_SPEC=SIMNTdiab DEBUG_MODE=1 TRACE=1
Working Directory: C:/openSUSE3000/fep/code/test_sys/testvxe/SIMNTdiab if [ ! -d \\testvxe_partialImage/Debug/Objects/testvxe/main.o\-W:c:,-Xclib-optim-off -Xansi
-Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd -IC:/WindRiver3.6/vxworks-6.6/target/h
-IC:/WindRiver3.6/vxworks-6.6/target/h/wrn/coreip -DCPU=SIMNT -DTOOL_FAMILY=diab -DTOOL=diab -D_WRS_KERNEL -o \\building testvxe_partialImage/Debug/Objects/testvxe/main.o
if [ ! -d \\testvxe_partialImage/Debug/testvxe_partialImage.o\0x90,1,1 -o \
testvxe_partialImage/Debug/Objects/testvxe/main.o && if [ \\
building testvxe_partialImage/Debug/testvxe_partialImage.o if [ ! -d \\\
testvxe_partialImage/Debug/testvxe_partialImage.o | tclsh
C:/WindRiver3.6/vxworks-6.6/host/resource/hutils/tcl/munch.tcl -c pentium > testvxe/Debug/ctdt.c; dcc -g -tX86LH:vxworks66 -Xdollar-in-ident -Xforce-declarations -IC:/WindRiver3.6/vxworks-6.6/target/h -IC:/WindRiver3.6/vxworks-6.6/target/h/wrn/coreip -DCPU=SIMNT
-DTOOL_FAMILY=diab -DTOOL=diab -D_WRS_KERNEL -o testvxe/Debug/ctdt.o -c testvxe/Debug/ctdt.c; dld -tX86LH:vxworks66 -X -r5 -f 0x90,1,1 -r4 -o \
testvxe_partialImage/Debug/testvxe_partialImage.o && if [ \\building testvxe/Debug/testvxe.out
make: built targets of C:/openSUSE3000/fep/code/test_sys/testvxe/SIMNTdiab Build Finished in Project 'testvxe': 2011-09-23 17:05:44 (Elapsed Time: 00:04) 5、启动仿真器
共分享92篇相关文档