关于Multi-bin实现的一些翻译

http://msdn.microsoft.com/en-us/library/aa914387.aspx

自己翻译,欢迎拍砖

How to Implement BinFS
You can implement the binary ROM image file system (BinFS) on NAND or NOR flash media to read the .bin file format generated by Romimage.exe. BinFS parses the .bin file records of each region is invisible to the end user. To implement BinFS, you must add multi-bin region support to an existing boot loader, along with the necessary modifications to the Config.bib file to enable BinFS to read your run-time image properly.

你可以在NAND或者NOR FLASH上面实现二进制ROM镜像文件系统读取Romimage.exe生成的.bin文件格式。BinFS可以分析每个区域里面的.bin文件记录,这些.bin文件记录,最终用户是无法看见的。为了实现BinFS,你必须加入multi-bin区域去支持一个已经存在的bootloader,除了在Config.bib文件中进行必要的修改,还要让BinFS能适当地读取你的运行时镜像文件。

Hardware and Software Assumptions
# You have access and familiarity with Platform Builder and the build process.
# You have basic knowledge of the Windows Embedded CE OS, Romimage, and associated file formats. For more information on Romimage, see Romimage.
硬件和软件假定
#你可以访问和熟悉PB和创建过程。
#你应该有基本的WINCE OS,Romimage并且联系文件格式的知识。为了得到更多关于Romimage的消息,看Romimage。
步骤:
1. Develop a boot loader for your target device.
How to Develop a Boot Loader
1.为你的目标设备开发一个boot loader
如何去开发一个Boot loader

2. Add support for BinFS to your boot loader.
Boot Loader Support for BinFS
2.在你的bootloader加入对BinFS 的支持
Boot Loader支持BinFS

3. Modify the MEMORY section of the Config.bib file to support BinFS.
Modifying the MEMORY Section of the Config.bib File to Support BinFS
3.修改Config.bib file的内存段(MEMORY section )部分去支持BinFS
修改Config.bib file的内存段部分去支持BinFS

4. Modify the CONFIG section of the Config.bib file to support BinFS.
Modifying the CONFIG Section of the Config.bib File to Support BinFS
4.修改Config.bib file的配置段部分(CONFIG section)去支持BinFS
修改Config.bib file的配置段部分(CONFIG section)去支持BinFS

5. If your OS design supports User Mode Drivers, modify the Common.bib file to ensure that the driver modules are non-pageable.
Modifying the Common.bib File to Support BinFS
如果你的操作系统设计支持用户模式驱动,修改Common.bib文件确保驱动模块是非页访问(non-pageable)
修改Common.bib文件去支持BinFS

6. If you are using the flash media driver (FMD) provided with Platform Builder, you do not need to modify the Platform.reg file. If you are using a custom FMD, you must modify the Platform.reg file to load BinFS on a block driver. For more information, see BinFS Registry Settings.
Not applicable
6.如果你在使用PB提供的FLASH驱动(FMD),你不用修改Platform.reg文件。如果你使用的是定制的FMD,那么你必须去修改Platform.reg文件去下载BinFS到一个块(block)驱动上。获取更多的信息,查看BinFS注册表设置 (Registry Settings)

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

How to Develop a Boot Loader

A boot loader manages the boot process of the target device by initializing the target device, downloading the run-time image, and booting the run-time image on the target device.
A boot loader 管理着目标设备初始化,下载运行时镜像和引导运行时镜像时的引导启动过程。

After you develop a boot loader, you can use the boot management capabilities of your boot loader to save time during the OS development process.
在你开发了一个boot loader,在操作系统开发过程中,你可以使用你的boot loader的引导管理能力去保存时间。

Without a boot loader, you must transfer a run-time image to your target device through a slow, manual process.
如果没有boot loader,你必须通过一个缓慢的,手工的过程才能将你的运行时镜像传送到你的目标设备。

With a boot loader, you can quickly download a new development run-time image to your target device.
在一个boot loader,你可以快速地下载一个新开发的运行时镜像到你的目标设备。

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

Boot Loader Support for BinFS

If a boot loader includes support for the binary ROM image file system (BinFS), the boot loader can partition, format, and write data to a media device. The boot loader uses Bootpart library to write to flash media and to create partitioning. This partitioning is necessary for both BinFS and another file system, such as FAT, to be flashed on the same media device.
如果一个boot loader包括支持BinFS,则这个boot loader是可以分区的,格式化的并且可以写数据进存储设备的。boot loader使用Bootpart库函数去写入到flash闪存,并且进行分区。这个分区对于BinFS 和另外一个文件系统,比如FAT,闪存进统一存储设备上,是有必要的。

