打印

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

[复制链接]
223|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
车水马龙|  楼主 | 2018-9-6 13:18 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
哪位给说说,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.

--------------------------------------

意思差不多明白,但不知道这样做的原因何在?

使用特权

评论回复

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

474

主题

476

帖子

0

粉丝