ImageVerifierCode 换一换
格式:DOC , 页数:13 ,大小:78.50KB ,
资源ID:8971886      下载积分:10 金币
验证码下载
登录下载
邮箱/手机:
验证码: 获取验证码
温馨提示:
支付成功后,系统会自动生成账号(用户名为邮箱或者手机号,密码是验证码),方便下次登录下载和查询订单;
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

开通VIP
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.zixin.com.cn/docdown/8971886.html】到电脑端继续下载(重复下载【60天内】不扣币)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

开通VIP折扣优惠下载文档

            查看会员权益                  [ 下载后找不到文档?]

填表反馈(24小时):  下载求助     关注领币    退款申请

开具发票请登录PC端进行申请。


权利声明

1、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
2、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
3、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
4、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前可先查看【教您几个在下载文档中可以更好的避免被坑】。
5、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
6、文档遇到问题,请及时联系平台进行协调解决,联系【微信客服】、【QQ客服】,若有其他问题请点击或扫码反馈【服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【版权申诉】”,意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:4009-655-100;投诉/维权电话:18658249818。

注意事项

本文(VX启动代码.doc)为本站上传会员【xrp****65】主动上传,咨信网仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知咨信网(发送邮件至1219186828@qq.com、拔打电话4009-655-100或【 微信客服】、【 QQ客服】),核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载【60天内】不扣币。 服务填表

VX启动代码.doc

1、/* bootInit.c - ROM initialization module */ /* Copyright 1989-2002 Wind River Systems, Inc. */ #include "copyright_wrs.h" /* modification history -------------------- 05h,26mar02,sbs correcting data section relocation for ROM compressed images (SPR 73785) 05g,19mar02,d

2、at Removing previous fix for MIPS, no longer needed (72825) 05f,18jan02,dat Don't use loop unrolling for MIPS 05f,22jan02,scm Xscale specific validation added to update cache (to match updates...) 05e,19dec01,aeg prevented pc-relative addressing on MC680X0. 05d,10dec01,sbs

3、 Corrected conditions around call to copyLongs for ROM resident images. 05c,27nov01,sbs Added new labels, wrs_kernel_data_start and wrs_kernel_data_end for sdata and edata respectively. Added second copy for data section of compressed ROM images. Corrected

4、 definition for binArrayEnd. Corrected definition for RESIDENT_DATA. 05b,27nov01,tpw Manually unroll copyLongs and fillLongs. 05a,25oct01,pad Removed definitions of _binArrayStart and _binArrayEnd, now unnecessary. 04z,03oct01,dee Merge from ColdFire T2.1.0

