VxWorks romStar函数分析
来源:互联网 发布:php免费开源积分商城 编辑:程序博客网 时间:2024/04/28 03:20
VxWorks romStar函数分析
Lmjx 2004-8-26 Email:limiao@yeah.net
以下对romStart进行了必要的删减,主要去掉了一些预编译选项。
void romStart
(
FAST int startType /* start type */
)
{
volatile /* to force absolute adressing */
FUNCPTR absEntry; /* to avoid PC Relative Jump Subroutine */
$$<<
注释:
volatile关键字的作用是使编译器不对被指定的变量做优化,这样可以确保该变量每次被取到新的值。Volatile经常用来修饰全局的或者静态的或者在多任务环境下允许被改变的变量。
>>$$
/*
* Copy from ROM to RAM, minus the compressed image
* if compressed boot ROM which relies on binArray
* appearing last in DATA segment.
*/
((FUNCPTR)ROM_OFFSET(copyLongs)) (ROM_TEXT_ADRS, (UINT)romInit,
((UINT)binArrayStart - (UINT)romInit) / sizeof (long));
$$<<
注释:
该段代码将ROM中非压缩的部分拷贝到RAM中。ROM_OFFSET(copyLongs)计算出copyLongs在ROM中的地址,然后调有该函数。BinArrayStart地址以后装的是压缩的代码和数据。
>>$$
/* clear all memory if cold booting */
if (startType & BOOT_CLEAR)
{
$$<<
注释:
如果是冷启动则将0-(romInit - STACK_SAVE)以及binArrayStart之后的RAM清0。
>>$$
fillLongs ((UINT *)(SYS_MEM_BOTTOM),
((UINT)romInit - STACK_SAVE - (UINT)SYS_MEM_BOTTOM) /
sizeof(long), 0);
fillLongs ((UINT *)binArrayStart,
((UINT)SYS_MEM_TOP - (UINT)binArrayStart) / sizeof (long), 0);
/*
* Ensure the boot line is null. This is necessary for those
* targets whose boot line is excluded from cleaning.
*/
$$<<
注释:
将BOOT_LINE_ADRS中的内容清0,保证bootline的正确。
>>$$
*(BOOT_LINE_ADRS) = EOS;
}
/* jump to VxWorks entry point (after uncompressing) */
{
$$<<
注释:
将压缩内容解压缩到RAM_DST_ADRS,即RAM_HIGH_ADRS。
>>$$
if (UNCMP_RTN ((UCHAR *)ROM_OFFSET(binArrayStart),
(UCHAR *)RAM_DST_ADRS, &binArrayEnd - binArrayStart) != OK)
return; /* if we return then ROM's will halt */
absEntry = (FUNCPTR)RAM_DST_ADRS; /* compressedEntry () */
}
$$<<
注释:
转移到RAM中执行。
>>$$
(absEntry) (startType);
}
- VxWorks romStar函数分析
- VxWorks romStar函数分析
- VxWorks启动代码romStart()函数分析
- VxWorks启动代码usrInit()函数分析
- VxWorks启动代码romStart()函数分析
- VxWorks启动代码usrInit()函数分析
- VxWorks启动代码romStart()函数分析
- VxWorks启动代码usrInit ()函数分析
- Vxworks启动代码usrRoot()函数分析(一)
- Vxworks启动代码usrRoot()函数分析(二)
- Vxworks启动代码usrRoot()函数分析(一)
- Vxworks启动代码usrRoot()函数分析(二)
- Vxworks启动代码usrRoot()函数分析(一)
- Vxworks启动代码usrRoot()函数分析(二)
- VxWorks信号量分析(转贴)
- VXWORKS内核分析
- vxworks异常分析
- Vxworks信号量分析
- 在 ASP.NET 中执行 URL 重写
- flashclash比赛RIA获奖作品
- BBS 设计思路系列 ---- 下一代社区的几个原则
- 关于linux系统一启动就调用某个程序
- (转)生存智慧——新的生活方式
- VxWorks romStar函数分析
- 应该体谅女孩子的十个地方(转)
- tomcat 5.X 的mysql DBCP配置指南及相关问题小结
- [原创]代码范例:自定义组件和自定义事件
- [原创]利用橡皮条技术画图
- [原创]代码范例:画一个美观的箭头
- [原创]Linux下写本地方法
- EL(Expression Language)的初次使用印象
- [原创]代码范例:一个读文件的进度条