Bootloader中的哪个函数将NK.bin解压成NK.nb0 网上看见很多人说NK.bin和NK.nb0都可下载到RAM中,如果下载到RAM的是NK.bin文件因为是压缩的,需要先通过BootLoader进行先解压才能往NAND Flash中烧写。
我用的平台是PXA270+Wince6.0 ,板子的Eboot就是通过以太网下载NK.bin映像到板子上内存,再写入FLASH的,但是就是不知道Bootloader中的那个函数将NK.bin解压成NK.nb0
解压缩的代码在PUBLIC\COMMON\OAK\DRIVERS\ETHDBG\BLCOMMON\blcommon.c中的函数
下面是我的DownloadImage函数 static BOOL DownloadImage (LPDWORD pdwImageStart, LPDWORD pdwImageLength, LPDWORD pdwLaunchAddr) { BOOL rval = TRUE; DWORD dwImageType;
*pdwImageStart = *pdwImageLength = *pdwLaunchAddr = 0; KITLOutputDebugString ("\r\nUnable to read image signature.\r\n");
// // Download each region (multiple can be sent) // do { dwImageType = GetImageType(); switch(dwImageType) { case BL_IMAGE_TYPE_BIN: rval &= DownloadBin( pdwImageStart, pdwImageLength, pdwLaunchAddr ); break;
default: // should never get here return (FALSE); } } while (--g_downloadFilesRemaining);
ComputeChecksum();
if(g_EbootCFG.Store_In_NandFlash) { // NandflashInit();
if(FlashFormated == FALSE) {
BP_LowLevelFormat((DWORD)g_dwStartBlock,(DWORD)(NUM_BLOCKS - g_dwStartBlock),0) ; }
rval &= WriteImageToFlash();
#if 0
KITLOutputDebugString ("create partition.\r\n"); BP_OpenPartition( NEXT_FREE_LOC, USE_REMAINING_SPACE, PART_DOS32, TRUE, PART_OPEN_ALWAYS);while ( OEMReadData (sizeof (DWORD), (LPBYTE) &dwRecAddr) && OEMReadData (sizeof (DWORD), (LPBYTE) &dwRecLen) && OEMReadData (sizeof (DWORD), (LPBYTE) &dwRecChk) )
这就是一段一段在解压 #endif }
|