5、 release 04y,11jan01,scm Xscale specific validation added to update cache, can not assume uncached area.... 04x,10jun99,jpd fix error when BOOTCODE_IN_RAM defined (SPR #27775). 04w,13nov98,cdp make Thumb support for ARM CPUs dependent on ARM_THUMB. 04w,10feb99,db Fix to ensure that default

6、bootline gets copied for standalone and rom-resident images(SPR #21763). 04v,05oct98,jmp doc: cleanup. 04u,17apr98,cdp backed out 04t and made absEntry volatile for ARM. 04t,16apr98,cdp for ARM, make UNCOMPRESS entry point in RAM. 04s,20mar98,cdp make ROM_COPY_SIZE subject to #ifndef. 0

7、4r,11nov97,cdp ARM7TDMI_T: force romStart to call entry point in Thumb state. (SPR# 9716) 04q,14jul97,tam changed remaining references to bfillLong to fillLong. 04p,12feb97,dat Added USER_RESERVED_MEM, SYS_MEM_TOP, SYS_MEM_BOTTOM, SPR 8030 04o,04feb97,ms fixed compiler warning about pro

8、toype for bcopyLongs. 04o,28nov96,cdp added ARM support. 04n,03sep96,hdn added the compression support for pc[34]86 BSP. 04m,19aug96,ms added UNCMP_RTN macro to use inflate instead of uncompress 04l,21jun96,jmb long modhist -- deleted entries prior to 1994. SPR #6528 03k,10jun96,tam adde

9、d rom resident support for PPC architecture. 03j,14may96,dat fixed compiler warnings for copyLongs, fillLongs. SPR #6536 03i,06mar96,tpr changed absEntry to be volatile for PowerPC. 03h,22aug95,hdn added support for I80X86. 03g,14mar95,caf restored mips resident rom support (SPR #3856). 03

10、f,16feb95,jdi doc format change. 03f,23may95,yao define binArrayStart and binArrayEnd for PowerPC because tools don't prepend "_". 03e,09dec94,caf undid mod 03a, use sdata for resident roms (SPR #3856). 03d,22jun94,caf undid 16-byte alignment portion of mod 03c, below. 03c,14jun94,cd c

11、orrected definitions of etext, edata and end. +caf for R4000 resident ROMs: data starts on 16-byte boundary. for R4000 uncompressed ROMs: added volatile to absEntry type. */ /* DESCRIPTION This module provides a generic boot ROM facility. The target-specific romInit.s module perfor

12、ms the minimal preliminary board initialization and then jumps to the C routine romStart(). This routine, still executing out of ROM, copies the first stage of the startup code to a RAM address and jumps to it. The next stage clears memory and then uncompresses the remainder of ROM into the fi

13、nal VxWorks ROM image in RAM. A modified version of the Public Domain \f3zlib\fP library is used to uncompress the VxWorks boot ROM executable linked with it. Compressing object code typically achieves over 55% compression, permitting much larger systems to be burned into ROM. The only expen

14、se is the added few seconds delay while the first two stages complete. ROM AND RAM MEMORY LAYOUT Example memory layout for a 1-megabyte board: .CS -------------- 0x00100000 = LOCAL_MEM_SIZE = sysMemTop() | | | RAM | | 0 filled | | |

15、 |------------| = (romInit+ROM_COPY_SIZE) or binArrayStart | ROM image | |----------- | 0x00090000 = RAM_HIGH_ADRS | STACK_SAVE | |------------| | | 0x00080000 = 0.5 Megabytes | | | | | 0 filled | | |

16、 | | 0x00001000 = RAM_ADRS & RAM_LOW_ADRS | | | | exc vectors, bp anchor, exc msg, bootline | | | | -------------- 0x00000000 = LOCAL_MEM_LOCAL_ADRS .CE .CS -------------- | ROM | |

17、 | 0xff8xxxxx = binArrayStart | | | | 0xff800008 = ROM_TEXT_ADRS -------------- 0xff800000 = ROM_BASE_ADRS .CE SEE ALSO: inflate(), romInit(), and deflate AUTHOR The original compression software for zlib was written by Jean-loup Gailly and Mark

18、 Adler. See the manual pages of inflate and deflate for more information on their freely available compression software. */ #include "vxWorks.h" #include "sysLib.h" #include "config.h" #include "errno.h" #include "sioLib.h" #define UNCMP_RTN inflate #ifndef USER_RESERVED_MEM #

19、 define USER_RESERVED_MEM 0 #endif /* * If memory is to be cleared, it will be cleared from SYS_MEM_BOTTOM * up to (but not including) SYS_MEM_TOP, except for text and data segments. * The user reserved area is not cleared. */ #define SYS_MEM_TOP \ (LOCAL_MEM_LOCAL_ADRS + LOCAL_MEM_

20、SIZE - USER_RESERVED_MEM) #define SYS_MEM_BOTTOM \ (LOCAL_MEM_LOCAL_ADRS + RESERVED) #define BINARRAYEND_ROUNDOFF (ROUND_DOWN(binArrayEnd, sizeof(long))) IMPORT void romInit (); IMPORT STATUS UNCMP_RTN (); IMPORT void usrInit (); IMPORT void sysInitAlt (); IMPORT void start (); IM

21、PORT UCHAR binArrayStart []; /* compressed binary image */ IMPORT UCHAR binArrayEnd []; /* end of compressed binary image */ IMPORT char etext []; /* defined by the loader */ IMPORT char end []; /* defined by the loader */ IMPORT UCHAR wrs_kernel_data_start []; /* defined by the loader */

22、IMPORT UCHAR wrs_kernel_data_end []; /* defined by the loader */ #if ((CPU_FAMILY == MIPS) || (CPU_FAMILY==PPC) || \ (CPU_FAMILY==COLDFIRE)) #define RESIDENT_DATA RAM_DST_ADRS //定义体系结构特殊信息==压缩映象最终重定位的地址 #else #define RESIDENT_DATA wrs_kernel_data_start #endif #ifndef RAM_DST_ADRS

23、 /* default uncompress dest. */ #define RAM_DST_ADRS RAM_HIGH_ADRS //压缩映象最终重定位的地址==拷贝引导映象的入口地址 #endif /* If the boot code is in RAM and the RAM is already initialized, * clearing the RAM is not necessary. Macro BOOTCODE_IN_RAM is * used not to clear the RAM. */ #i

24、fdef BOOTCODE_IN_RAM /* not to clear RAM */ #undef ROM_TEXT_ADRS #undef ROM_BASE_ADRS #define ROM_TEXT_ADRS ((UINT)romInit) #define ROM_BASE_ADRS ((UINT)romInit) //引导rom的入口地址 #endif /* BOOTCODE_IN_RAM */ /* #if defined (UNCOMPRESS) || defined (ROM_RESIDENT) */ #ifndef ROM_COPY_SIZE #defi

25、ne ROM_COPY_SIZE (ROM_SIZE - (ROM_TEXT_ADRS - ROM_BASE_ADRS)) #endif /* #endif*/ /* UNCOMPRESS */ #define ROM_OFFSET(adr) (((UINT)adr - (UINT)romInit) + ROM_TEXT_ADRS) //rom->ram时涉及到计算偏移地址函数,重定位了adr在rom当中的位置; /* forward declarations */ LOCAL void copyLongs (FAST UINT *source, FAST UINT *d

26、estination, UINT nlongs);//拷贝rom->ram函数 #ifndef BOOTCODE_IN_RAM LOCAL void fillLongs (FAST UINT *buf, UINT nlongs, FAST UINT val);//往ram填零函数 #endif /* BOOTCODE_IN_RAM */ #if (CPU==XSCALE) int checkLongs (FAST UINT *source, FAST UINT *destination, UINT nlongs);//比较函数 #endif /****************

27、 * * romStart - generic ROM initialization * * This is the first C code executed after reset. * * This routine is called by the assembly start-up code in romInit(). * It clears memory, copies ROM to RAM, and possibly invokes the u

28、ncompressor. * It then jumps to the entry point of the uncompressed object code. * * RETURNS: N/A */ void romStart ( FAST int startType /* 启动类型,它的入口参数是startType,是一个启动类型标志,这在后面清内存时会用到*/ ) { #if ((CPU_FAMILY==SPARC) || (CPU_FAMILY==MIPS) || (CPU_FAMILY==I80X86)

29、 \ (CPU_FAMILY==PPC) || (CPU_FAMILY==ARM)) volatile /* to force absolute adressing */ #endif /* (CPU_FAMILY==SPARC) */ FUNCPTR absEntry; /* to avoid PC Relative Jump Subroutine */ //函数指针变量absEntry,它最后指向ursInit()或compressedEntry()函数 #if (CPU_FAMILY==ARM) && (!defined(R

30、OM_RESIDENT)) && !defined(BOOTCODE_IN_RAM) VOIDFUNCPTR ramfillLongs = fillLongs; /* force call to RAM */ #define fillLongs(a,b,c) ramfillLongs(a,b,c) #endif /* (CPU_FAMILY==ARM) */ #if (CPU_FAMILY==MC680X0) && !defined(ROM_RESIDENT) && !defined(BOOTCODE_IN_RAM) volatile VOIDFUNCP

