引用 6 楼 guopeixin 的回复:
如果是你是想格式化掉bin分区的话,就直接按照你以前的思路FMD_EraseBlock()就可以了以,如果下面有binfs的话,直接掉bootpart中的接口也行
呵呵,俺也是菜鸟
⊙﹏⊙
BOOL FMD_OEMIoControl(DWORD dwIoControlCode, PBYTE pInBuf, DWORD nInBufSize, PBYTE pOutBuf, DWORD nOutBufSize, PDWORD pBytesReturned)
{
#if 1
volatile LPBYTE pReadBuffer;
volatile LPBYTE pWriteBuffer;
// static volatile
pflReadWriteInput pBufMsg_Input = (pflReadWriteInput)pInBuf;
// static volatile
pflReadWriteOutput pbufMsg_Output = (pflReadWriteOutput)pOutBuf;
switch(dwIoControlCode)
{
case IOCTL_FMD_READ:
pReadBuffer = (LPBYTE)MapPtrToProcess(pbufMsg_Output->pSectorBuff,GetOwnerProcess());
Sleep(1);
return FMD_ReadSector(pBufMsg_Input->startSectorAddr, pReadBuffer, pbufMsg_Output->pSectorInfoBuff, 1);
case IOCTL_FMD_ERASE:
return FMD_EraseBlock(pBufMsg_Input->blockID);
case IOCTL_FMD_WRITE:
pWriteBuffer = (LPBYTE)MapPtrToProcess(pBufMsg_Input->pSectorBuff,GetOwnerProcess());
Sleep(1);
return FMD_WriteSector(pBufMsg_Input->startSectorAddr, pWriteBuffer, pbufMsg_Output->pSectorInfoBuff, 1);
case IOCTL_FMD_GET_STATUS:
if(FMD_GetBlockStatus(pBufMsg_Input->blockID) != BLOCK_STATUS_BAD)
return FALSE;
case IOCTL_FMD_SET_STATUS:
return FMD_SetBlockStatus(pBufMsg_Input->blockID, BLOCK_STATUS_BAD);
default:
DEBUGMSG(1, (L"FMD_OEMIoControl: unrecognized IOCTL (0x%x)\r\n",dwIoControlCode));
return FALSE;
}
#endif
return(TRUE);
}
这个是我flash驱动中加的代码 FMD_EraseBlock() 完之后 写进的东西也对 , 就是系统不能起来 用的是K9F1G08nandflash 我感觉好像是把分区信息也格掉了 现在这个问题困扰我好长时间了
写EBOOT LOGO 等都没有问题 所以感觉是分区的 问题
%>_