阅读:35611回复:134
[原创]Windows CE 5.0 mult-xip bin模式实现 (已完全开放)
Windows CE 5.0 mult-xip bin模式实现
XIP是什么,微软说: Execute-in-place (XIP) regions are areas where an application can execute code directly from ROM rather than loading it from RAM. Windows CE allows you to construct multiple XIP regions in a single system. There are several reasons for using multiple XIP regions instead of a single region: • You can break applications into functional subsets and install them separately from the core of the operating system (OS). • You do not need to replace the whole run-time image to add new features. • You do not need to replace the whole run-time image to fix a bug. • The user can update the run-time image. • Updates to the run-time images are permanent and not vulnerable to cold resets. The growing popularity of flash memory as a replacement for masked ROM is one of the technologies that enables multiple XIP regions. In the Help topics that discuss multiple XIP regions, ROM refers to the flash memory where the system image resides. Multiple XIP regions divide the ROM image into discrete, upgradeable units. As you decide how to divide the XIP image, consider the owner of the modules and files in the region and the functionality of the modules and files in that region. Note XIP cannot span across physically discontiguous regions. Although virtually contiguous, some devices can hang when executed in place on code across physical regions. Also, uncompressed FILE and MODULE across regions can be direct mapped or accessed directly without copying, but the kernel only handles the case where the file is physically contiguous. 不懂英语的兄弟,吃亏了吧,赶紧对照看吧。 其实,XIP BIN也不是很新鲜的技术,在很多OS里都有用到。比如LINUX下,很多高手早就掌握了。在Windows CE下也有不少人在使用,大多都依赖于Nor Flash,因为前期都是才用Nor Flash来做BOOT的嘛。直到最近,大家开始慢慢摒弃Nor Flash,开始精简硬件,降低成本,越来越多的方案都才用Nand Flash来做为BOOT。由此的转变,使得XIP要使用在Nand Flash上有了一定的不可能。 从某种角度来说是不可能,但是咱们程序员讲的就是化腐朽为神奇,把不可能变成可能。所以越来越多的同志来投身XIP的研究中。其中高手当然是云集拉。比如: zhengshijie,harktrip,simula,wenzai,oxox等等高手,在论坛里积极发表个人建议,对我们这些后来的兄弟积极解答,真的帮助很大。 现在大概讲讲我的实现办法。 先给出我的实现效果图:(注:我的内存大小是64M) 图一 图二 图三 看了流口水了吧,那赶紧来跟我一起做。 第一、 搭建工程。该选的组件一个也别落下。 第二、 添加HIVE支持,这个部分可以参考: http://www.armsystem.com.cn/article/ARM9-article/example/20061232117590.html (wenzai友情提供链接) 第三、 在setting里 设置环境变量中,加上IMGMULTIBIN = 1,这个是对XIP BIN的支持,一定要加上。 第四、 对config.bib文件进行修改: 大体设置如下: MEMORY pdwXIPLoc 00000000 803FF000 FIXUPVAR XIPKERNEL 80200000 001FF000 RAMIMAGE CHAIN 803FF000 00001000 RESERVED NK 80400000 01E00000 NANDIMAGE RAM 80400000 07C00000 RAM FLASH 92000000 00100000 RESERVED 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=803FF000 (感谢simula 提供参数配置) 第五、 对XIPKERNEL进行规划,将最小化系统内核打包到其中。 系统必须加载组件为: MODULES ; Name Path Memory Type ; -------------- --------------------------------------------- ----------- nk.exe D:\WINCE500\PBWorkspaces\SMDK2440\RelDir\SMDK2440_ARMV4I_Release\kern.exe XIPKERNEL SH coredll.dll D:\WINCE500\PBWorkspaces\SMDK2440\RelDir\SMDK2440_ARMV4I_Release\coredll.dll XIPKERNEL SH filesys.exe D:\WINCE500\PBWorkspaces\SMDK2440\RelDir\SMDK2440_ARMV4I_Release\filesys.exe XIPKERNEL SH fatfsd.dll D:\WINCE500\PBWorkspaces\SMDK2440\RelDir\SMDK2440_ARMV4I_Release\fatfsd.dll XIPKERNEL SH diskcache.dll D:\WINCE500\PBWorkspaces\SMDK2440\RelDir\SMDK2440_ARMV4I_Release\diskcache.dll XIPKERNEL SH fatutil.dll D:\WINCE500\PBWorkspaces\SMDK2440\RelDir\SMDK2440_ARMV4I_Release\fatutil.dll XIPKERNEL SH binfs.dll D:\WINCE500\PBWorkspaces\SMDK2440\RelDir\SMDK2440_ARMV4I_Release\binfs.dll XIPKERNEL SH fsdmgr.dll D:\WINCE500\PBWorkspaces\SMDK2440\RelDir\SMDK2440_ARMV4I_Release\fsdmgr.dll XIPKERNEL SH mspart.dll D:\WINCE500\PBWorkspaces\SMDK2440\RelDir\SMDK2440_ARMV4I_Release\mspart.dll XIPKERNEL SH ceddk.dll D:\WINCE500\PBWorkspaces\SMDK2440\RelDir\SMDK2440_ARMV4I_Release\ceddk.dll XIPKERNEL SH smflash.dll D:\WINCE500\PBWorkspaces\SMDK2440\RelDir\SMDK2440_ARMV4I_Release\smflash.dll XIPKERNEL SH FILES boot.hv D:\WINCE500\PBWorkspaces\SMDK2440\RelDir\SMDK2440_ARMV4I_Release\boot.hv XIPKERNEL SH default.hv D:\WINCE500\PBWorkspaces\SMDK2440\RelDir\SMDK2440_ARMV4I_Release\default.hv XIPKERNEL SH user.hv D:\WINCE500\PBWorkspaces\SMDK2440\RelDir\SMDK2440_ARMV4I_Release\user.hv XIPKERNEL SH (感谢zhengshijie提供XIPKERNEL资料) 第六、 设置完这些后,剩下的工作就是在platform.reg中添加一个BINFS的分区了。我的设置为: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Support BINFS Section ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Add BinFS to partition table [HKEY_LOCAL_MACHINE\System\StorageManager\PartitionTable] "21"="BINFS" [HKEY_LOCAL_MACHINE\System\StorageManager\BINFS] "Folder"="BINFS" "FriendlyName"="Bin FileSystem" "Dll"="binfs.dll" ; MountFlags: ; 0x10 specifies that this file system is to be mounted as an external ; ROM filesystem shadowing the \windows directory ; 0x1 specifies that the mountpoint \BINFS is to be hidden ; "MountFlags"=dword:10 "BootPhase"=dword:0 记住,此注册信息必须包含在 ; HIVE BOOT SECTION ; END HIVE BOOT SECTION 中,这样才能讲BINFS的信息打包到boot.hv中,不然,那你的XIP实现就比较郁闷了。(本人因此郁闷了3天,比较菜) 大概设置完毕,大家可以开始XIP之旅了。 以下是大虾对此补充, zhengshijie: 我也总结了一下,对比一下看看. 第三、 在setting里 设置环境变量中,加上IMGMULTIBIN = 1,这个是对XIP BIN的支持,一定要加上。 这一步可以不要了,你是受帮助文档的影响,那是因为它是针对CEPC的配置来说的,因为CEPC的配置里config.bib有判断这个量. 对于我们的config.bib根本不作这个判断,所以就不需要了.生不生成XIP.BIN是看你的MEMORY是否有一个以上的IMAGE,CHAIN的声明. 关于BIB文件中的MEMORY部分的定义可以从帮助文档中找到答案,搜索MEMORY Section Name Address Size Type 内存区域名字 起始地址 区域空间 内存类型 内存类型的取值分别有FIXUPVAR,NANDIMAGE,RAM,RAMIMAGE,RESERVED. 大家可以特别注意看一下NANDIMAGE的解释 Specifies that RAM should overlap these regions when building an run-time image that uses BINFS. The overlapping regions are stored in NAND but are fixed up to virtually appear as though they do not overlap. When the kernel accesses these regions, BINFS responds by intercepting the request. BINFS accesses NAND and returns the proper data to the kernel. This enables a device with NAND to execute in place out of NAND, freeing up RAM for use by the system. Romimage generates one binary (.bin) file for each NANDIMAGE entry. NANDIMAGE sections must be page aligned. zhengshijie: 还有一点实践表明内核子集最小文件包含还可以再去掉3个,实践得知之前强调的必须调用InitRomChain()实际上是可以去掉的,不用在OEMIinit()里调用这个函数了. 下面这些文件是必需的: "nk.exe", "coredll.dll", "filesys.exe", "fatfsd.dll", "diskcache.dll", "fatutil.dll", "binfs.dll", "fsdmgr.dll", "mspart.dll", "smflash.dll", "boot.hv", |
|
沙发#
发布于:2010-12-23 16:36
Re:[原创]Windows CE 5.0 mult-xip bin模式实现 (已完全开放)
太好看了。 |
|
板凳#
发布于:2010-10-10 09:45
Re:[原创]Windows CE 5.0 mult-xip bin模式实现 (已完全开放)
三年以后再来看,价值依旧 |
|
地板#
发布于:2010-10-10 01:02
Re:[原创]Windows CE 5.0 mult-xip bin模式实现 (已完全开放)
马甲,细细研究看看 |
|
地下室#
发布于:2010-08-09 22:49
Re:[原创]Windows CE 5.0 mult-xip bin模式实现 (已完全开放)
XIP只是讓你開機快一點(<5sec) |
|
5楼#
发布于:2010-04-14 10:55
Re:[原创]Windows CE 5.0 mult-xip bin模式实现 (已完全开放)
先膜拜在学习! |
|
|
6楼#
发布于:2010-03-31 20:08
Re:[原创]Windows CE 5.0 mult-xip bin模式实现 (已完全开放)
牛,学习 |
|
7楼#
发布于:2010-03-25 11:04
Re:[原创]Windows CE 5.0 mult-xip bin模式实现 (已完全开放)
赞一个,非常有用的说,过几天动手试一下 |
|
8楼#
发布于:2010-02-12 17:20
Re:[原创]Windows CE 5.0 mult-xip bin模式实现 (已完全开放)
顶个先顶个先 |
|
9楼#
发布于:2009-12-24 20:30
Re:[原创]Windows CE 5.0 mult-xip bin模式实现 (已完全开放)
没懂 |
|
10楼#
发布于:2009-09-14 14:51
Re:[原创]Windows CE 5.0 mult-xip bin模式实现 (已完全开放)
顶了再说!!!! |
|
11楼#
发布于:2009-08-07 17:14
Re:[原创]Windows CE 5.0 mult-xip bin模式实现 (已完全开放)
mark |
|
12楼#
发布于:2009-07-16 18:00
我现在的问题和120楼的兄弟差不多,每次都是在这个地方挂了:
+OEMInit oal-init.c DCache: 8 sets, 64 ways, 32 line size, 16384 size ICache: 8 sets, 64 ways, 32 line size, 16384 size +OALInterruptInit -OALInterruptInit(rc = 1) +OALTimerInit( 1, 12, 0 ) +OALIntrEnableIrqs(count=1, pIrqs=0x81e2ef00) Irqs=14, ConfigureGPIO Done oal-init.c InitDisplay InitDisplay Done oal-init.c -OEMInit oal-init.c Sp=ffffc7cc OEMIoControl: Unsupported Code 0x10100b4 - device 0x0101 func 45 OEMIoControl: Unsupported Code 0x101008c - device 0x0101 func 35 FMD::FMD_Init - pBSPArgs->nfsblk = 0x0 FMD::FMD_Init - READ_REGISTER_BYTE(pNFSBLK) = 0x0 FMD::FMD_Init IPL ..... FMD::FMD_Init Done MID = 0xec, DID = 0xa1 4th Cycle : 0x0 NUMBLOCKS : 1024(0x400), SECTORSPERBLOCK = 256(0x100), BYTESPERSECTOR = 512(0x200) FMD_OEMIoControl: unrecognized IOCTL (0x71c24). OEMIoControl: Unsupported Code 0x1010104 - device 0x0101 func 65 OEM: Not Cleaning system hive OEM: Not Cleaning user profiles 折腾死了,高手帮忙啊!!!! |
|
13楼#
发布于:2009-05-27 17:49
回 19楼(zouyingmyfriend) 的帖子
我的XIP也是速度没有提高。和原先使用NK时一样。看了7页的贴子。不知道怎么办了。好心人,帮帮忙啊。QQ276779561,MSN:11290829@msn.cn |
|
14楼#
发布于:2009-05-18 20:47
难道一定要回复,才可以看的到LZ的贴图么?
|
|
15楼#
发布于:2009-05-03 16:31
Re:[原创]Windows CE 5.0 mult-xip bin模式实现 (已完全开放)
我的修改跑到最后卡住了,不知道什么问题?请大家诊断下,谢谢DCache: 8 sets, 64 ways, 32 line size, 16384 size ICache: 8 sets, 64 ways, 32 line size, 16384 size Sp=ffffc7cc OEMIoControl: Unsupported Code 0x10100b4 - device 0x0101 func 45 OEMIoControl: Unsupported Code 0x101008c - device 0x0101 func 35 FMD::FMD_Init FMD::FMD_Init - pBSPArgs->nfsblk = 0x0 FMD::FMD_Init - READ_REGISTER_BYTE(pNFSBLK) = 0x0 FMD::FMD_Init IPL ..... FMD::FMD_Init Done MID = 0xec, DID = 0x76 4th Cycle : 0x5a NUMBLOCKS : 512(0x200), SECTORSPERBLOCK = 256(0x100), BYTESPERSECTOR = 512(0x200) FMD_OEMIoControl: unrecognized IOCTL (0x71c24). OEMIoControl: Unsupported Code 0x1010104 - device 0x0101 func 65 OEMIoControl: Unsupported Code 0x1010118 - device 0x0101 func 70 OEMIoControl: Unsupported Code 0x10100c4 - device 0x0101 func 49 OEMIoControl: Unsupported Code 0x10100c4 - device 0x0101 func 49 |
|
16楼#
发布于:2009-04-24 22:20
Re:[原创]Windows CE 5.0 mult-xip bin模式实现 (已完全开放)
各位,我的问题是indows CE Kernel for ARM (Thumb Enabled) Built on Feb 8 2007 at 23:36:51 ProcessorType=0920 Revision=0 sp_abt=ffff5000 sp_irq=ffff2800 sp_undef=ffffc800 OEMAddressTable = 8022bfcc DCache: 8 sets, 64 ways, 32 line size, 16384 size ICache: 8 sets, 64 ways, 32 line size, 16384 size MPLLCON: 0x00061012 CLKCON: 0x00fffff0 -OEMInit Sp=ffffc7cc 卡到这里不走了 请问是什么原因引起呢? |
|
17楼#
发布于:2009-03-10 11:29
Re:[原创]Windows CE 5.0 mult-xip bin模式实现 (已完全开放)
不好意思, 請問幾個問題, 如有專人能幫忙解決此問題, 小弟願意支付相關費用CPU:S3C3440-400MHz SDRAM: 64M BYTES FLASH: 64M BYTES OS: WINCE 5.0 原先使用 RAMIMAGE 產生 EBOOT.NB0 NK.NB0, 這部分使用都沒問題 照各位先進的說明產生出 EBOOT.NB0 CHAIN.LST CHAIN.BIN KERNEL.BIN NBOOT.BIN XIP.BIN 等相關 FILES. 但由於我的 EBOOT 已經更改過, 所以只能讀取 NB0 的 FILE 寫入到 FLASH. 問題一: 是否需要將所有 .BIN 轉成 .NB0 ? 問題二: 要將這些 NB0 寫入到 FLASH 那些地方? 或是將原使的 BIN 寫入到 FLASH 那些地方? 問題三: FLASH 未使用空間需要作什麼處理讓 KERNEL 知道 XIP.BIN 在FLASH 什麼位址可以讀出來使用? 煩請諸位先進幫忙解決, 或是跟小弟連絡, 小弟的E-MAIL是:chayoung.tw@yahoo.com.tw |
|
18楼#
发布于:2008-12-16 17:22
好人啊,太需要你这样的人才!
|
|
19楼#
发布于:2008-12-02 13:21
Re:[原创]Windows CE 5.0 mult-xip bin模式实现 (已完全开放)
harktrip, 真是好人啊。 |
|
上一页
下一页