31、TR romcopyLongs = ©Longs; /* force call to ROM */ #define copyLongs romcopyLongs #endif /* (CPU_FAMILY==MC680X0) */ /* * Copy from ROM to RAM, minus the compressed image * if compressed boot ROM which relies on binArray * appearing last in DATA segment. */ #ifd

32、ef ROM_RESIDENT /* If ROM resident code, then copy only data segment * from ROM to RAM, initialize memory and jump * to usrInit. */ #if (CPU_FAMILY == SPARC) copyLongs ((UINT *)(etext + 8), (UINT *) RESIDENT_DATA, #else copyLongs ((UINT *)etext, (UINT *) RESIDENT_

33、DATA, #endif ((UINT) wrs_kernel_data_end - (UINT) RESIDENT_DATA) / sizeof (long)); #else /* ROM_RESIDENT */ #ifdef UNCOMPRESS #if (CPU_FAMILY == MIPS) /* * copy text to uncached locations to avoid problems with * copy back caches */ ((FUNCPTR)ROM_OFFSET

34、copyLongs)) (ROM_TEXT_ADRS, (UINT)K0_TO_K1(romInit), ROM_COPY_SIZE / sizeof (long)); #else /* CPU_FAMILY == MIPS */ ((FUNCPTR)ROM_OFFSET(copyLongs)) (ROM_TEXT_ADRS, (UINT)romInit, ROM_COPY_SIZE / sizeof (long)); #endif /* CPU_FAMILY == MIPS */ #else /* UNCOMPRESS */ #if (CPU_FAMI

