Re: Howto eject USB mass storage disk?



Thanks for replying.

I don't cache anything. My CE os is just acting as a middlehand
between the USB port and the storage card. So it's not involved
in such a way that it caches data.

What could happen is that Windows XP has partly written
data to the FAT file system so it's in a inconsistent state,
and the user ejects the SD-card at that time.

The solution I would like is an "eject" button, simly telling
WinXP that "hey, the user is about to remove the card. Please
flush all write operations and dismount the entire file system".
The user would wait for the eject operation to complete and
I could indicate this by a LED so the user knows when XP
has stopped using the card.

Since Windows XP is using my device as a standard USB
mass storage device, the only solution I can think of is
if some kind of eject feature exists in the USB protocol
for a mass storage device.



"anonymous" <anonymous@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:153F0728-C255-4AF0-8629-CF2728B618B2@xxxxxxxxxxxxxxxx
I think the question is more about what functionality would be behind the
eject. USB isn't any different from PCMCIA/CF cards. Frequently, the tools
for those have filesystem flush buttons on XP too.

In CE, one can setup the file system to be cached or not cached. If you
setup the system to be noncached all the way through the filesystem, then
an
eject button isn't needed, but you will take a performance hit generally
since it will be pinging your hardware when anything happens with the
filesystem on that device.

If you cache some portion of your support for USB/PCMCIA/CF, then an eject
button might be a nice addition. There is support in CE 5.0 to force the
filesystem to flush, but you may also need to force a flush from lower
level
drivers too if they hold on to caches.


"Anton Jarl" wrote:

I expose an USB mass storage partition from my
custom Windows CE device.

For instance, I can connect a USB cable between my
device and a Windows XP computer, and it will appear
as a hard drive in Windows XP.

From Windows XP I can right click the drive "D:" from
"My computer" and select "Eject", which will cause
the filesystem to flush correctly on my device and
have it unmounted from Windows XP.

So eject works fine if initiated from Windows XP.

But is there a way from my device to force this
"Eject" to happen?

I haven't found a way to initiate this, maybe I'm
asking for a feature that doesn't exist in USB?


Has anyone experience from this?





.


Loading