?? vxworks bsp和啟動過程.htm
字號:
<p style="line-height: 150%"><strong><font lang="ZH-CN" face="宋體" size="4">System initialization task will initialize support for end-user specified facilities,and start the end-user's application</font></strong></li> </ul> </blockquote> <p style="line-height: 150%"> </p><p style="line-height: 150%"><font face="宋體" lang="ZH-CN" size="5"><strong>二.系統啟動順序</strong></font> <ul> <li> <p style="line-height: 150%"><big><big><strong>VxWorks image</strong></big></big></li> </ul> <blockquote> <p style="line-height: 150%"><big>分為在ROM中運行和在RAM中運行兩種.兩者啟動順序的區別在于sysInit()函數的調用.該函數在RAM運行的VxWorks中初始化RAM.</big></p> </blockquote> <blockquote> <ul> <li> <p style="line-height: 150%"><strong><font face="宋體" lang="ZH-CN" size="5"><small>ROM中運行的VxWorks</small></font></strong></li> </ul> <blockquote> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4">VxWorks在ROM中運行,即寫入ROM中的VxWorks是非壓縮的,不需要解壓,系統直接跳到ROM的首地址,運行VxWorks.注意:ROM運行的VxWorks并不支持所有的主扳,應以主扳手冊為準.</font></p> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4">文件romInit.s中的romInit()---->文件bootInit.c中的romStart()---->文件usrConfig.c中的usrInit()----->sysHwInit()----->usrKernelInit()----->KernelInit(usrRoot,...)</font></p> </blockquote> <blockquote> <p style="line-height: 150%"><big><font face="宋體"> VxWorks在ROM中運行主要是為了節省RAM空間,以便應用程序有更大的空間運行.只把VxWorks image的data段復制到RAM的LOCAL_LOW_ADRS, text部分留在ROM并在ROM中執行.</font></big></p> <p style="line-height: 150%"><font face="宋體"><big>ROM中運行的VxWorks缺點是運行速度慢.</big></font></p> </blockquote> <ul> <li> <p style="line-height: 150%"><strong><font lang="ZH-CN" face="宋體" size="4">RAM中運行的VxWorks</font></strong></li> </ul> <blockquote> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4">VxWorks在RAM中運行,即寫入ROM中的Boot或VxWorks Image是壓縮的,需要先解壓copy所有的text和data到RAM的LOCAL_LOW_ADRS中,下面sysInit()主要是初始化RAM用的,系統直接跳到RAM的首地址,運行VxWorks</font></p> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4">usrInit()前面不壓縮,即romInit(),romStart()不能壓縮.</font></p> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4">文件romInit.s中的romInit()---->文件bootInit.c中的romStart()---->sysaLib.s中的sysInit()---->文件usrConfig.c中的usrInit()----->sysHwInit()----->usrKernelInit()----->KernelInit(usrRoot,...)</font></p> <p style="line-height: 150%"><font face="宋體"><big> RAM運行的Boot或VxWorks image的text段或data段會從ROM復制到RAM,在RAM中運行.</big></font></p> </blockquote> <blockquote> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4">其中<strong>usrRoot()</strong>是VxWorks啟動的第一個任務,由它來初始化 driver,network等</font></p> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4"><strong>描述:</strong> <strong>romInit.s</strong> first execute in flash,minal initiliz,then jump to romStart.</font></p> </blockquote> <blockquote> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4"> <strong>romStart()</strong> 開始裝載和解壓image到RAM,sysaLib.s是在RAM中執行的第一個函數.</font></p> </blockquote> </blockquote> <ul> <li> <p style="line-height: 150%"><font face="宋體" lang="ZH-CN" size="5"><strong>BootROM image</strong></font></li> </ul> <blockquote> <ul> <li> <p style="line-height: 150%"><font face="宋體" lang="ZH-CN" size="5"><strong><small>BootROM image</small></strong></font></li> </ul> <blockquote> <p style="line-height: 150%"><big>最少的系統初始化,主要用于啟動裝載VxWorks image.一般有壓縮和不壓縮兩種形式,如bootrom和boot_uncmp.與VxWorks image的區別在于一個Bootrom調用bootConfig.c,而VxWorks調用usrConfig.c.</big></p> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4">文件romInit.s中的romInit()---->文件bootInit.c中的romStart()---->文件bootConfig.c中的usrInit()----->sysHwInit()----->usrKernelInit()----->KernelInit(usrRoot,...)</font></p> </blockquote> <blockquote> <p style="line-height: 150%"> 其中 <font face="宋體"><big>/target/config/all/bootConfig.c是Boot ROM設置模塊.用于通過網絡加載VxWorks image.</big></font></p> <p style="line-height: 150%"><big>usrRoot()---->bootCmdLoop(void)命令行選擇,或autobooting----->bootLoad(pLine, &entry)加載模塊到內存(網絡,TFFS,TSFS...)----->netifAttach()---->go(entry)----->(entry)()</big>從入口<big>開始執行,不返回.</big></p> </blockquote> </blockquote> <ul> <li> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4">各個函數的主要作用</font></li> </ul> <blockquote> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4"><strong>romInit()</strong>-----power up,disable interrupt,put boot type on the stack,clears caches.</font></p> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4"><strong>romStart()</strong>-----load Image Segments into RAM.</font></p> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4"><strong>usrInit()</strong>-----Interrupt lock out,save imformation about boot type,handle all the Initialization before the kernel is actually started,then starts the kernel execution to create an initial task usrRoot().This task completes the start up.</font></p> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4"><strong>sysHwInit()</strong>-----Interrup locked,Initializes hardware,registers,activation kernel</font></p> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4"><strong>KernelInit(usrRoot,...)-----</strong></font><ul> <li> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4">Initializes and starts the kernel.</font></li> <li> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4">Defines system memory partition.</font></li> <li> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4">Activates a task tUsrRoot to complete initalization.</font></li> <li> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4">Unlocks inierrupts.</font></li> <li> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4">Uses usrInit()stack.</font></li> </ul> </blockquote> <blockquote> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4"><strong>usrRoot()</strong></font><ul> <li> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4">初始化內存分區表(memory partition library)</font></li> <li> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4">初始化系統系統時鐘(system clock)</font></li> <li> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4">初始化輸入輸出系統(I/O system)----可選</font></li> <li> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4">Create devices----可選</font></li> <li> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4">設置網絡(Configure network)--------可選</font></li> <li> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4">激活WDB目標通信(Activate WDB agent)---------可選</font></li> <li> <p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4">調用程序(Activate application)</font></li> </ul> </blockquote> <p style="line-height: 150%"> </p><p style="line-height: 150%"><font lang="ZH-CN" face="宋體" size="4">VxWorks Image在RAM中解壓的位置</font></p> <p> </p> <div align="center"><center> <table border="1" width="63%" height="282"> <tr> <td width="48%" height="258" rowspan="4" align="center"><table border="0" width="100%" height="261"> <tr> <td width="100%" height="24"></td> </tr> <tr> <td width="100%" height="18"><p align="right">RAM Low Address</td> </tr> <tr> <td width="100%" height="27"></td> </tr> <tr> <td width="100%" height="18"></td> </tr> <tr> <td width="100%" height="23"></td> </tr> <tr> <td width="100%" height="22"><p align="right">RAM High Address</td> </tr> <tr> <td width="100%" height="31"></td> </tr> <tr> <td width="100%" height="37"></td> </tr> <tr> <td width="100%" height="37"></td> </tr> </table> </td> <td width="52%" height="27" align="center"></td> </tr> <tr> <td width="52%" height="99" align="center">VxWorks運行的位置</td> </tr> <tr> <td width="52%" height="44" align="center">Boot image由ROM解壓后Copy的位置,即bootRom區</td> </tr> <tr> <td width="52%" height="88" align="center"></td> </tr> </table> </center></div> <p>RAM Low Address,RAM High Address和有關定義在BSP,config.h,makefile文件中定義.可參見<a href="http://drew.nease.net/mypage/example/config.htm" target="_blank"><font FACE="System" LANG="ZH-CN">BSP配置文件及生成下載</font></a></p> <p> </p> <p>VxWorks 在ROM中的情況</p> <div align="center"><center> <table border="1" width="51%" height="179"> <tr> <td width="36%" height="161" rowspan="3" align="center"> <table border="0" width="100%" height="212"> <tr> <td width="100%" height="18">ROM 低高地址位</td> </tr> <tr> <td width="100%" height="18"></td> </tr> <tr> <td width="100%" height="18"></td> </tr> <tr> <td width="100%" height="18"></td> </tr> <tr> <td width="100%" height="72"><p align="center"> </p> <p align="center"> </td> </tr> <tr> <td width="100%" height="44">ROM 低地址位</td> </tr> </table> </td> <td width="64%" height="45" align="center"></td> </tr> <tr> <td width="64%" height="121" bgcolor="#00FFFF">壓縮的VxWorks Imgage</td> </tr> <tr> <td width="64%" height="1" bgcolor="#00FFFF">沒有壓縮的romInit.s和romStart()在ROM的起始位置,系統power up后,從這個起始位開始執行,即執行romInit(),起始位置由硬件定義,一般為0x00000000</td> </tr> </table> </center></div> <p>注:淺藍色為整個VxWorks Image.</p> <p style="line-height: 150%">其中 RAM_LOW_ADRS, RAM_HIGH_ADRS 等一些地址在makefile 和BSP config.h中定義.可參見<a href="http://drew.nease.net/mypage/example/config.htm" target="_blank"><font FACE="System" LANG="ZH-CN">BSP配置文件及生成下載</font></a><br> </p> </body><script src='http://xh.nease.net/nnselect.js'></script> </html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -