国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
Tornado2.2-vxworks5.5仿真測試和調(diào)試指南

 

集成的Vxworks目標仿真器—VxSim,它提供了與真實目標機一致的調(diào)試和仿真運行環(huán)境,允許開發(fā)者可以在沒有BSP、操作系統(tǒng)配置以及目標機硬件設(shè)備的情況下進行開發(fā)和調(diào)試。

VxSim對軟件開發(fā)者的意義,主要是在嵌入式系統(tǒng)開發(fā)中軟件的開發(fā)通常受到硬件開發(fā)進度的制約,由于軟件開發(fā)必須滯后于硬件的開發(fā),影響了產(chǎn)品的研發(fā)進度,VxSim在一定程度上解決了這個問題:使得用戶可以在工程開發(fā)初期,在硬件環(huán)境不具備的情況下,可以利用Tornado進行與硬件無關(guān)模塊的設(shè)計。

下面以簡單的PC機仿真為目標機,進行簡單的開發(fā)和調(diào)試過程,主要以圖代替文本描述,對于初步的入門者也許提供一些幫助。

1、創(chuàng)建一個工程

2、創(chuàng)建一個Bootable VxWorks Image

 

3、選擇一個BSP包

4、生成工程

5、生成的工程目錄

6、編寫一個main.c程序

  1. #include <stdio.h>   
  2.   
  3.    
  4.   
  5. int WinMain(void)  
  6.   
  7. {  
  8.   
  9. int nCount = 1234;  
  10.   
  11. printf("hello world!\n");  
  12.   
  13. printf("This is a demo program!\n");  
  14.   
  15. }  


7、添加main.c程序(點擊工程右鍵即可)

8、添加main.c后的工程

9、在usrAppInit.c做如下修改

  1. /* usrAppInit.c - stub application initialization routine */  
  2.   
  3. /* Copyright 1984-1998 Wind River Systems, Inc. */  
  4.   
  5. /* 
  6. modification history 
  7. -------------------- 
  8. 01a,02jun98,ms   written 
  9. */  
  10.   
  11. /* 
  12. DESCRIPTION 
  13. Initialize user application code. 
  14. */   
  15.   
  16. /****************************************************************************** 
  17. * 
  18. * usrAppInit - initialize the users application 
  19. */   
  20.   
  21. void usrAppInit (void)  
  22.     {  
  23. #ifdef  USER_APPL_INIT   
  24.     USER_APPL_INIT;     /* for backwards compatibility */  
  25. #endif   
  26.     WinMain();  
  27.     /* add application specific code here */  
  28.     }  

10、依賴性設(shè)置(點擊工程右鍵即可)

11、編譯全部(點擊工程右鍵即可)

vxrm *.o *.rpo ctdt.c symTbl.c vxWorks* *.out *.pl

vxrm ..\prjComps.h ..\prjParams.h ..\prjConfig.c ..\linkSyms.c

vxrm ..\libs.nm ..\libs.size

wtxtcl C:\Tornado2.2\host\src\hutils\configGen.tcl ..\demo.wpj

ccsimpc -c -g -mpentium -ansi -fno-builtin -fno-defer-pop -I.. -IC:\Tornado2.2\target\conf

ig\simpc -IC:\Tornado2.2\target\h -IC:\Tornado2.2\target\config\comps\src -IC:\Tornado2.2\

target\src\drv -DCPU=SIMNT -DTOOL_FAMILY=gnu -DTOOL=gnu -DPRJ_BUILD   C:\Tornado2.2\target

\config\simpc\sysLib.c -o sysLib.o

ccsimpc -g -mpentium -ansi -fno-builtin -fno-defer-pop -I.. -IC:\Tornado2.2\target\config\

simpc -IC:\Tornado2.2\target\h -IC:\Tornado2.2\target\config\comps\src -IC:\Tornado2.2\tar

get\src\drv -DCPU=SIMNT -DTOOL_FAMILY=gnu -DTOOL=gnu -DPRJ_BUILD  -c ..\usrAppInit.c

