修改BIB文件 Modifying the Binary Image Builder Files

 

 

After you have created your OS design, you must modify the config.bib and platform.bib (binary image builder) files to specify files and settings that are required to build a run-time image with multiple XIP regions.

wince镜像文件创建后,必须修改config.bibplatform.bib文件,以运行镜像文件。

 

To modify the .bib files for your run-time image with multiple XIP regions

1.    In Platform Builder, from the Workspace window, choose the ParameterView tab at the bottom of the window. In the project tree, under the CEPC node, expand the Hardware Specific Files node, and double-click the Config.bib file.

Note   It is recommended that you create a backup copy of config.bib so that, if config.bib becomes corrupted by the changes you make to the file, you do not need to repair the Windows CE OS installation for your BSP.

修改bib文件之前,千万记得备份以前的配置文件,以防编译不成功。一般说来,博主喜欢在文件后面加上.bak-2011-3-10的标志,到时候可以恢复文件,同时还知道修改时间。

2.    In config.bin, navigate to the MEMORY section and define the multiple XIP regions for your run-time image. By default, the MEMORY section includes a list of #elif defined statements for IMGRAM variables of different sizes. In the MEMORY section of config.bib, paste the following code example after the #elif defined statements, right before the #else statement. The multiple XIP regions defined in the following example will work for a CEPC BSP.

Copy

#elif defined IMGMULTIBIN

;  NAME           START ADDR    SIZE       TYPE

;  ----------------------------------------------------------------

    NK            80220000      007DE000   RAMIMAGE  

    SHELL         809FE000      00100000   RAMIMAGE  

    APPS          80AFE000      00100000   RAMIMAGE  

    CHAIN         80BFE000      00002000   RESERVED ; XIP chain info

    RAM           80C00000      01000000   RAM       

    pdwXIPLoc     00000000      80BFE000   FIXUPVAR   ; XIP pTOC

In the above example, the NK region has been divided so that the image includes three new regions: SHELL, APPS, and CHAIN. All regions are contiguous, and there are no address gaps between any of the regions. The values listed above are examples that can be used for the purpose of this procedure. However, you can also choose a custom size for each region. The size that you define for each region is arbitrary, and depends on the files you are planning to add to each region and whether any of these will be compressed by Romimage.exe. As a good practice, add the sizes of all files for a given region, and then add an extra 32K as a buffer. Adding this extra amount provides room for the files to reduce and expand as they change between each successive build.

 

由上面例子可以看出,NK区域被分成了三个新区域,SHELL,APPSCHIAIN,(博主也不是很明白,看START ADDR看出来是后续的而不是把NK分解了的),所有的新区域都是连续的,而且每个区域之间地址是连续没有缝隙的,但是编程的时候,可以定义每段的尺寸。其大小主要由你添加到每一区域的文件内容大小而决定。

 

In the above example, the CHAIN region has been placed last behind all other regions. The location where you define the CHAIN region in config.bib depends on your bootloader. For example, a CEPC requires that the CHAIN region is defined after the NK region.

The above example also shows that pdwXIPLoc has been declared as the fixup variable and that its location has been set to the same address as the start of the CHAIN region.

 

上面例子中pdwXIPLoc 变量已经被声明了的。

 

3.    After defining the multiple XIP regions in the MEMORY section, you must add a set of values to the CONFIG section of config.bin to provide Romimage.exe with the address of where the chain file needs to be placed. These values also configure Romimage.exe to automatically size the module images. In config.bib, in the CONFIG section, set the following values:

Note   Some of these values may already be set by default.

Value

Description

AUTOSIZE=ON

Adjusts the start address of RAM to the end of the last XIP region.

ROM_AUTOSIZE=ON

Automatically sizes each separate XIP region.

DLLADDR_AUTOSIZE=ON

Automatically sizes the DLL address space across multiple XIP regions.

XIPSCHAIN=80bfe000

Points to the start of the CHAIN region defined in the MEMORY section.

Note   This address is applicable for the example provided in the previous step of this procedure. If you use a customized address for the CHAIN region or a different BSP, you will have to update this variable to match your settings.

4.    To save your changes to the Config.bib file, from the File menu, choose Save.

5.    In the project tree, under the CEPC node, expand the Hardware Specific Files node, and double-click the platform.bin file.

6.    Locate the Files section at the end of platform.bib and add the following entries at the end of the Files section:

Copy

if IMGMULTIBIN

   shell.exe   $(_FLATRELEASEDIR)/shell.exe   SHELL   SH

   filesys.exe $(_FLATRELEASEDIR)/filesys.exe SHELL   SH

#else

   shell.exe   $(_FLATRELEASEDIR)/shell.exe   NK  SH

   filesys.exe $(_FLATRELEASEDIR)/filesys.exe NK  SH

#endif

These entries will tell romimage.exe to place the Shell and File System in the SHELL region, and to load these applications from this region in memory.

1.    To save your changes to platform.bib, from the File menu, choose Save.

2.    To add the IMG environment variable for multiple XIP support, from the Platform menu, choose Settings.

3.    Choose the Environment tab, and then choose New.

4.    In the Variable name box, type IMGMULTIBIN.

5.    In the Variable value box, type 1, and then choose OK.

6.    To close the Platform Settings dialog box and save your changes, choose OK

 

 

     

    评论
    添加红包

    请填写红包祝福语或标题

    红包个数最小为10个

    红包金额最低5元

    当前余额3.43前往充值 >
    需支付:10.00
    成就一亿技术人!
    领取后你会自动成为博主和红包主的粉丝 规则
    hope_wisdom
    发出的红包
    实付
    使用余额支付
    点击重新获取
    扫码支付
    钱包余额 0

    抵扣说明:

    1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
    2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

    余额充值