To accomplish partitioning, the boot loader uses the Bootpart library to create a BinFS partition and an extended partition. The OS uses these partitions to create one or more data partitions in the extended partition. The extended partition is required because the OS cannot modify the master boot record (MBR) once the boot loader's Bootpart library partitions flash memory.
为了实现这个分区,the boot loader使用Bootpart静态库去产生一个BinFS 分区和一个外部扩展分区。操作系统使用这些分区在外部分区上产生一个或者更多的数据分区。外部扩展分区是有必要的,因为操作系统是不能修改控制引导记录的,一旦the boot loader的Bootpart库函数对flash 内存进行了分区。

The Bootpart library can create a boot partition to store boot parameters. The flash memory blocks that contain the MBR sector, the BinFS memory region, and the boot parameters partition are read-only. The BinFS and boot partitions are also read-only so that the partitions cannot be formatted or deleted.
Bootpart库函数可以产生一个引导分区去存储引导参数。FLASH内存块包括了MBR段,BinFS内存区域,和引导参数分区,这些都是只读的。The BinFS和引导分区也都是只读的,所以分区时不能被格式化或者被删除的。

Bootpart enables code for a flash media driver (FMD) to be abstracted from the boot loader. The boot loader creates the partition and reads or writes to the partition by specifying a byte offset into the partition, as well as a length value. Bootpart can also perform a low-level format on the flash media.
Bootpart可以使FMD的代码从boot loader中抽象出来。The boot loader产生了分区,并且通过指定字节的偏移完成对分区的读或者写,包括长度值。Bootpart也可以在flash存储介质上完成一个低级格式化。

To support BinFS, your boot loader must link to the Bootpart library located in the %_WINCEROOT%/Public/Common/Oak/Drivers/EthDbg/Bootpart directory.
为了支持BinFS,你的boot loader必须要连接到 Bootpart 静态库,位于%_WINCEROOT%/Public/Common/Oak/Drivers/EthDbg/Bootpart路径下。

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

Modifying the MEMORY Section of the Config.bib File to Support BinFS
To implement the binary ROM image file system (BinFS), you must modify the Config.bib file as follows:
1.Add the EXT region and set it to NANDIMAGE. This prevents the EXT address space from being allocated to RAM. The EXT region is the location for files not stored in the NK region.
The following example shows the NK, EXT, and CHAIN regions of the MEMORY section of a Config.bib file that supports BinFS:
1.加入EXT区域并且设置它为NANDIMAGE。这将会阻止EXT地址空间被分配为RAM地址。EXT区域是一个并不存储NK区域的文件。下面的例子显示了一个Config.bib文件中的MEMORY 段包含的NK,EXT和CHAIN区域设置,来支持BinFS。
NK  800B8000 00300000 RAMIMAGE
EXT  803B8000 01000000 NANDIMAGE
CHAIN  813B8000 00001000 RESERVED
2.Set the NK region to RAMIMAGE. The NK region is where files that must be loaded prior to implementation of BinFS are stored. Because the kernel must reside in RAM and the NK region is RAMIMAGE, the files loaded into the NK region typically include everything needed for the kernel.
2.设置NK区域的属性为RAMIMAGE。NK区域是一个存储在BinFS中的必须要优先装载实现的文件。因为内核必须驻在内存中并且NK区域是RAMIMAGE的,要下载到NK区域的典型的文件包括内核所需要的一切。
The NK region files must include the following:
NK区域文件一定要包括下面的模块:
#  Nk.exe
# Kernel.dll
# Coredll.dll
# K.coredll.dll
# Oalioctl.dll
# Filesys.dll
# Fsdmgr.dll
# Mspart.dll
# Romfsd.dll
# Binfs.dll
# Default.fdf or boot.hv
# Fpcrt.dll (ARM-only)
# Ceddk.dll (if required by your flash driver)
# Your flash driver
3.If your flash driver is loaded by the device manager, also add device.dll, devmgr.dll, regenum.dll, busenum.dll, and pm.dll to the NK region.
如果你的flash驱动被设备管理器所装载,也可以添加device.dll,devmgr.dll,regenum.dll, busenum.dll, and pm.dll到NK区域里面。
4.For kernel independent transport layer (KITL) support, also add kitl.dll to the NK region.
为了支持KITL,也可以添加KITL.dll进NK.dll区域。
5.For debugging support, also add hd.dll, osaxst0.dll, and osaxst1.dll to the NK region.
为了支持调试,也可以加入hd.dll, osaxst0.dll, and osaxst1.dll进NK区域。
6.Place the remaining items in the EXT section.
在EXT段里面放置保留的项目(在EXT里面放置一个保留项)

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