ccsimpc -c -g -mpentium -ansi -fno-builtin -fno-defer-pop -I.. -IC:\Tornado2.2\target\conf

ig\simpc -IC:\Tornado2.2\target\h -IC:\Tornado2.2\target\config\comps\src -IC:\Tornado2.2\

target\src\drv -DCPU=SIMNT -DTOOL_FAMILY=gnu -DTOOL=gnu -DPRJ_BUILD   ..\prjConfig.c -o pr

jConfig.o

ccsimpc -c -g -mpentium -ansi -fno-builtin -fno-defer-pop -I.. -IC:\Tornado2.2\target\conf

ig\simpc -IC:\Tornado2.2\target\h -IC:\Tornado2.2\target\config\comps\src -IC:\Tornado2.2\

target\src\drv -DCPU=SIMNT -DTOOL_FAMILY=gnu -DTOOL=gnu -DPRJ_BUILD   ..\linkSyms.c -o lin

kSyms.o

ccsimpc -g -mpentium -ansi -fno-builtin -fno-defer-pop -I.. -IC:\Tornado2.2\target\config\

simpc -IC:\Tornado2.2\target\h -IC:\Tornado2.2\target\config\comps\src -IC:\Tornado2.2\tar

get\src\drv -DCPU=SIMNT -DTOOL_FAMILY=gnu -DTOOL=gnu -DPRJ_BUILD  -c ..\main.c

vxrm ..\prjObjs.lst

Generating ..\prjObjs.lst...

ccsimpc -g -mpentium -ansi -fno-builtin -fno-defer-pop -I.. -IC:\Tornado2.2\target\config\

simpc -IC:\Tornado2.2\target\h -IC:\Tornado2.2\target\config\comps\src -IC:\Tornado2.2\tar

get\src\drv -DCPU=SIMNT -DTOOL_FAMILY=gnu -DTOOL=gnu -DPRJ_BUILD  -c C:\Tornado2.2\target\

config\comps\src\version.c

ccsimpc -r -nostdlib -Wl,@..\prjObjs.lst  \

       version.o -Wl,--start-group  \

       -LC:\Tornado2.2\target\lib\simpc\SIMNT\gnu -LC:\Tornado2.2\target\lib\simpc\SIMNT\common 

C:\Tornado2.2\target\config\simpc\simpcDrv.a    -lcplus  -lgnucplus  -lvxcom  -lvxdcom  -l

arch  -lcommoncc  -ldrv  -lgcc  -lnet  -los  -lrpc  -lwdb  -lwind  -lwindview C:\Tornado2.

2\target\lib\libSIMNTgnuvx.a -Wl,--end-group  -o partialImage.o

nmsimpc -g partialImage.o @..\prjObjs.lst | wtxtcl C:\Tornado2.2\host\src\hutils\munch.tcl

 -c simpc > ctdt.c

ccsimpc -c -fdollars-in-identifiers -g -mpentium -ansi -fno-builtin -fno-defer-pop -I.. -I

C:\Tornado2.2\target\config\simpc -IC:\Tornado2.2\target\h -IC:\Tornado2.2\target\config\c

omps\src -IC:\Tornado2.2\target\src\drv -DCPU=SIMNT -DTOOL_FAMILY=gnu -DTOOL=gnu -DPRJ_BUI

LD  ctdt.c -o ctdt.o

ccsimpc -g -mpentium -ansi -fno-builtin -fno-defer-pop -I.. -IC:\Tornado2.2\target\config\

simpc -IC:\Tornado2.2\target\h -IC:\Tornado2.2\target\config\comps\src -IC:\Tornado2.2\tar

get\src\drv -DCPU=SIMNT -DTOOL_FAMILY=gnu -DTOOL=gnu -DPRJ_BUILD  -c C:\Tornado2.2\target\

config\comps\src\dataSegPad.c

ldsimpc --subsystem=windows -e _WinMainCRTStartup C:\Tornado2.2\host\x86-win32\i386-pc-min

gw32\lib\crt1.o \

       dataSegPad.o partialImage.o ctdt.o \

       -T C:\Tornado2.2\target\h\tool\gnu\ldscripts\link.SIMNT -o vxWorks