35、LY == MIPS) /* * copy text to uncached locations to avoid problems with * copy back caches * copy the entire data segment because there is no way to ensure that * binArray is the last thing in the data segment because of GP relative * addressing */ ((FUN

36、CPTR)ROM_OFFSET(copyLongs)) (ROM_TEXT_ADRS, (UINT)K0_TO_K1(romInit), ((UINT)wrs_kernel_data_end - (UINT)romInit) / sizeof (long)); #else /* CPU_FAMILY == MIPS */ ((FUNCPTR)ROM_OFFSET(copyLongs)) (ROM_TEXT_ADRS, (UINT)romInit, //(FUNCPTR)为int (*)()型的函数指针;ROM_OFFSET为rom->ram时涉及到计算偏移地址函数,重

37、定位了copyLongs在rom当中的位置; //(copyLongs)为拷贝rom->ram函数;ROM_TEXT_ADRS为拷贝内容rom入口地址;(UINT)romInit为ram目标地址 ((UINT)binArrayStart - (UINT)romInit)/ sizeof (long)); //非压缩镜像大小,binArrayStart为压缩部分起始地址;

38、 //rom->ram 代码段部分; ((FUNCPTR)ROM_OFFSET(copyLongs)) ((UINT *)((UINT)ROM_TEXT_ADRS + ((UINT)BINARRAYEND_ROUNDOFF - //(UINT)BINARRAYEND_ROUNDOFF为ram中压缩部分之后目标地址; (UINT)romInit)), (UINT *)BINARRAYEND_ROUNDOFF, ((UIN

39、T)wrs_kernel_data_end - (UINT)binArrayEnd) / sizeof (long)); #if (CPU==XSCALE) /* validate coherence, can not assume uncached area... */ ((FUNCPTR)ROM_OFFSET(checkLongs)) (ROM_TEXT_ADRS, (UINT)romInit, ((UINT)binArrayStart - (UINT)romInit) / sizeof (l

40、ong)); ((FUNCPTR)ROM_OFFSET(checkLongs)) ((UINT *)((UINT)ROM_TEXT_ADRS + ((UINT)BINARRAYEND_ROUNDOFF - (UINT)romInit)), (UINT *)BINARRAYEND_ROUNDOFF, ((UINT)wrs_kernel_data_end - (UINT)binArrayEnd) / sizeof (long)); #endif #endif /* CPU_FAMILY == MIPS

41、/ #endif /* UNCOMPRESS */ #endif /* ROM_RESIDENT */ #if (CPU_FAMILY != MIPS) && (!defined (BOOTCODE_IN_RAM)) /* clear all memory if cold booting */ if (startType & BOOT_CLEAR) { #ifdef ROM_RESIDENT /* Clear memory not loaded with text & data. * * We are careful abo