Modifying the CONFIG Section of the Config.bib File to Support BinFS
Use the following steps to modify the CONFIG section of the Config.bib file for to support the binary ROM image file system (BinFS):

    * The CONFIG section of the Config.bib file must specify RAM_AUTOSIZE=OFF, ROM_AUTOSIZE=OFF as well as the XIPSCHAIN value that represents the start of the chain region. This value should match the value specified in the MEMORY section.
      The following example shows the CONFIG section of a Config.bib file that supports BinFS:
使用下面的步骤去修改Config.bib文件中的CONFIG部分,为了能够支持the binary ROM image file system (BinFS)。Config.bib文件中的CONFIG部分一定要指定RAM_AUTOSIZE=OFF,ROM_AUTOSIZE=OFF和XIPSCHAIN value代表着chain region的开始。这个值应该和MEMORY 段指定的值相匹配。
下面的例子显示了Config.bib文件中的CONFIG部分支持BinFS:
CONFIG
   AUTOSIZE=ON
   COMPRESSION=ON
   DLLADDR_AUTOSIZE=ON
   KERNELFIXUPS=ON
   PROFILE=OFF
   RAM_AUTOSIZE=OFF
   ROMFLAGS=0
   ROMSIZE=01E00000
   ROMSTART=800B8000
   ROMWIDTH=32
   ROM_AUTOSIZE=OFF
   XIPSCHAIN=813B8000

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

Modifying the Common.bib File to Support BinFS

Windows Embedded CE 6.0 supports device drivers that run in use mode. However, if the User Mode Driver exports a PowerUp or PowerDown function and the driver code is demand-paged, a page fault error may occur. This error occurs when this type of the driver is in a BinFS partition, when this driver is in the FILEs section of the .bib file, or when this driver is in external storage instead of ROM.

To support this type of User Mode Driver in BinFS, you must modify the module attributes in the Common.bib file.
Windows Embedded CE 6.0支持设备驱动运行在用户模式。然而,如果用户模式驱动导出一个PowerUp or PowerDown函数,驱动代码要求分页的(demand-paged)。每页默认的错误可能发生。这个错误发生当这种类型的驱动是在一个BinFS分区上,当这个驱动在.bib文件的FILES部分或者当这个驱动在外部存储而不是存储在RAM中。
为了支持BinFS中的这种类型的用户模式驱动,你必须修改common.bib文件的Module的属性。
To modify the Common.bib file to support BinFS
1.Obtain a list of each module that needs to be updated.

    * Look through the registry and find all User Mode Drivers.
    * Run the dumpbin /exports command on each of the User Mode Driver DLLs.
    * From the output, determine whether the DLL exports the PowerUp and PowerDown functions.
    * If the DLL does have these exported functions, then the DLL is a module that needs to be updated in the Common.bib file.
1.获取需要更新的每个module的列表
仔细检查注册表,并且找到所有用户模式的驱动
对于每个用户模式的驱动DLLs,运行dumpbin /exports命令
从输出里,确定DLL是否导出了the PowerUp and PowerDown函数
如果DLL确实导出了这些函数,DLL在common.bib文件里是一个需要被更新的module。
2.Open the Common.bib file.
2.打开common.bib文件

3.For each module in your list, locate its entry in Common.bib and add the "M" flag to the entry. The "M" flag indicates that the module is non-pageable. For example:
对于列表中的每个module,在common.bib中定位它的入口,并且对于入口加入“M”标志。 The "M" flag 表明这个Module是非页存储的。例如:
coredll.dll $(_FLATRELEASEDIR)/coredll.dll XIPKERNEL SHM

4.Save Common.bib.
保存common.bib 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
Multi-host是一种实现高可用性的常用方法,它通过在多个服务器上分布服务实例来提高应用程序的可用性。以下是使用multi-host实现高可用性的一般步骤: 1. 安装和配置负载均衡器:将负载均衡器安装在一个单独的服务器上,以确保在多个服务器上分布的应用程序实例之间实现负载均衡。配置负载均衡器以将流量路由到可用的服务器。 2. 部署应用程序:将应用程序部署到多个服务器上,以确保在一个服务器出现故障时,其他服务器可以继续提供服务。可以使用自动化工具来部署应用程序,并确保部署在所有服务器上的应用程序实例具有相同的配置。 3. 同步应用程序状态:在多个服务器上分布的应用程序实例之间同步状态,以确保所有实例都具有相同的状态。可以使用共享存储、数据库或消息队列等技术来实现状态同步。 4. 监控和管理多个服务器:使用监控和管理工具来监控多个服务器上的应用程序实例,并自动重新启动失败的实例。还可以使用自动化工具来管理服务器配置和部署应用程序的更新。 5. 测试和验证:对多个服务器上的应用程序实例进行测试和验证,以确保它们能够正常工作,并且在一个服务器出现故障时,其他服务器可以继续提供服务。 通过以上步骤,您可以使用multi-host来实现高可用性,并提高您的应用程序的可用性和可靠性。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值