关于wince4.2 2k 页面 nand flash 驱动的问题

来源:互联网 发布:糊奔奔扒皮知乎 编辑:程序博客网 时间:2024/06/06 08:25

从网上搜到的关于ce4.2中用2k页面nandflash实现FAT文件系统的帖子,现整理如下:

原贴见

http://groups.google.ca/group/microsoft.public.windowsce.platbuilder/browse_thread/thread/3ee9cf2d4bf65cc/b60bef131890bc6a?hl=en&lnk=gst&q=2048+sector+nand#b60bef131890bc6a

具体步骤:

1.禁止CACHE

[HKEY_LOCAL_MACHINE/System/StorageManager/FATFS]
    "EnableCache"=dword:0

2.根据NANDflash参数修改FMD_GetInfo函数

FMD_GetInfo(PFlashInfo pFlashInfo)
    {
            pFlashInfo->flashType =Nand;

         pFlashInfo->wDataBytesPerSector = 2048;
         pFlashInfo->wSectorsPerBlock = 64;
         pFlashInfo->dwNumBlocks         = 1024;
         pFlashInfo->dwBytesPerBlock     = (pFlashInfo->wSectorsPerBlock *
pFlashInfo->wDataBytesPerSector);

     return TRUE;
    }

3.修改 public/COMMON/oak/drivers/fsd/fatutil/main/formatdisk.c.

取消对SECTOR大小的检查

(if (pdi->di_bytes_per_sect != DEFAULT_SECTOR_SIZE)

并恢复Trailing signature的位置,

*(PWORD)(pbBlock+pdi->di_bytes_per_sect-2) = BOOTSECTRAILSIGH;
改为:
    *(PWORD)(pbBlock+BOOT_SIGNATURE) = BOOTSECTRAILSIGH;

原创粉丝点击