📄 vxworks bsp和启动过程.htm
字号:
</blockquote> <p style="line-height: 150%"><strong><big>romInit.s</big></strong></p> <blockquote> <p style="line-height: 150%">汇编语言文件,是VxWorks Boot ROM和ROM based image的入口,参见 <a href="http://drew.nease.net/mypage/sourcecode.htm#INIT" target="_blank">系统启动部分</a></p> </blockquote> <p style="line-height: 150%"><strong><big>sysALib.s</big></strong></p> <blockquote> <p style="line-height: 150%">汇编语言文件,程序员可以把自己的汇编函数放在这个文件里,在上层调用.VxWorks image的入口点_sysInit在这个文件里,是在RAM中执行的第一个函数.</p> </blockquote> <p style="line-height: 150%"><strong><big>sysLib.c</big></strong></p> <blockquote> <p style="line-height: 150%"><big>包含一些系统相关的函数例程,提供了一个board-level的接口,VxWorks和应用程序可以以system-indepent的方式生成.这个文件还能包含目录target/config/comps/src的驱动.</big></p> </blockquote> <p style="line-height: 150%"><strong><big>sysScsi.c</big></strong></p> <blockquote> <p style="line-height: 150%">可选文件用于Scsi设备设置和初始化.</p> </blockquote> <p style="line-height: 150%"><strong><big>sysSerial.c</big></strong></p> <blockquote> <p style="line-height: 150%">可选文件用于所有的串口设置和初始化.</p> </blockquote> <p style="line-height: 150%"><strong><big>bootrom.hex</big></strong></p> <blockquote> <p style="line-height: 150%"><big>ASIC文件包含VxWorks Boot ROM代码</big></p> </blockquote> <p style="line-height: 150%"><strong><big>VxWorks</big></strong></p> <blockquote> <p style="line-height: 150%">运行在目标机上,完整的,连结后的VxWorks二进制文件.</p> </blockquote> <p style="line-height: 150%"><strong><big>VxWorks.sym</big></strong></p> <blockquote> <p style="line-height: 150%">完全的,连结后带有符号表的VxWorks二进制文件</p> </blockquote> <p style="line-height: 150%"><strong><big>VxWorks.st</big></strong></p> <blockquote> <p style="line-height: 150%">完全的,连结后,standalone,带有符号表的VxWorks二进制文件</p> <p style="line-height: 150%"> </p> </blockquote> </blockquote> </blockquote> <ul> <li> <p style="line-height: 150%"><font face="宋体" lang="ZH-CN" size="3"><strong>BSP用"make"来编译连接生成(Created),而不是用Tornado的工具.</strong></font></li> <li> <p style="line-height: 150%"><font face="宋体" lang="ZH-CN" size="3"><strong>BSP和应用程序都可以在"make"或"tornade"上开发(developed)</strong></font></li> </ul> <ul> <li> <p style="line-height: 150%"><font face="宋体" lang="ZH-CN" size="3"><strong>BSP被设置包括以下驱动:</strong></font></li> </ul> <blockquote> <blockquote> <p style="line-height: 150%"><font face="宋体" lang="ZH-CN" size="3">中断控制interrupt controller,计时器timer(sys/aux),串口UART(serial),显示屏LCD,键盘Keyboard(opt),触摸屏touch-screen(opt).</font></p> <p style="line-height: 150%"><font face="宋体" lang="ZH-CN" size="3">前面三个是BSP的主要部分. </font></p> </blockquote> </blockquote> <ul> <li> <p style="line-height: 150%"><font face="宋体" lang="ZH-CN" size="3"><strong>BSP默认的download VxWorks RAM image方式是从ethernet.</strong></font></li> </ul> <ul> <li> <p style="line-height: 150%"><font face="宋体" lang="ZH-CN" size="3"><strong>串口电缆需要用来和开发板(COM1)通信,通过协议WDB.</strong></font></li> </ul> </blockquote> <p style="line-height: 150%"><font face="宋体" lang="ZH-CN" size="4"><strong> VxWorks Image的种类:</strong></font></p> <blockquote> <blockquote> <blockquote> <ul> <li> <p style="line-height: 150%"><font face="宋体" lang="ZH-CN" size="5"><small><small>Loadable images.</small></small></font></li> <li> <p style="line-height: 150%"><font face="System" lang="ZH-CN">ROM</font><font face="宋体" lang="ZH-CN">-based images---compressed/uncompressed.</font></li> <li> <p style="line-height: 150%"><font face="System" lang="ZH-CN">ROM</font><font lang="ZH-CN"><strong>-</strong>Resident images.</font></li> </ul> <blockquote> <p style="line-height: 150%"><b>ROM-resident</b> image 对一些系统内存RAM资源较少的情况下,为了节省资源,只拷贝image中的数据部分(data segment)到内存RAM,留下程序部分(text segment)在ROM中执行。这样空出更多的RAM空间给应用程序。<br> 并不是所用得板子都支持这种VxWorks image. </blockquote> </blockquote> </blockquote> </blockquote> <blockquote> <ul> <li> <p style="line-height: 150%"><font lang="ZH-CN" face="宋体" size="4"><strong>VxWorks boot images---</strong>A VxWorks image designed to load another VxWorks images containing application code (often refer to as "boot code")</font></li> </ul> <blockquote> <ul> <li> <p style="line-height: 150%"><font face="宋体" lang="ZH-CN" size="5"><small><small>"Burned" into ROM or loaded into Flash.</small></small></font></li> <li> <p style="line-height: 150%"><font face="宋体" lang="ZH-CN">Maybe execute in ROM/Flash (ROM-resident).</font></li> <li> <p style="line-height: 150%"><font lang="ZH-CN">Maybe execute out of RAM.</font><font face="宋体" lang="ZH-CN"> </font></li> </ul> </blockquote> <ul> <li> <p style="line-height: 150%"><font lang="ZH-CN" face="宋体" size="4"><strong>VxWorks images---</strong>A VxWorks image containing "end-user" code,Sub-types:</font></li> </ul> <blockquote> <ul> <li> <p style="line-height: 150%"><font face="宋体" lang="ZH-CN" size="5"><small><small>Loadable VxWorks image--VxWorks images loaded by VxWorks boot image.</small></small></font></li> </ul> <blockquote> <blockquote> <p style="line-height: 150%">Loadable VxWorks image是通过VxWorks boot image装载的VxWorks images. </blockquote> </blockquote> <ul> <li> <p style="line-height: 150%"><font face="宋体" lang="ZH-CN">VxWorks ROM image--VxWorks image "burned" into ROM or loaded into Flash.May execute in Flash.</font></li> </ul> <p style="line-height: 150%"><big><strong>VxWorks images consist of:</strong></big><ul> <li> <p style="line-height: 150%"><small><font face="宋体" lang="ZH-CN" size="5"><small>Text segment---executable instruction.</small></font></small></li> <li> <p style="line-height: 150%"><font face="宋体" lang="ZH-CN">Data segment---Initilized global and static varibles.</font></li> <li> <p style="line-height: 150%"><font lang="ZH-CN">BSS.</font><font face="宋体" lang="ZH-CN"> </font></li> </ul> </blockquote> </blockquote> <blockquote> <p style="line-height: 150%"><b>VxWorks Image文件类型的说明</b></p> <blockquote> <p style="line-height: 150%"><b>Uploaded images(通过网口或串口下载到RAM):</b></p> <p style="line-height: 150%">vxWorks - basic Tornado, shell 和 symbol table 在主机端 <br> vxWorks.st(文件很大)- 独立的 image,包含shell和 symbol table在目标板运行<br> <br> <b>ROM based images(直接烧入ROM的VxWorks):</b></p> <p style="line-height: 150%">vxWorks_rom - Tornado in ROM,非压缩, 在 RAM 中运行<br> vxWorks.res_rom_nosym - Tornado in ROM, 非压缩,在 ROM 中运行<br> vxWorks.st_rom - Stand-alone in ROM, 压缩, RAM 中运行<br> vxWorks.res_rom - Stand-alone in ROM, 非压缩, ROM 中运行</p> </blockquote> <p style="line-height: 150%"> </p> <p style="line-height: 150%"><strong>非BSP make文件中包括:</strong></p> <p style="line-height: 150%"><big><strong> </strong>include $(TGT_DIR)/h/make/rules.library</big></p> <blockquote> <p style="line-height: 150%"><big>include $(TGT_DIR)/h/make/defs.default(define default value for makefile)</big></p> <p style="line-height: 150%"><big>...............</big></p> </blockquote> <p style="line-height: 150%"><strong>BSP make文件中包括: </strong>include $(TGT_DIR)/h/make/rules.bsp ...</p> <p style="line-height: 150%">ARM7 做VxWorks imgage 时,在makefile 文件中用 MACH_EXTRA 代替 LIB_EXTRA, 这样生成的VxWorks时不压缩的在ROM中运行的程序(uncompressed ROM-based VxWorks image),否则就是压缩的在RAM中运行的程序(compressed RAM-based VxWorks image).</p> <p style="line-height: 150%"> </p> <p style="line-height: 150%"><big><strong>启动顺序的一些概念</strong></big><ul> <li> <p style="line-height: 150%"><font lang="ZH-CN" face="宋体" size="4">The sequence of events which occur as power-up are a function of type VxWorks image with will run.</font></li> <li> <p style="line-height: 150%">处理器"跳"到再ROM或Flash中Boot-strap 程序的起点. 这个程序主要有以下作用:</li> </ul> <blockquote> <ul> <li> <p style="line-height: 150%">关闭中断(来自处理器)</li> <li> <p style="line-height: 150%">初始化目标内存(target memory)</li> <li> <p style="line-height: 150%">装载要运行的VxWorks image segments</li> <li> <p style="line-height: 150%">Jumps to code to place target in quiet state</li> </ul> </blockquote> </blockquote> <blockquote> <ul> <li> <p style="line-height: 150%"><font lang="ZH-CN" face="宋体" size="4"><strong>启动顺序 Boot Sequence--Loadable VxWorks image</strong></font></li> </ul> <blockquote> <ul> <li> <p style="line-height: 150%"><font lang="ZH-CN" face="宋体" size="4">Bootstrap code executes and loads text and data segments of boot code(from ROM or Flash) into RAM.具体执行如下:</font></li> </ul> <blockquote> <ul> <li> <p style="line-height: 150%"><font lang="ZH-CN" face="宋体" size="4">Boot code compressed-Decompression during copy</font></li> <li> <p style="line-height: 150%"><font lang="ZH-CN" face="宋体" size="4">Boot code uncompressed-copy</font></li> <li> <p style="line-height: 150%"><font lang="ZH-CN" face="宋体" size="4">Boot code is ROM-resident-copy data segment only</font></li> </ul> </blockquote> <ul> <li> <p style="line-height: 150%"><font lang="ZH-CN" face="宋体" size="4">Boot program executes and loads VxWorks image into RAM.<u>Jumps to VxWorks load point</u>.</font></li> <li> <p style="line-height: 150%"><font lang="ZH-CN" face="宋体" size="4">System initialization code statically linked into loaded VxWorks image executes and completes initialization.</font></li> </ul> </blockquote> <ul> <li> <p style="line-height: 150%"><font lang="ZH-CN" face="宋体" size="4"><strong>Startup Sequence--VxWorks 初始化</strong></font></li> </ul> <blockquote> <p style="line-height: 150%"><font lang="ZH-CN" face="宋体" size="4"><strong>做以下工作:</strong></font><ul> <li> <p style="line-height: 150%"><font lang="ZH-CN" face="宋体" size="4">Place hardware environment in a quiet state.</font></li> <li> <p style="line-height: 150%"><font lang="ZH-CN" face="宋体" size="4">Initalize and start the wind kernel</font></li> <li> <p style="line-height: 150%"><font lang="ZH-CN" face="宋体" size="4">Spawn a tast to complete system initialization</font></li> </ul> </blockquote> <ul> <li>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -