none
IOCTL_DISK_READ in FlashPDD driver (this shouldn't be there, should it?) RRS feed

  • Question

  • Hello,

    we want to change our block driver from TrueFFS to the sample driver from Spansion (http://www.spansion.com/Support/Pages/DriversSoftware.aspx http://www.spansion.com/Support/Software/Spansion_PDD_NOR_12.3.0.zip ). This one uses the FlashMDD-driver from catalog and implements the PDD-version.
    I almost works, only the FSDMGR refuses to mount the store.

    Just before it abort, I get some strange IOCTLs. The first is IOCTL_DISK_GET_STORAGEID and the second IOCTL_DISK_READ.
    These aren’t described in msdn PDD reference. I assume that a higher layer should have dealt with it.

    Am I right or could it be something else?

    I also got an exception form the storemanager:
    FSDMGR!AutoLoadBlockDevice: Auto-loading block driver from "Drivers\BuiltIn\SPNNORD"
    Unknown: DEBUGCHK failed in file d:\yzkiqfe\private\winceos\COREOS\storage\fsdmgr\.\storedisk.cpp at line 66

    Callstack IOCTL_DISK_READ:

    IoControl(unsigned long 0xd00251e0, unsigned long 0x00075c08, unsigned char * 0xd00aecd8, unsigned long 0x0000001c, unsigned char * 0x00000000, unsigned long 0x00000000, unsigned long * 0xd00aecd0)  line 991
    FLASHMDD!FlashPddStreamDriver::IoControl(unsigned long 0x00075c08, void * 0xd00aecd8, unsigned long 0x0000001c, void * 0x00000000, unsigned long 0x00000000, unsigned long * 0xd00aecd0)  line 102 + 84 bytes
    FLASHMDD!FlashPddStreamWrapper::IoControl(unsigned long 0x00075c08, unsigned char * 0xd00aecd8, unsigned long 0x0000001c, unsigned char * 0x00000000, unsigned long 0x00000000, unsigned long * 0xd00aecd0)  line 171 + 84 bytes
    FLASHMDD!FlashPddHelper::IoControl(unsigned long 0x00075c08, unsigned char * 0xd00aecd8, unsigned long 0x0000001c, unsigned char * 0x00000000, unsigned long 0x00000000, unsigned long * 0xd00aecd0)  line 570 + 84 bytes
    FLASHMDD!FlashMddInstance::IoControl(unsigned long 0x00075c08, unsigned char * 0xd00aecd8, unsigned long 0x0000001c, unsigned char * 0x00000000, unsigned long 0x00000000, unsigned long * 0xd00aecd0)  line 577 + 80 bytes
    FLASHMDD!FlashMddWrapper::IoControl(unsigned long 0x00075c08, unsigned char * 0xd00aecd8, unsigned long 0x0000001c, unsigned char * 0x00000000, unsigned long 0x00000000, unsigned long * 0xd00aecd0)  line 600 + 84 bytes
    FLASHMDD!FlashMdd_IoControl(unsigned long 0xd01d0260, unsigned long 0x00075c08, unsigned char * 0xd00aecd8, unsigned long 0x0000001c, unsigned char * 0x00000000, unsigned long 0x00000000, unsigned long * 0xd00aecd0)  line 275 + 64 bytes
    FSDMGR!BlockDevice_t::Control(unsigned long 0x00075c08, void * 0xd00aecd8, unsigned long 0x0000001c, void * 0x00000000, unsigned long 0x00000000, unsigned long * 0xd00aecd0, _OVERLAPPED * 0x00000000)  line 93 + 76 bytes
    FSDMGR!FS_DevDeviceIoControl(BlockDevice_t * 0xd00228e0, unsigned long 0x00075c08, void * 0xd00aecd8, unsigned long 0x0000001c, void * 0x00000000, unsigned long 0x00000000, unsigned long * 0xd00aecd0, _OVERLAPPED * 0x00000000)  line 22 + 72 bytes
    KERNEL!MDCallKernelHAPI()  line 1398
    KERNEL!NKHandleCall(unsigned long 0x00000007, _DHCALL_STRUCT * 0xd00ae968)  line 1983 + 48 bytes
    K.COREDLL!DirectHandleCall(unsigned __int64 0x00000000fffffff9)  line 73 + 36 bytes
    K.COREDLL!xxx_ForwardDeviceIoControl(void * 0x00a30003, unsigned long 0x00075c08, void * 0xd00aecd8, unsigned long 0x0000001c, void * 0x00000000, unsigned long 0x00000000, unsigned long * 0xd00aecd0, _OVERLAPPED * 0x00000000)  line 48 + 120 bytes
    FSDMGR!CONV_DevDeviceIoControl(StoreDisk_t * 0xd0021b20, unsigned long 0x00075c08, void * 0xd00aecd8, unsigned long 0x0000001c, void * 0x00000000, unsigned long 0x00000000, unsigned long * 0xd00aecd0, _OVERLAPPED * 0x00000000)  line 1217 + 76 bytes
    KERNEL!MDCallKernelHAPI()  line 1398
    KERNEL!NKHandleCall(unsigned long 0x00000007, _DHCALL_STRUCT * 0xd00aeba8)  line 1983 + 48 bytes
    K.COREDLL!DirectHandleCall(unsigned __int64 0x0000000000000007)  line 73 + 36 bytes
    K.COREDLL!xxx_DeviceIoControl(void * 0x00a40003, unsigned long 0x00075c08, void * 0xd00aecd8, unsigned long 0x0000001c, void * 0x00000000, unsigned long 0x00000000, unsigned long * 0xd00aecd0, _OVERLAPPED * 0x00000000)  line 32 + 116 bytes
    MSPART!DoDiskIoControl(tagDriverState * 0xd0027ee0, unsigned long 0x00075c08, void * 0xd00aecd8, unsigned long 0x0000001c, void * 0x00000000, unsigned long 0x00000000, unsigned long * 0xd00aecd0, _OVERLAPPED * 0x00000000)  line 148 + 92 bytes
    MSPART!ReadSectors(tagDriverState * 0xd0027ee0, unsigned __int64 0x0000000000000000, unsigned __int64 0x0000000000000001, unsigned char * * 0xd00aed7c)  line 926 + 76 bytes
    MSPART!PD_OpenStore(void * 0x00a40003, unsigned long * 0xd00228b8)  line 111 + 24 bytes
    FSDMGR!PartitionDriver_t::OpenStore(void * 0x00a40003, unsigned long * 0xd00228b8)  line 121 + 24 bytes
    FSDMGR!StoreDisk_t::MountPartitions(void * 0x00a50003, int 0x00000001)  line 616 + 32 bytes
    FSDMGR!StoreDisk_t::Mount(void * 0x00a50003, int 0x00000001)  line 688 + 20 bytes
    FSDMGR!MountStore(const unsigned short * 0xd0021908, const _GUID * 0xc0711240, const unsigned short * 0xd00aef90, StoreDisk_t * * 0x00000000)  line 461 + 20 bytes
    FSDMGR!AutoLoadBlockDevice(const unsigned short * 0xd0021908, HKEY__ * 0xd00c00c0)  line 47 + 28 bytes
    FSDMGR!AutoLoadFileSystem(unsigned long 0x00000000, HKEY__ * 0xd00c0060, const unsigned short * 0xc0715770, const unsigned short * 0xd0021908)  line 149 + 16 bytes
    FSDMGR!AutoLoadFileSystems(unsigned long 0x00000000, unsigned long 0x00000001)  line 170 + 40 bytes
    FSDMGR!STOREMGR_StartBootPhase(unsigned long 0x00000000)  line 517 + 32 bytes
    FILESYS!InitStorageManager(unsigned long 0x00000000)  line 1817 + 20 bytes
    FILESYS!prgInitRamRegistry(int 0x00000000, unsigned short * 0xd00afe00)  line 789
    FILESYS!prgInitRegistry(int 0x00000000, unsigned short * 0xd00afe00)  line 3714 + 16 bytes
    FILESYS!DoGeneralInit(unsigned short * 0xd00afe00)  line 2098 + 16 bytes
    FILESYS!FileSysMain(HINSTANCE__ * 0x8faae9b0)  line 2591 + 12 bytes
    K.COREDLL!ThreadBaseFunc(unsigned long (void *)* 0xc0249540, void * 0x8faae9b0)  line 1131 + 16 bytes

    Debuglog:

    FSDMGR!StoreDisk_t::OpenDisk (0xD0021B20) DeviceInfo Class (0x00000001) Flags (0x00000015) Type (0x00000002) Profile (SpansionNOR)
    FSDMGR!MountStore: Attaching new storage device "SpansionNOR"
    FSDMGR!DumpRegKey: Dumping registry for key System\StorageManager\Profiles 
    		AutoMount = 00000001
    		AutoPart = 00000001
    		AutoFormat = 00000000
    		MountFlags = 00000000
    		DefaultFileSystem = FATFS
    		PartitionDriverName = MSPART
    		Folder = Flash
    		ActivityEvent = PowerManager/ActivityTimer/SystemActivity
    		Name = Flash
    		MountAsBootable = 00000001
    		MountLabel = Flash
    		FileSystem = fatfsd.dll
    		PartitionDriver = 
    FSDMGR!DumpRegKey: Dumping registry for key SpansionNOR 
    		Name = Flash
    		Folder = Flash
    		MountAsBootable = 00000001
    		MountLabel = Flash
    		PartitionDriver = flashpart.dll
    		PartitionDriverName = MSPART
    		DefaultFileSystem = FATFS
    		FileSystem = fatfsd.dll
    OSAXST1: >>> Loading Module 'mspart.dll' (0x8FA6C4D8) at address 0xC0770000-0xC077E000 in Process 'NK.EXE' (0x83B4BBE8)
    FSDMGR!LoadPartitionDriver: Loading partition driver mspart.dll hModule=8FA6C4D8
    Spansion NOR PDD::IoControl - Unknown code DeviceType 0007 Function 702 Method 1 Access 0
    Spansion NOR PDD::IoControl - Unknown code DeviceType 0000 Function 000 Method 0 Access 2
    FSDMGR!MountStore: Failed mounting store "SpansionNOR"; error=30
    FSDMGR!AutoLoadFileSystems: Unable to auto-load HKLM\System\StorageManager\AutoLoad\SpansionNOR; error=87

    Registry:

    [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SPNNORD]
        "Dll"="flashmdd.dll"
        "FlashPddDll"="spnnord.dll"
        ; 0-based load order, undefined to load last (model)
        "Order"=dword:2
        "Prefix"="DSK"
       "Index"=dword:1
        "Ioctl"=dword:4
       "FSD"="FATFS.DLL"
       "Folder"="Flash"
        "Profile"="SpansionNOR"
        "IClass"="{A4E7EDDA-E575-4252-9D6B-4195D48BB865}"
        "MemBase"=dword:B8000000       
        "MemLen"=dword:00000000
        "FileSystemSectorSize"=dword:200
        ; Data bus can be 10h (16) or 20h (32) bits
        "DataBusWidthBits"=dword:10
        "ReservedSizeAtStart"=dword:02000000
        "ReservedSizeAtEnd"=dword:00000000
    
    ; Override names in default profile
    [HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\SpansionNOR]
        "Name"="Flash"
        "Folder"="Flash"
       ;"MountFlags"=dword:2
       "MountAsBootable"=dword:1
       "MountLabel"="Flash"
        "PartitionDriver"="flashpart.dll"
       "PartitionDriverName"="MSPART"
        "DefaultFileSystem"="FATFS"
       "FileSystem"="fatfsd.dll"
    
    [HKEY_LOCAL_MACHINE\System\StorageManager\AutoLoad\SpansionNOR]
        "DriverPath"="Drivers\\BuiltIn\\SPNNORD"    
        "BootPhase"=dword:0
        ; LoadFlags 0x01 == load synchronously
        "LoadFlags"=dword:1
        ; 0-based load order, undefined to load last (model)
        "Order"=dword:1

    Regards,
    John

    Monday, February 10, 2014 4:00 PM

Answers

  • Okay, I'm to blame.

    I copied some keys form my TrueFFS profile to the SpansionNOR profile.

    One of these keys was "PartitionDriverName"="MSPART" and mspart.dll calls the IOCTL_DISK_XXX codes.
    When I changed MSPART to flashpart, I got "FSDMGR!StoreDisk_t::GetPartitionDriver: Using the default HARDCODED partitioning driver (mspart.dll)!!!"
    Only when I comment the key out, the kernel loaded flashpart.dll and everything worked.

    Next time I sould try this "understand before coping" ;D

    • Marked as answer by John Bober Tuesday, February 11, 2014 4:49 PM
    Tuesday, February 11, 2014 4:49 PM

All replies

  • Well, I have an idea what it could be.

    Right before it tries with IOCTL_DISK_READ and DISK_IOCTL_READ, it calls IOCTL_FLASH_PDD_READ_PHYSICAL_SECTORS.

    I erased my flash before, so every sector is 0xFF.

    I guess the driver wants some sort of partition info or something. I wrote an old EXFAT header to the first file system sector, without luck.

    Does anybody know what the driver expects there?

    Regards,
    John
    Tuesday, February 11, 2014 11:03 AM
  • Okay, I'm to blame.

    I copied some keys form my TrueFFS profile to the SpansionNOR profile.

    One of these keys was "PartitionDriverName"="MSPART" and mspart.dll calls the IOCTL_DISK_XXX codes.
    When I changed MSPART to flashpart, I got "FSDMGR!StoreDisk_t::GetPartitionDriver: Using the default HARDCODED partitioning driver (mspart.dll)!!!"
    Only when I comment the key out, the kernel loaded flashpart.dll and everything worked.

    Next time I sould try this "understand before coping" ;D

    • Marked as answer by John Bober Tuesday, February 11, 2014 4:49 PM
    Tuesday, February 11, 2014 4:49 PM