阅读:6912回复:10
开贴探讨WINCE6.0 XIP模式的实现
WINCE5.0的XIP模式,很早就实现了,最近在想WINCE6.0上实现XIP,但是结果失败.不知道有没有前辈大虾已经实现的.
WINCE6.0架构和WINCE5.0有很大区别,原来的5.0的NK.EXE已经被分成几个小块了,OAL.EXE,KERBEL.DLL等等,另外用户模式下一些对底层硬件操作也有所限制,例如VirtualAlloc等函数就不能支持操作,另外在5.0下经常应用的KernelIoControl,自定义IOCTL操作也不好用了,IOCTL已经成为一个单独的OALIOCTL.DLL并且只支持 switch (dwIoControlCode) { case IOCTL_HAL_GET_CACHE_INFO: case IOCTL_HAL_GET_DEVICE_INFO: case IOCTL_HAL_GET_DEVICEID: case IOCTL_HAL_GET_UUID: case IOCTL_PROCESSOR_INFORMATION: // request is to service the ioctl - forward the call to OAL code // OAL code will set the last error if there is a failure fRet = (*g_pfnExtOALIoctl)(dwIoControlCode, pInBuf, nInBufSize, pOutBuf, nOutBufSize, pBytesReturned); break; default: SetLastError(ERROR_NOT_SUPPORTED); break; } 不管那些,按照原来5.0的经验支持修改让它支持XIP 1: config.bib #define CHAIN_ADDRESS 804FF000 #define CHAIN_LENGTH 00001000 ;----------------------------------------------------- ; NAME ADDRESS SIZE TYPE ;----------------------------------------------------- XIPKERNEL 80200000 002FF000 RAMIMAGE CHAIN $(CHAIN_ADDRESS) $(CHAIN_LENGTH) RESERVED NK 80500000 01800000 NANDIMAGE RAM 80500000 3618000 RAM FLASH 92000000 00100000 RESERVED nk.exe:pdwXIPLoc 00000000 $(CHAIN_ADDRESS) FIXUPVAR ENDIF ; Common RAM areas PTS 80000000 00020000 RESERVED ARGS 80020000 00000800 RESERVED SLEEP 80020800 00002000 RESERVED EFSBUF 80070000 00010000 RESERVED SMART_CARD 800A1000 00002000 RESERVED nk.exe:dwOEMDrWatsonSize 00000000 0x4B000 FIXUPVAR ;#define PAGINGPOOLSIZE 00500000 ; nk.exe:cbNKPagingPoolSize 00000000 $(PAGINGPOOLSIZE) FIXUPVAR CONFIG FSRAMPERCENT=0x0A0A0A0A COMPRESSION=ON KERNELFIXUPS=ON AUTOSIZE=ON RAM_AUTOSIZE=OFF ROM_AUTOSIZE=OFF DLLADDR_AUTOSIZE=ON XIPSCHAIN=$(CHAIN_ADDRESS) AUTOSIZE_ROMGAP=10000 AUTOSIZE_DLLADDRGAP=0 AUTOSIZE_DLLDATAADDRGAP=0 AUTOSIZE_DLLCODEADDRGAP=0 ROMFLAGS=0 IF IMGPROFILER PROFILE=ON ELSE PROFILE=OFF ENDIF 2: 修改注册表 ; @CESYSGEN ENDIF CE_MODULES_DEVICE ; @CESYSGEN IF FILESYS_FSREGHIVE ; HIVE BOOT SECTION [HKEY_LOCAL_MACHINE\init\BootVars] "SYSTEMHIVE"="system.hv" "PROFILEDIR"="Documents and Settings" "RegistryFlags"=dword:1 "Flags"=dword:3 "DefaultUser"="default" "Start DevMgr"=dword:1 ; END HIVE BOOT SECTION ; @CESYSGEN ENDIF FILESYS_FSREGHIVE ; HIVE BOOT SECTION IF BSP_NONANDFS ! [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\NANDFLASH] "Prefix"="DSK" "Dll"="nandflash.dll" "Index"=dword:1 "Order"=dword:0 "Profile"="NANDFLASH" "BootPhase"=dword:0 "MountFlags"=dword:11 "Flags"=dword:1000 ;for Hive-based registry "IClass"="{A4E7EDDA-E575-4252-9D6B-4195D48BB865}" [HKEY_LOCAL_MACHINE\System\StorageManager\AutoLoad\NANDFLASH] "DriverPath"="Drivers\\BuiltIn\\NANDFLASH" ; LoadFlags 0x01 == load synchronously "LoadFlags"=dword:1 "BootPhase"=dword:0 "MountFlags"=dword:11 "Flags"=dword:1000 "MountAsBootable"=dword:1 ; for Hive-based registry [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\NANDFLASH] "DefaultFileSystem"="BINFS" "AutoPart"=dword:1 "AutoMount"=dword:1 "PartitionDriver"="mspart.dll" "Name"="Microsoft Flash Disk" "Folder"="ResidentFlash" "BootPhase"=dword:0 "MountFlags"=dword:11 "Flags"=dword:1000 [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\NANDFLASH\BINFS] "MountHidden"=dword:1 "MountAsROM"=dword:1 ; Keep FATFS from trying to shadow \Windows [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\NANDFLASH\FATFS] "FormatExfat"=dword:1 "Flags"=dword:14 ; deprecated in CE6.0 (0x4 : FATFS_DISABLE_AUTOSCAN, 0x10 : FATFS_ENABLE_BACKUP_FAT) "DisableAutoScan"=dword:1 "CheckForFormat"=dword:1 "EnableWriteBack"=dword:1 "Folder"="NandFlash" "MountAsRoot"=dword:1 ; for ROM-only file system "MountAsBootable"=dword:1 ; for Hive-based registry [HKEY_LOCAL_MACHINE\System\StorageManager\AutoLoad\NANDFLASH\Filters\CacheFilt] "Dll"="cachefilt.dll" "LockIOBuffers"=dword:1 [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\NANDFLASH\FATFS\Filters\CacheFilt] "Dll"="cachefilt.dll" "LockIOBuffers"=dword:1 ENDIF ; BSP_NONANDFS ; END HIVE BOOT SECTION 在6.0下有cachefilt.dll但是还没有具体研究这个有撒用处 3: 修改WINCE特性,加入BINFS TFAT STOAREMANAGER 等,使用HIVE注册表,使用ROM ONLY文件系统 4: 修改CE.BIB让下面为XIPKERNEL包含 nk.exe kernel.dll hd.dll kd.dll osaxsto.dll osaxstl.dll coredll.dll oalioctl.dll k.coredll.dll filesys.dll romfsd.dll exfat.dll diskcache.dll cachefilt.dll fatutil.dll relfsd.dll binfs.dll imgfs.dll rawfs.dll romfilter.dll fsdmgr.dll fsdacl.dll mspart.dll ceddk.dll boot.hv initdb.ini 5:编译正常,正确生存XIPKERNEL.BIB NK.BIN CHAIN.BIN XIP.BIN 和 CHAIN.LST文件 支持将XIPKERNEL.NB0下载到XIPKERNEL区域,运行,下面为结果: FSDMGR!DllMain: DLL_PROCESS_ATTACH FSDMGR!STOREMGR_Initialize FSDMGR!InitializeStoreAPI FSDMGR!MountTable_t::RegisterVolumeName: Registered "StoreMgr" at index 2FSDMGR!MountTable_t::RegisterVolume: Registered volume at index 2 (Name="StoreMgr", MountFlags=0x1)FSDMGR!InitializeROMFileSystem: File System=ROM FSDMGR!MountTable_t::RegisterVolumeName: Registered "ROM" at index 3FSDMGR!MountTable_t::RegisterVolume: Registered volume at index 3 (Name="ROM", MountFlags=0x71)FSDMGR!STOREMGR_StartBootPhase BootPhase=0 (PrevBootPhase=-1) FSDMGR: File security disabled. FSDMGR!AutoLoadFileSystems: CurrentBootPhase=0, LoadFlags=1 FSDMGR!AutoLoadFileSystem: CurrentBootPhase=0, RootKey=System\StorageManager\AutoLoad, FileSystem_t=NANDFLASH FSDMGR!AutoLoadBlockDevice: Auto-loading block driver from "Drivers\BuiltIn\NANDFLASH"FSDMGR!MountStore: Failed opening new store "NANDFLASH"; error=4319 FSDMGR!StoreDisk_t::~StoreDisk_t: deleting store (D00251C0)FSDMGR!AutoLoadFileSystems: UnabFSDMGR!PNPThread: Using PNPUnloadDelay of 4096 FSDMGR!PNPThread: PNPThread starting! le to auto-load HKLM\System\StorageManager\AutoLoad\NANDFLASH; error=4319Exception 'Data Abort' (4): Thread-Id=005c0002(pth=83b0e264), Proc-Id=00400002(pprc=80508308) 'NK.EXE', VM-active=00400002(pprc=80508308) 'NK.EXE' PC=c004bc90(k.coredll.dll+0x0002bc90) RA=c0060668(k.coredll.dll+0x00040668) SP=d009f620, BVA=00000000 OEM: Not cleaning user profiles Exception 'Data Abort' (4): Thread-Id=005c0002(pth=83b0e264), Proc-Id=00400002(pprc=80508308) 'NK.EXE', VM-active=00400002(pprc=80508308) 'NK.EXE' PC=c004bc90(k.coredll.dll+0x0002bc90) RA=c0060668(k.coredll.dll+0x00040668) SP=d009fb04, BVA=00000000 不能正常初始化NANDFLASH..... 6: 修改CE.BIB 加入WINCE.NLS到XIPKERNEL,这个文件在5.0下我是没有包含进去的,后不出现'Data Abort 结果: FSDMGR!DllMain: DLL_PROCESS_ATTACH FSDMGR!STOREMGR_Initialize FSDMGR!InitializeStoreAPI FSDMGR!MountTable_t::RegisterVolumeName: Registered "StoreMgr" at index 2FSDMGR!MountTable_t::RegisterVolume: Registered volume at index 2 (Name="StoreMgr", MountFlags=0x1)FSDMGR!InitializeROMFileSystem: File System=ROM FSDMGR!MountTable_t::RegisterVolumeName: Registered "ROM" at index 3FSDMGR!MountTable_t::RegisterVolume: Registered volume at index 3 (Name="ROM", MountFlags=0x71)FSDMGR!STOREMGR_StartBootPhase BootPhase=0 (PrevBootPhase=-1) FSDMGR: File security disabled. FSDMGR!AutoLoadFileSystems: CurrentBootPhase=0, LoadFlags=1 FSDMGR!AutoLoadFileSystem: CurrentBootPhase=0, RootKey=System\StorageManager\AutoLoad, FileSystem_t=NANDFLASH FSDMGR!AutoLoadBlockDevice: Auto-loading block driver from "Drivers\BuiltIn\NANDFLASH"FSDMGR!MountStore: Failed opening new store "NANDFLASH"; error=4319 FSDMGR!StoreDisk_t::~StoreDisk_t: deleting store (D00251C0)FSDMGR!AutoLoadFileSystems: Unable to auto-load HKLM\System\StorageManager\AutoLoad\NANDFLFSDMGR!PNPThread: Using PNPUnloadDelay of 4096 FSDMGR!PNPThread: PNPThread starting! ASH; error=4319FSDMGR!STOREMGR_StartBootPhase BootPhase=1 (PrevBootPhase=0) FSDMGR!AutoLoadFileSystems: CurrentBootPhase=1, LoadFlags=1 OEM: Not cleaning user profiles FSDMGR!STOREMGR_StartBootPhase BootPhase=2 (PrevBootPhase=1) FSDMGR!AutoLoadFileSystems: CurrentBootPhase=2, LoadFlags=1 FSDMGR!AutoLoadFileSystems: CurrentBootPhase=2, LoadFlags=2 NANDFLASH还是不能正常初始化. |
|
沙发#
发布于:2009-04-10 16:45
我QQ22961300,我也在试验 有空商量商量。
|
|
板凳#
发布于:2009-04-28 14:30
我也在研究中,关注
|
|
|
地板#
发布于:2009-05-12 17:03
NK的地址不能和RAM重合,我实验了一下,如果重合,就会发生data abort错误!
|
|
地下室#
发布于:2009-06-03 15:07
关注
|
|
5楼#
发布于:2009-06-09 09:56
楼主不用将fpcrt.dll和k.fpcrt.dll打包进XIPKERNEL吗?
我启动时出现ERROR: function @ Ordinal 2029 missing 在k.coredll.def找到: __ltd=FPCRT.#981 @2029 PRIVATE 现在可以进入系统了。内存显示为60128KB RAM 图片:xip.jpg |
|
6楼#
发布于:2009-06-10 21:33
5楼的达人,可不可以具体介绍一下,或者留个联系方式?
|
|
7楼#
发布于:2009-06-10 21:36
楼主,请问你是将生成的哪个文件下载到nandflash去?xip.bin?chain.lst?
|
|
8楼#
发布于:2010-04-14 10:31
LZ现在实现了嘛?
最近我也在做,希望能得到你的指点一二! |
|
|
9楼#
发布于:2010-10-10 16:54
不知道大家结果如何,最近也在搞
|
|
10楼#
发布于:2010-12-12 16:56
搞了一下,S3C2440的wince6的XIP系统系统不启动:
CONFIG.bib 配置如下: 1. #define NK_START 80300000 2. 3. NK $(NK_START) 01F00000 RAMIMAGE 4. RAM 82000000 01E00000 RAM 5. ENDIF 6. 7. #define NK_START 80300000 8. #define CHAIN_ADDR 80590000 9. 10. XIPNK $(NK_START) 00290000 RAMIMAGE 11. CHAIN $(CHAIN_ADDR) 00001000 RESERVED 12. NK 80591000 01E00000 NANDIMAGE ;22MByte; Another 2Mbytes for XIPNK.bin 13. RAM 80591000 03A6F000 RAM 14. 15. FLASH 92000000 00100000 RESERVED 16. pdwXIPLoc 00000000 $(CHAIN_ADDR) FIXUPVAR 打包到XIPNK.bin 的文件有: nk.exe kernel.dll hd.dll kd.dll osaxsto.dll osaxstl.dl coredll.dll oalioctl.dll k.coredll.dll filesys.dll romfsd.dll exfat.dll diskcache.dll cachefilt.dll fatutil.dll relfsd.dll binfs.dll imgfs.dll rawfs.dll romfilter.dll fsdmgr.dl fsdacl.dll mspart.dll ceddk.dll initdb.ini fpcrt.dll k.fpcrt.dll device.dll udevice.exe devmgr.dll smflash.dll pm.dll busenum.dll regenum.dll smflash.dll boot.hv wince.nls 结果WINCE6系统不启动(不开启XIP的时候可以正常启动),问一下楼主,ce5的eboot移植到ce6需要还改什么? |
|
|