42、ut initializing all memory (except * STACK_SAVE bytes) due to parity error generation (on * some hardware) at a later stage. This is usually * caused by read accesses without initialization. */ fillLongs ((UINT *)SYS_MEM_BOTTOM, ((UINT) RESIDENT_DATA - STACK_SAVE - (UINT)SYS_MEM_BO

43、TTOM) / sizeof(long), 0); fillLongs (((UINT *) wrs_kernel_data_end), ((UINT)SYS_MEM_TOP - ((UINT) wrs_kernel_data_end)) / sizeof(long), 0); #else /* ROM_RESIDENT */ fillLongs ((UINT *)(SYS_MEM_BOTTOM), ((UINT)romInit - STACK_SAVE - (UINT)SYS_MEM_BOTTOM) / sizeof(long), 0);

44、 //实现了从SYS_MEM_BOTTOM到STACK_SAVE之前RAM的清零 #if defined (UNCOMPRESS) fillLongs ((UINT *)((UINT)romInit + ROM_COPY_SIZE), ((UINT)SYS_MEM_TOP - ((UINT)romInit + ROM_COPY_SIZE)) / sizeof(long), 0); #else fillLongs ((UINT

45、)wrs_kernel_data_end, //实现了从数据段到SYS_MEM_TOP的RAM区清零 ((UINT)SYS_MEM_TOP - (UINT)wrs_kernel_data_end) / sizeof (long), 0); #endif /* UNCOMPRESS */ #endif /* ROM_RESIDENT */ /* * Ensure the boot line is null. This is necessary for those * targets whose boot line is e

46、xcluded from cleaning. */ *(BOOT_LINE_ADRS) = EOS; } #endif /* (CPU_FAMILY != MIPS) && (!defined (BOOTCODE_IN_RAM)) */ /* jump to VxWorks entry point (after uncompressing) */ #if defined (UNCOMPRESS) || defined (ROM_RESIDENT) #if (CPU_FAMILY == I960) absEntry = (FUNCPTR)s

47、ysInitAlt; /* reinit proc tbl */ #else absEntry = (FUNCPTR)usrInit; /* on to bootConfig */ #endif /* CPU_FAMILY == I960 */ #else { #if (CPU_FAMILY == MIPS) volatile FUNCPTR absUncompress = (FUNCPTR) UNCMP_RTN; if ((absUncompress) ((UCHAR *)ROM_OFFSET(binArrayStart),

48、 (UCHAR *)K0_TO_K1(RAM_DST_ADRS), (int)((UINT)binArrayEnd - (UINT)binArrayStart)) != OK) #elif (CPU_FAMILY == I80X86) || (CPU_FAMILY == ARM) volatile FUNCPTR absUncompress = (FUNCPTR) UNCMP_RTN; // UNCMP_RTN为原形函数为int inflate(Byte * src,Byte * dest,int nBytes) if ((absUncompress) ((

49、UCHAR *)ROM_OFFSET(binArrayStart), //ROM_OFFSET(binArrayStart为压缩文件起始地址,在rom中需要重定向; (UCHAR *)RAM_DST_ADRS, binArrayEnd - binArrayStart) != OK) //解压缩过程,RAM_DST_ADRS目标地址; #else if (UNCMP_RTN ((UCHAR *)ROM_OFFSET(binArrayStart), (UCHAR *)RAM_DS

50、T_ADRS, binArrayEnd - binArrayStart) != OK) #endif /* (CPU_FAMILY == MIPS) */ return; /* if we return then ROM's will halt */ absEntry = (FUNCPTR)RAM_DST_ADRS; /* compressedEntry () 程序的入口地址就是RAM_DST_ADRS */ } #endif /* defined UNCOMPRESS || defined ROM_RESIDENT */ #if ((CPU_

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2025 宁波自信网络信息技术有限公司  版权所有

客服电话:4009-655-100  投诉/维权电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服