WINCE5.0 + 2440 启动部分
我按照mini2240的eboot先进行分区。。前面25个block是NBOOT.eboot.TOc,后面就是分区MBR,我将根据NK的大小分出那么大的BINFS的分区,后面的都是分成FAT的分区。从打印的信息来看我的分区是正确的,但是我没有去读分区表的信息来确认。下面我给出我的debug的打印信息
Windows CE Firmware Init
INFO: Initializing system interrupts...
INFO: Initializing system clock(s)...
INFO: Initializing driver globals area...
SDMMC config set rGPGCON: 82a982
OEMInit Done...
Booting Windows CE version 5.00 for (ARM)
&pTOC = 8c20a25c, pTOC = 8dedd5ac, pTOC->ulRamFree = 8e029000, MemForPT = 00000000
Old or invalid version stamp in kernel structures - starting clean!
Configuring: Primary pages: 7892, Secondary pages: 0, Filesystem pages = 1973
Booting kernel with clean memory configuration:
Memory Sections:
[0] : start: 8e02a000, extension: 00002000, length: 01ed4000
Sp=ffffc7cc
ARMInit done.
Windows CE KernelInit
Updated eptr->e32_vsize to = 000c8000
Scheduling the first thread.
0x8feff024: KernelInit2: pCurThread=8feff024 hCurThread=0feff266 hCurProc=0feff002, KernelInit = 8c24921c
0x8feff024: Detecting VFP...0x8feff024: VFP Not Found!
0x8feff024: first = 01cc0000, last = 02000000, SharedDllBase = 02510000
0x8fee5000: CertMod.dll not found, using old OEM Trust Model
0x8fee5000: FileSystem Starting - starting with clean file system
0x8fee5000: FS: initializing ROM/RAM file system
0x8fee5000: SC_CreateAPIHandle: pvData == NULL
0x8fee5000: FS: Registering file system ROM, index 2, flags 0x00000031
0x8fee5000: FS: Mount complete (ROM, index 2, flags 0x00000031)
0x8fee5000: FSVOL: Opening existing volume
0x8fee5000: FSVOL: Volume heap already initialized
0x8fee5000: FSREG: Mounted ROM portion of boot registry
0x8fee5000: FSVOL: Creating clean virtual volume
0x8fee5000: FSVOL: Initializing volume heap
0x8fee5000: FSREG: Mounted RAM portion of boot registry
0x8fee5000: FS: Creating signal event SYSTEM/DevMgrApiSetReady
0x8fee5000: FS: Creating signal event SYSTEM/PowerManagerReady
0x8fee5000: FS: Creating signal event SYSTEM/GweApiSetReady
0x8fee5000: FSREG: Unable to read value "Start DevMgr" under HKEY_LOCAL_MACHINE\init\BootVars
0x8fee5000: FILESYS: Starting storage manager.
0x8fee5000: FS: Registering file system StoreMgr, index 3, flags 0x00000001
0x8fee5000: NandFlash FMD_Init
0x8fee5000: NandFlash FMD_Init Done
0x8fee5000: FLASHDRV.DLL:BuildupMappingInfo() - Enter.
0x8fee5000: The 0th Block is BAD, data=0x0
0x8fee5000: The 1th Block is BAD, data=0x0
0x8fee5000: The 2th Block is BAD, data=0x0
0x8fee5000: The 3th Block is BAD, data=0x0
0x8fee5000: The 4th Block is BAD, data=0x0
0x8fee5000: The 5th Block is BAD, data=0x0
0x8fee5000: The 6th Block is BAD, data=0x0
0x8fee5000: The 7th Block is BAD, data=0x0
0x8fee5000: The 8th Block is BAD, data=0x0
0x8fee5000: The 9th Block is BAD, data=0x0
0x8fee5000: The 10th Block is BAD, data=0x0
0x8fee5000: The 11th Block is BAD, data=0x0
0x8fee5000: The 12th Block is BAD, data=0x0
0x8fee5000: The 13th Block is BAD, data=0x0
0x8fee5000: The 14th Block is BAD, data=0x0
0x8fee5000: The 15th Block is BAD, data=0x0
0x8fee5000: The 16th Block is BAD, data=0x0
0x8fee5000: The 17th Block is BAD, data=0x0
0x8fee5000: The 18th Block is BAD, data=0x0
0x8fee5000: The 19th Block is BAD, data=0x0
0x8fee5000: The 20th Block is BAD, data=0x0
0x8fee5000: The 21th Block is BAD, data=0x0
0x8fee5000: The 22th Block is BAD, data=0x0
0x8fee5000: The 23th Block is BAD, data=0x0
0x8fee5000: The 24th Block is BAD, data=0x0
0x8fee5000: FLASHDRV.DLL:L2P_GetPhysicalSectorAddr() - Secondary table doesn't exist for logical sector 0x0!!!
0x8fee5000: FLASHDRV.DLL:L2P_GetPhysicalSectorAddr() - Secondary table doesn't exist for logical sector 0x340!!!
0x8fee5000: FLASHDRV.DLL:L2P_GetPhysicalSectorAddr() - Secondary table doesn't exist for logical sector 0x400!!!
0x8fee5000: FLASHDRV.DLL:L2P_GetPhysicalSectorAddr() - Secondary table doesn't exist for logical sector 0x600!!!
0x8fee5000: FLASHDRV.DLL:L2P_GetPhysicalSectorAddr() - Secondary table doesn't exist for logical sector 0x800!!!
0x8fee5000: FLASHDRV.DLL:L2P_GetPhysicalSectorAddr() - Secondary table doesn't exist for logical sector 0x5400!!!
。。。。。。。。。。。。。。。。
FLASHDRV.DLL:L2P_GetPhysicalSectorAddr() - Secondary table doesn't exist for logical sector 0x8600!!!
0x8fee5000: FLASHDRV.DLL:L2P_GetPhysicalSectorAddr() - Secondary table doesn't exist for logical sector 0x8800!!!
。。。。。。。。。。。。。。。。。。。。。。
0x8fee5000: FLASHDRV.DLL:L2P_GetPhysicalSectorAddr() - Secondary table doesn't exist for logical sector 0xea00!!!
0x8fee5000: FMD::FMD_OEMIoControl = 0x71c24
0x8fee5000: Loading partition driver mspart.dll hModule=8FE83288
0x8fee5000: Driver mspart.dll loaded
0x8fee5000: FLASHDRV.DLL:ReadFromMedia() - Unable to determine physical sector address for logical sector 0x0000ea40
0x8fee5000: Opened the store hStore=000EEF60
0x8fee5000: NumSec=129952 BytesPerSec=512 FreeSec=0 BiggestCreatable=0
0x8fee5000: Partition Part00 NumSectors=59136
0x8fee5000: MSPART!PD_OpenPartition: dwStoreId=000EEF60, PartName=Part00
0x8fee5000: Partition Part01 NumSectors=69984
0x8fee5000: MSPART!PD_OpenPartition: dwStoreId=000EEF60, PartName=Part01
0x8fee5000: FSD_MountDisk: mounting volumes for hDsk=00134160
0x8fee5000: FLASHDRV.DLL:ReadFromMedia() - Unable to determine physical sector address for logical sector 0x0000ea40
0x8fee5000: FATFS!OpenVolume: access time updates disabled
0x8fee5000: FATFS!OpenVolume: event logging enabled
0x8fee5000: FATFS!OpenVolume: automatic scanning disabled
0x8fee5000: FATFS!OpenVolume: write verify disabled
0x8fee5000: FATFS!OpenVolume: extra FAT on format disabled
0x8fee5000: FATFS!OpenVolume: force write through enabled
0x8fee5000: FATFS!OpenVolume: Codepage = 1
0x8fee5000: FATFS!OpenVolume: Number of path cache entries = 50
0x8fee5000: FATFS!InitVolume: sector 0 byte 0 suspicious (0x0)
0x8fee5000: FATFS!InitVolume: invalid BPB, volume deemed invalid
0x8fee5000: FATFS!InitVolume: FAT version: 12
0x8fee5000: FATFS!InitVolume: Cluster Size (Sectors): 0
0x8fee5000: FATFS!InitVolume: TFAT enabled: FALSE
0x8fee5000: FATFS!UnmountDisk: unmounting all volumes on disk 00
0x8fee5000: FATFS!FATDetach complete (0 sectors written in 0 requests)
0x8fee5000: InitSharedHeap: 44200000 10000 c
0x8fee5000: InitSharedHeap: return 44200060
0x8fee5000: FILESYS: Restarting storage manager.
0x8fee5000: FILESYS: Starting device and waiting for boot file system.
0x8fe722e8: InitSharedHeap: 44200000 0 c
0x8fe722e8: InitSharedHeap: return 44200060
0x8fe722e8: *** DLL_PROCESS_ATTACH - Current Process: 0x42, ID: 0x8fe7254e ***
0x8fe722e8: +InitDeviceFileSystems
0x8fe722e8: FS: Registering file system $device, index 4, flags 0x00000001
0x8fe722e8: FS: Registering file system $bus, index 5, flags 0x00000001
0x8fe722e8: -InitDeviceFileSystems: status is 1
0x8fe722e8: Ceddk!CalibrateStallCounter: Enter
0x8fe722e8: Ceddk!CalibrateStallCounter: Could not find stall counter
0x8fe722e8: Ceddk!BeginCalibration: min(501) max(556)
0x8fe722e8: Ceddk!BeginCalibration: Elapsed is 548
0x8fe722e8: Ceddk!BeginCalibration: Delay is 19
0x8fee5000: FS: Waiting for device to signal BootPhase1 completion
0x8fe722e8: DEVICE!DevloadInit
0x8fe722e8: DEVICE!InitDevices: Root Key is Drivers\BuiltIn.
0x8fe722e8: DEVICE!RegReadActivationValues RegQueryValueEx(Drivers\BuiltIn\Prefix) returned 2
0x8fe722e8: DEVICE!RegReadActivationValues RegQueryValueEx(Drivers\BuiltIn\BusPrefix) returned 2
0x8fee5000: FILESYS: Starting device and waiting for boot file system.
从打印信息上看这几句话似乎很给了我信息
0x8fee5000: FLASHDRV.DLL:L2P_GetPhysicalSectorAddr() - Secondary table doesn't exist for logical sector
1.这句话说Secondary table是什么意思?
0x8fee5000: FLASHDRV.DLL:ReadFromMedia() - Unable to determine physical sector address for logical sector 0x0000ea40
2.ReadFromMedia这个函数是FAL里面的函数吧,CE5里面看不到,这句话说不能把logic sector转换成真实的物理地址。难道是我的分区表中的逻辑起始地址不正确???但是从分区打印信息上看是正确的啊。。。分明在加载完分区驱动后能很好的读出两个part中的信息。还是正确的。
3.从我从这句话猜测0x8fee5000: FATFS!InitVolume: Cluster Size (Sectors): 0肯定是BINFS没有mount上去的原因。
Walle 发表于 2009-8-30 19:26
1.这句话说Secondary table是什么意思?
0x8fee5000: FLASHDRV.DLL:ReadFromMedia() - Unable to determine physical sector address for logical sector 0x0000ea40
[b]【Walle】你用的是微软默认的nand驱动,它使用nand每个page后面得sparepage来保存物理page和逻辑page的映射关系。如果你的eboot(或其他bootloader)没有在烧image的时候写spare page的这部分映射数据,wince在启动的时候需要读取binfs部分数据的时候调用nand驱动去试图得到逻辑扇区0所对应的物理page的时候,会得不到映射表而失败。[/b]
2.ReadFromMedia这个函数是FAL里面的函数吧,CE5里面看不到,这句话说不能把logic sector转换成真实的物理地址。难道是我的分区表中的逻辑起始地址不正确???但是从分区打印信息上看是正确的啊。。。分明在加载完分区驱动后能很好的读出两个part中的信息。还是正确的。
[b]【walle】FAL在ce5是没有opensource的,你有兴趣可以看ce6的private,有source哦![/b]
3.从我从这句话猜测0x8fee5000: FATFS!InitVolume: Cluster Size (Sectors): 0肯定是BINFS没有mount上去的原因。
[b]【walle】cluster size之类的数据保存在DBR扇区里面,根据上面的分析,你的nand驱动无法知道逻辑扇区的数据藏在哪里,所以不可能得到。[/b]
unsway 发表于 2009-9-8 12:30
【Walle】你用的是微软默认的nand驱动,它使用nand每个page后面得sparepage来保存物理page和逻辑page的映射关系。如果你的eboot(或其他bootloader)没有在烧image的时候写spare page的这部分映射数据,wince在启动的时候需要读取binfs部分数据的时候调用nand驱动去试图得到逻辑扇区0所对应的物理page的时候,会得不到映射表而失败。
你所说的sparepage 里面的物理页和逻辑页的映射关系是不是通过标记坏块来实现的。如果不是,想听你解释下映射是怎么做的,因为sparepage里面就有一些标记位和ecc.如果是的话。你的意思是我在bootloader中对块的标记错了。。。。
非常谢谢你的回答,也希望你能继续关注。。
pipi0714 发表于 2009-9-16 09:28
看看
Walle 发表于 2009-9-16 22:13
[quote]【Walle】你用的是微软默认的nand驱动,它使用nand每个page后面得sparepage来保存物理page和逻辑page的映射关系。如果你的eboot(或其他bootloader)没有在烧image的时候写spare page的这部分映射数据,wince在启动 ...
[size=2][color=#999999]unsway 发表于 2009-9-8 12:30[/color] [url=http://www.armce.cn/bbs/redirect.php?goto=findpost&pid=5073&ptid=481][img]http://www.armce.cn/bbs/images/common/back.gif[/img][/url][/size][/quote]
eboot在写image到nand的时候,可以在写main area的data的同时,把逻辑page写入到该page的spare area。
告诉你个方法,你可以改nand的驱动,让它故意返回顺序的逻辑page号(如果没有坏块,物理page往往和逻辑page是线性对应,只是开始号码不同,比如物理page 0x1000对应逻辑page 0x0,那么相应的0x2000 = 0x1000)
unsway 发表于 2009-9-23 14:05
spare area不就那么几个字节吗?你的意思就是直接去读spare area的那些字节。。然后再来分析。。。最近忙着弄摄像头,,已经很长时间没有关注过这个事情了
Walle 发表于 2009-9-25 15:33
每个物理page里面的spare区域保存一个dword的逻辑page号码就可以了。