This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

USB: mounting file systems

Hello,
If I mount a USB device on a windows machine, can the device in any reliable way create files so that they appear on the windows explorer? I know the device is mounted on Windows so that Windows should be the one to determine the contents. But is it possible or is this a clear violation of the rules? what happens if the device creates a file, resets itself (assuming it can do that by control over the data lines) to force reenumeration? will Windows see the new file?

Parents
  • Windows caches directory and FAT on its side. When the device alters these blocks on the media without intervention of Windows, mismatch occurs. Windows will take this mismatch as disk error. When the device touches to media, unmount the media first.

    Emulate SD card reader response for media exchange.

    Just after enumeration,
    Windows put several SCSI commands to know about the media. In this sequence, respond to the command as follows.

    INQUIRY
    - return RMB = 1 (removable)

    PREVENT ALLOW MEDIA REMOVAL
    - when PREVENT = 00, success this command. when PREVENT = 01, fail it

    With this response, Windows doesn't make write cache. It prevents disorder caused by unmount.

    To unmount the media,
    Windows put TEST UNIT READY every 1 sec. Fail this command while unmounted.
    To REQUEST SENSE just after this TEST UNIT READY, return this sense data

    Status = CHECK CONDITION
    Sense Key = NOT READY (0x02)
    Additional Sense Code = MEDIUM NOT PRESENT (ASC: 0x3A, ASCQ: 0x00)

    While unmounted, fail any other SCSI commands, and return above

    After the operation of device side finishes, re-mount the media - respond to SCSI commands as usual.

    Tsuneo

Reply
  • Windows caches directory and FAT on its side. When the device alters these blocks on the media without intervention of Windows, mismatch occurs. Windows will take this mismatch as disk error. When the device touches to media, unmount the media first.

    Emulate SD card reader response for media exchange.

    Just after enumeration,
    Windows put several SCSI commands to know about the media. In this sequence, respond to the command as follows.

    INQUIRY
    - return RMB = 1 (removable)

    PREVENT ALLOW MEDIA REMOVAL
    - when PREVENT = 00, success this command. when PREVENT = 01, fail it

    With this response, Windows doesn't make write cache. It prevents disorder caused by unmount.

    To unmount the media,
    Windows put TEST UNIT READY every 1 sec. Fail this command while unmounted.
    To REQUEST SENSE just after this TEST UNIT READY, return this sense data

    Status = CHECK CONDITION
    Sense Key = NOT READY (0x02)
    Additional Sense Code = MEDIUM NOT PRESENT (ASC: 0x3A, ASCQ: 0x00)

    While unmounted, fail any other SCSI commands, and return above

    After the operation of device side finishes, re-mount the media - respond to SCSI commands as usual.

    Tsuneo

Children