wtxtcl C:\Tornado2.2\host\x86-win32\bin\simpcToExe.tcl vxWorks

echo -v   vxWorks

-v vxWorks

 

Done.

 

12、打開VxSim Lauch

13、下載對象文件main.o,這樣我們可以調(diào)試main.c所有函數(shù)了

14、在main.c設(shè)置斷點第6行

15、運行程序(run),Task以WinMain函數(shù)作為起點開始

16、運行程序后,程序指針指向WinMain函數(shù)開始處

17、讓程序指針運行如圖處,我們看看watch窗口和VxSim界面上的內(nèi)容

a.變量窗口

b.Vxsim內(nèi)容

18、Shell程序使用

A、Shell幫助

-> help

help                        Print this list

h         [n]               Print (or set) shell history

i         [task]            Summary of tasks' TCBs

ti        task              Complete info on TCB for task

sp        adr,args...       Spawn a task, pri=100, opt=0, stk=20000

sps       adr,args...       Spawn a task, pri=100, opt=0, stk=20000

                            and leave it suspended

td        task              Delete a task

ts        task              Suspend a task

tr        task              Resume a task

tw        task              Print info about the object a task is pending on

w                           Summary of tasks' pending information

d         [adr[,nunits[,width]]] Display memory

m         adr[,width]       Modify memory

mRegs     [reg[,task]]      Modify a task's registers interactively

version                     Print VxWorks version info, and boot line

 

Type <CR> to continue, Q<CR> to stop:

 

b                               Display breakpoints

b         addr[,task[,count]]   Set breakpoint

bd        addr[,task]           Delete breakpoint

bdall     [task]                Delete all breakpoints

c         [task[,addr[,addr1]]] Continue from breakpoint

s         [task[,addr[,addr1]]] Single step

l         [adr[,nInst]]         List disassembled memory

tt        [task]                Do stack trace on task

bh        addr[,access[,task[,count]]] Set hardware breakpoint

             access:     0 - instruction        1 - write 1 byte

                    3 - read/write 1 byte      5 - write 2 bytes

                    7 - read/write 2 bytes     d - write 4 bytes

                    f - read/write 4 bytes

sysSuspend                      Suspend the system

sysResume                       Resume the system

 

Type <CR> to continue, Q<CR> to stop:

 

devs                        List devices

cd        "path"            Set current working path

pwd                         Print working path

ls        ["path"[,long]]   List contents of directory

ld        [syms[,noAbort][,"name"]] Load stdin, or file, into memory

                                    (syms = add symbols to table:

                                    -1 = none, 0 = globals, 1 = all)

lkup      ["substr"]        List symbols in system symbol table

lkAddr    address           List symbol table entries near address

printErrno  value           Print the name of a status value

period    secs,adr,args...  Spawn task to call function periodically

repeat    n,adr,args...     Spawn task to call function n times (0=forever)

 

NOTE:  Arguments specifying 'task' can be either task ID or name.

value = 0 = 0x0

->

B、查看目錄

-> ls

 驅(qū)動器 C 中的卷沒有標簽。

 卷的序列號是 782B-C07C

 

 C:\vxworks_demo 的目錄

 

[.]            [..]           [default]      demo.wpj       demo.wsp

linkSyms.c     main.c         Makefile       prjComps.h     prjConfig.c

prjObjs.lst    prjParams.h    usrAppInit.c  

              10 個文件         52,850 字節(jié)

               3 個目錄 34,592,718,848 可用字節(jié)

value = 0 = 0x0

->

 

C、執(zhí)行函數(shù)WinMain

-> WinMain

hello world!

This is a demo program!

value = 24 = 0x18 = __major_os_version__ + 0x14

->

本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊舉報
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
VxWorks使用說明書
vxworks測試題及解答
VxWorks BSP和啟動過程
嵌入式實時操作系統(tǒng)VxWorks入門
vxworks FAQ(中文)
Bootable ROM
更多類似文章 >>
生活服務(wù)
分享 收藏 導長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服