自动生成XIP映像文件的一种方法
2011年03月04日
在WINCE做MULTIBIN+XIP方式的启动映像文件时,往往需要分两步走:第一步、生成映像文件;第二步、修改ce.bib然后再romimage一次,以前的做法是手动修改极不方便,后来在网上找到了一些办法并整合到一起就能够做到一步到位。 1、做一个批处理放在BSP的Files\premake目录下供PB调用,文件内容如下:echo. echo %_TGTPLAT%-preri processing... echo. if "%IMGMULTIXIP%"=="1" cd %_TARGETPLATROOT%\Files\premake if "%IMGMULTIXIP%"=="1" copy %_FLATRELEASEDIR%\ce.bib %_TARGETPLATROOT%\Files\premake if "%IMGMULTIXIP%"=="1" copy ce.bib ce_orig.bib if "%IMGMULTIXIP%"=="1" oembibhelper multibin.txt ce_orig.bib ce.bib if "%IMGMULTIXIP%"=="1" copy ce.bib %_FLATRELEASEDIR% if "%IMGMULTIXIP%"=="1" cd %_FLATRELEASEDIR% if "%IMGMULTIXIP%"=="1" romimage ce.bib
2、oembibhelper.vbs脚本的内容如下:
' ' Copyright (c) Microsoft Corporation. All rights reserved. ' ' ' Use of this sample source code is subject to the terms of the Microsoft ' license agreement under which you licensed this sample source code. If ' you did not accept the terms of the license agreement, you are not ' authorized to use this sample source code. For the terms of the license, ' please see the license agreement between you and Microsoft or, if applicable, ' see the LICENSE.RTF on your install media or the root of your tools installation. ' THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES. ' ' Modified this bibhelper.vbs to modify the bib to implement the Multi-Bin ' For example: "nk.exe @XIPKERN" of config file will make nk.exe packed into XIPKERN.bin ' Public Function SplitEx(InputText,Delimiter) ' This function splits the sentence in InputText into ' words and returns a string array of the words. Each ' element of the array contains one word. ' This constant contains punctuation and characters ' that should be filtered from the input string. Dim strReplacedText Dim intIndex ' Replace tab characters with space characters. ' Replace tab characters with space characters. strReplacedText = Trim(Replace(InputText, vbTab, " ")) ' Loop until all consecutive space characters are ' replaced by a single space character. Do While InStr(strReplacedText, " ") strReplacedText = Replace(strReplacedText, " ", " ") Loop ' Split the sentence into an array of words and return ' the array. If a delimiter is specified, use it. 'MsgBox "String:" & strReplacedText If Len(Delimiter) = 0 Then SplitEx = Split(strReplacedText) Else SplitEx = Split(strReplacedText, Delimiter) End If End Function Private Function LoadConfigFile(Filename) Const ForReading = 1, ForWriting = 2, ForAppending = 8 Dim LCArray() LoopVal = 0 Set fs = CreateObject("Scripting.FileSystemObject") Set a = fs.OpenTextFile(Filename,ForReading,False) Do While Not a.AtEndOfStream FileLine = a.ReadLine() if Left(FileLine,1) = ";" Then 'Wscript.Echo "Skip ; for comments"' Else SubStrings = SplitEx(FileLine," ") If UBound(SubStrings) = 1 Then ReDim Preserve LCArray(LoopVal) LCArray(LoopVal) = SubStrings LoopVal = LoopVal + 1 Else 'Wscript.Echo "Skip blank lines"' End If End If Loop a.Close LoadConfigFile = LCArray End Function Private Function CalcRegionString(InString, ConfigArrayElement) CalcRegionString = InString For LoopVal = 1 To UBound(ConfigArrayElement) If Left(ConfigArrayElement(LoopVal), 1) = "@" Then CalcRegionString = Right(ConfigArrayElement(LoopVal), Len(ConfigArrayElement(LoopVal))-1) End If Next End Function Private Function FindReplaceStrings(SubStrings, ConfigArray, StringToReplace, ReplaceString) FindReplaceStrings = False LoopVal = 0 For LoopVal = 0 To UBound(ConfigArray) If SubStrings(0) = ConfigArray(LoopVal)(0) Then If UBound(SubStrings) = 2 Then TypeString = CalcRegionString("", ConfigArray(LoopVal)) StringToReplace = SubStrings(1) ReplaceString = SubStrings(2) + " " + TypeString FindReplaceStrings = True End If If UBound(SubStrings) = 3 Then TypeString = CalcRegionString(SubStrings(3), ConfigArray(LoopVal)) StringToReplace = SubStrings(2) ReplaceString = TypeString FindReplaceStrings = True End If End If Next End Function ' Main Function ' ' ' Read Program Arguments Set Args = Wscript.Arguments if Args.count 3 then Wscript.Echo "Error: Invalid Number of arguments" Wscript.Echo "" Wscript.Echo "Usage: cscript bibhelper.vbs configfile inbibfile outbibfile" Wscript.Quit End if ' Read the Configuration File to determine what modules need to be changed and how ConfigArray = LoadConfigFile(Args(0)) 'Open in and out bib files Const ForReading = 1, ForWriting = 2, ForAppending = 8 Set fs = CreateObject("Scripting.FileSystemObject") Set inbibfile = fs.OpenTextFile(Args(1),ForReading,False) Set outbibfile = fs.OpenTextFile(Args(2),ForWriting,True) ' Loop through lines in bib file Do While Not inbibfile.AtEndOfStream ' Read in current bib file line FileLine = inbibfile.ReadLine() SubStrings = SplitEx(FileLine," ") ' Determine if current in bib file line needs to be changed ChangeLine = False If UBound(SubStrings) > -1 Then ChangeLine = FindReplaceStrings(SubStrings, ConfigArray, StringToReplace, ReplaceString) ' Change in file line if necessary If ChangeLine Then ReplaceStartPos = InStr(1, FileLine, SubStrings(1), vbTextCompare) + Len(SubStrings(1)) FileLine = Left(FileLine, ReplaceStartPos-1) + Replace(FileLine, StringToReplace, ReplaceString, ReplaceStartPos) End If ' Write in file line to out bib file outbibfile.WriteLine (FileLine) Loop ' Close bib files inbibfile.Close outbibfile.Close
3、multibin.txt是需要加入XIP的文件,可根据需要修改,内容如下仅供参考
; This file is input for oembibhelper.vbs. ; It only support the pairs like "nk.exe @XIPKERN" ; Besides that, it supports blank lines and comments start with ";" as first char of the line. nk.exe @XIPKERNEL osaxst0.dll @XIPKERNEL hd.dll @XIPKERNEL coredll.dll @XIPKERNEL filesys.exe @XIPKERNEL fatfsd.dll @XIPKERNEL diskcache.dll @XIPKERNEL fatutil.dll @XIPKERNEL binfs.dll @XIPKERNEL fsdmgr.dll @XIPKERNEL mspart.dll @XIPKERNEL ;smflash.dll @XIPKERNEL bibdrv.dll @XIPKERNEL camera.dll @XIPKERNEL ;ondisk.dll @XIPKERNEL boot.hv @XIPKERNEL ;default.hv @XIPKERNEL ;user.hv @XIPKERNEL
4、在PB的"Platform"-"Settings"-"Custom Build Actions"-"Post-Make Image"加入如下规则
%_TARGETPLATROOT%\Files\premake\S80-preri.bat
发表评论
-
服务器自动重启,服务器宕机重启,自动重启weblogic,批处理自动重启服务器
2012-01-20 02:18 1078服务器自动重启,服务器 ... -
自动生成 MultiTestManager 的执行文件mtm
2012-01-20 02:18 540自动生成 MultiTestManager 的执行文件mtm ... -
批处理隐藏打开IE
2012-01-20 02:18 947批处理隐藏打开IE 2010年06月25日 bat 复 ... -
自动跳转上/下一页的脚本
2012-01-20 02:18 827自动跳转上/下一页的脚本 2010年10月19日 突然觉 ... -
中国建筑
2012-01-19 10:08 586中国建筑 2011年10月15日 北京城建筑造型的文化象 ... -
2011-2-21
2012-01-19 10:08 6212011-2-21 2011年02月21日 ... -
中国文化建筑课大纲
2012-01-19 10:08 607中国文化建筑课大纲 20 ... -
历史高考题中的文史常识整理(之四)
2012-01-19 10:08 676历史高考题中的文史常识整理(之四) 2011年06月15日 ... -
斋名集观
2012-01-19 10:08 584斋名集观 2012年01月11日 书斋溯源与称谓 ... -
ROM修改制作工具软件集合
2012-01-17 02:49 809ROM修改制作工具软件集合 2012年01月11日 1. ... -
OCI
2012-01-17 02:49 546OCI 2011年12月05日 OCI编程的一般过程 ... -
基于X的GNOME、GTK、GDK、XLib、GLib等之间的关系(转)
2012-01-17 02:49 762基于X的GNOME、GTK、GDK、XLib、GLib等之间的 ... -
Android apk 签名
2012-01-17 02:48 687Android apk 签名 2011年12 ... -
感慨啊感慨
2012-01-15 22:25 539感慨啊感慨 2011年12月07 ... -
zhan hui
2012-01-15 22:25 470zhan hui 2009年11月10日 2009第十七 ... -
从韩国去别的国家旅游签证的具体申请流程
2012-01-15 22:25 590从韩国去别的国家旅游 ...
相关推荐
WINCE系统镜像,可用dumprom提取文件,用于系统个别文件损坏后的修复
XIP.bin编辑工具 用于解压XIP.bin文件,及将更改好的文件打包成XIP.bin文件。
喜欢windows 系统的手机用户,经常遇到要移植XIP,这个工具可以帮你的忙。可以轻松移植XIP,从此让XIP移植快乐起来。
wince 的multibin网上有很多人描述过,但是大多是转载,很多人还是不是很清楚,本人经过一段时间的研究最终实现了multiple xip,现在把一些工具和源文件分享给大家,希望对大家有所帮助.如有问题可以发送email: ...
iOS 14.0 镜像包 入Xcode即可调试,路径/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport 若不行,请重启电脑
嵌入式Linux快速启动与XIP应用.pdf
基于XIP技术的ARM Linux系统的研究与移植.pdf
基于原子哥STM32H743-W25Q256例程修改的,STM32H750-W25Q40CL片外运行程序XIP
.Xcode_13_beta.xip.conf
Xcode,老版本,适合macos14
xwiki11.10.3的flavor离线包,包含这版本的全部flavor,适合离线安装flavor。
iOS 13.6 镜像包 入Xcode即可调试,路径/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport 若不行,请重启电脑
iOS 15.0 镜像包 入Xcode即可调试,路径/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport 若不行,请重启电脑
iOS 16.1 镜像包 入Xcode即可调试,路径/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport 若不行,请重启电脑
iOS 13.5 镜像包 入Xcode即可调试,路径/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport 若不行,请重启电脑
WM6.5 23071 XIP应用23070的可用!!!
iOS 14.5 镜像包 入Xcode即可调试,路径/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport 若不行,请重启电脑
xip-pdns, 支持 xip.io的PowerDNS管道后端适配器 xip-pdns这是 PowerDNS 管道后端适配器电源 xip.io的源。按照你的喜好将这里安装到你的系统,调整 etc/xip pdns,并按如下方式配置 PowerDNS:launch=pipepipe-comm
Execute-in-place for file mappings.
iOS 12.4 镜像包 入Xcode即可调试,路径/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport 若不行,请重启电脑