eboot中出现了及其怪异的问题 求高手解决
eboot中烧写NK,在WriteFlashNK之前的地址跟进入函数之后的的形参的值是不一样的
if(FALSE == g_bDownloadOS2RAM)
{
OALMSG(TRUE, (TEXT("dwImageStart123= 0x%x.\r\n"),dwImageStart));WriteFlashNK(dwImageStart, dwImageLength);
}
时的dwImageStart的值为0x80020000,dwImageLength为0x2c8c304。
在进入WriteFlashNK(DWORD dwStartAddr, DWORD dwLength)之后,马上打印dwStartAddr和dwLength的值:
dwImageStart的值为0x2c8c304,dwImageLength为0x87802310。
然后定义了一些变量之后:
BYTE *pbBuffer;
BOOL bReturn = TRUE;
PXIPCHAIN_SUMMARY pXIPChainSummary = NULL;
DWORD dwBINFSPartLength = 0;
HANDLE hPartEx;
DWORD dwStoreOffset = 0;
DWORD dwMaxRegionLength[BL_MAX_BIN_REGIONS] = {0};
DWORD dwChainStart, dwChainLength;
DWORD dwStartAddrOrg;
DWORD dwROMOffsetMSB;
DWORD dwROMOffset;
DWORD dwNumOfRegions;
DWORD dwRegionIndex;
BOOL bKernelImage;
DWORD i;
UCHAR ackdata[4] = {'O', 'K', 'U', 'P'};
UCHAR sizedata[4];
OALMSG(1, (TEXT("WriteFlashNK start!!!!\r\n")));
// Initialize the variables
dwChainStart = dwChainLength = 0;
if(!g_bBootMediaExist)
{
OALMSG(1, (TEXT("ERROR, No device exists.\r\n")));
return(FALSE);
}
if(!VALID_TOC(g_pTOC))
{
OALMSG(OAL_WARN, (TEXT("WARNING, Invalid TOC\r\n")));
OALMSG(OAL_WARN, (TEXT("Initialize TOC..\r\n")));
if ( !TOC_Init() )
{
OALMSG(OAL_ERROR, (TEXT("ERROR: INVALID_TOC\r\n")));
return(FALSE);
}
}
OALMSG(1, (TEXT("dwStartAddr=0x%x\r\n")),dwStartAddr); pbBuffer = OEMMapMemAddr(dwStartAddr, dwStartAddr);
dwStartAddr又成了0x87802310!!!!
谁能解答这个问题 我无法解释这种现象了
[解决办法]
OALMSG(1, (TEXT("dwStartAddr=0x%x\r\n")),dwStartAddr);这个写法有问题吧?
改成OALMSG(1, (TEXT("dwStartAddr=0x%x\r\n"),dwStartAddr));试试。
OALMSG、RETAILMSG等需要特别注意括号的位置。