嵌入式爱好者

查看: 4601|回复: 0

BIB文件中的ROMOFFSET参数到底是做什么的?

[复制链接]

0

主题

0

帖子

4

积分

扫一扫,手机访问本帖
发表于 2012-8-5 21:15:04 | 显示全部楼层 |阅读模式
哪位给说说,BIB文件中的ROMOFFSET参数到底是做什么的?MSDN中的说法:
-------------------------------------------------
This configuration option, which is optional, modifies binary (.bin) file Record Addresses. This is done to fix up a run-time image for one address, but to have the run-time image be located at a different address. This arrangement is useful if you want your run-time image to run in RAM, but you want to store the run-time image in ROM or flash memory.
When ROMOFFSET is set, by default, each Record Address is offset by the specified amount from the fixup address that RAMIMAGE specifies. The boot loader writes each .bin file record at the address specified by its Record Address.
Note:

This configuration option does not affect absolute binary data format files.
For more information about the Record Address field in binary files and the binary file format itself, see Windows Embedded CE Binary Image Data Format.
This option uses the following syntax.
ROMOFFSET = address
________________________________________
address
The hexadecimal address. This value is added to the Record Address of every record in the .bin file.
________________________________________
In the following example, the associated run-time image is fixed up to run from RAM, but the run-time image itself is stored in flash. To accomplish this, ROMOFFSET is used to change the values of the Record Address fields to flash addresses. This ensures that the boot loader writes the run-time image to flash memory, since the boot loader uses the Record Address fields to determine where to write the run-time image.
MEMORY
   NK       80240000  009C0000  RAMIMAGE
   RAM      80C00000  03000000  RAM
   
CONFIG
   
    ;
    ; ROMOFFSET must be large enough so that when it is added to the base address
    ; of NK the result wraps around to 0x00100000 (assuming your flash is mapped at
    ; 0x00000000, the CPU fetches code from 0x00000000 after reset, and you have a
    ; boot loader that occupies 0x00000000 to 0x000FFFFF).  
    ;
    ; NK         +  ROMOFFSET   = (address to write .bin image to)
    ;
    ; 0x80240000 +  0x7FEC0000  = 0x00100000 (download to flash)
    ;
    ; In other words, the run-time address will execute in RAM at 0x80240000, but the
    ; modified .bin Record Address fields will cause the image to be written to flash.
    ; Eboot must copy the image from flash to RAM at reset.
    ;
   ROMOFFSET=7FEC0000
Boot loaders that are stored in ROM or flash memory but copy themselves to RAM before startup can also use this configuration option.
--------------------------------------
意思差不多明白,但不知道这样做的原因何在?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )

GMT+8, 2024-11-24 16:49

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表