USB Devices "Eject"

AmigaOS users can make feature requests in this forum.

Re: USB Devices "Eject"

Postby salass00 » Fri Mar 11, 2016 1:47 pm

Belxjander wrote:This is already part of the trackdisk/scsi device driver specs from older OS versions... Can we reuse that for this USB functionality?


A trackdisk device level "eject" function would solve nothing as it would have the same effect as simply unplugging the USB storage device.

It's the file system which needs to be cleanly dismounted or inhibited if you want to be sure that it is in a sane state when the disk is removed.

The device driver doesn't necessarily know about file systems so it can't do this.
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 481
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland

Re: USB Devices "Eject"

Postby salass00 » Fri Mar 11, 2016 2:05 pm

Daedalus wrote:I've just given it a go, and it doesn't work. Well, it sort of works, but the Dismount permanently dismounts the device, meaning that it won't mount again until you reboot. I tried using Dismount USB0:, which removed the device but even removing the drive and plugging it into a different USB socket wouldn't make it reappear. Doing a Dismount VolumeName: doesn't work, and using Dismount USB0: SOFT means that the drive simply remounts a couple of seconds later, similar to how Diskchange USB0: behaves.

It seems like it might need a custom little tool that disables a device until it's removed, then resets to normal. Anyone got any ideas of a simple way of achieving this?


It's better to use the "USB MassStorage Driver" commodity to dismount auto-mounted USB file systems as it doesn't like if you dismount file systems in another way, like using the C:Dismount command (doing so may cause crashes even IIRC).

Image
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 481
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland

Re: USB Devices "Eject"

Postby Daedalus » Sat Mar 12, 2016 11:36 pm

@salass00
True, though that method doesn't lend itself to use in a context-sensitive menu.
User avatar
Daedalus
 
Posts: 42
Joined: Sat Jun 18, 2011 1:30 am
Location: From Ireland, living in Glasgow

Re: USB Devices "Eject"

Postby Belxjander » Sun Mar 13, 2016 4:18 pm

salass00 wrote:
Daedalus wrote:I've just given it a go, and it doesn't work. Well, it sort of works, but the Dismount permanently dismounts the device, meaning that it won't mount again until you reboot. I tried using Dismount USB0:, which removed the device but even removing the drive and plugging it into a different USB socket wouldn't make it reappear. Doing a Dismount VolumeName: doesn't work, and using Dismount USB0: SOFT means that the drive simply remounts a couple of seconds later, similar to how Diskchange USB0: behaves.

It seems like it might need a custom little tool that disables a device until it's removed, then resets to normal. Anyone got any ideas of a simple way of achieving this?


It's better to use the "USB MassStorage Driver" commodity to dismount auto-mounted USB file systems as it doesn't like if you dismount file systems in another way, like using the C:Dismount command (doing so may cause crashes even IIRC).

Image


Is this accessible by ARexx/Scripting MessagePort?

Access from scripting as a DISMOUNT command given a volume/dosdriver name may solve this request very neatly.
Belxjander
 
Posts: 262
Joined: Mon May 14, 2012 11:26 pm
Location: 日本千葉県松戸市 / Matsudo City, Chiba, Japan

Re: USB Devices "Eject"

Postby Daedalus » Mon Mar 14, 2016 10:09 pm

Belxjander wrote:Is this accessible by ARexx/Scripting MessagePort?

Access from scripting as a DISMOUNT command given a volume/dosdriver name may solve this request very neatly.


I've already checked and there's no mention of any scripting or command-line abilities in the brief documentation. Pity, as that would have been ideal for this.
User avatar
Daedalus
 
Posts: 42
Joined: Sat Jun 18, 2011 1:30 am
Location: From Ireland, living in Glasgow

Re: USB Devices "Eject"

Postby Daedalus » Wed Apr 27, 2016 11:48 am

@salass00

So, is there any way of finding out what exactly the Dismount function of the Mass Storage commodity is doing? I'm not familiar with the details of USB programming, but if we knew roughly the steps / calls made by the Dismount option, it should be relatively easy to knock together a simple "USBEject" command for use in scripts.
User avatar
Daedalus
 
Posts: 42
Joined: Sat Jun 18, 2011 1:30 am
Location: From Ireland, living in Glasgow

Re: USB Devices "Eject"

Postby broadblues » Wed Apr 27, 2016 3:07 pm

So, is there any way of finding out what exactly the Dismount function of the Mass Storage commodity is doing? I'm not familiar with the details of USB programming, but if we knew roughly the steps / calls made by the Dismount option, it should be relatively easy to knock together a simple "USBEject" command for use in scripts.


Really no, don't try and make a hack command to do that, just use the GUI. trying to pull the device out from under usbmassstorage will just cause system instabilty.

CTRL-ALT-M brings it up, dead easy.

I can't honestly remeber the last time I needed to do this on Amiga OS anyway.
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 478
Joined: Sat Jun 18, 2011 3:40 am
Location: Portsmouth, UK

Re: USB Devices "Eject"

Postby Daedalus » Thu Apr 28, 2016 4:57 pm

I know that, and that's what I use personally when I want to remove a drive after writing to it. But the aim was to be able to right-click and dismount using a context-sensitive menu, which is even easier than calling up a GUI, searching for the device you want to eject and clicking the Dismount button. If the MassStorage GUI had an ARexx port or even relevant command line options it would be trivial, but alas...

Anyway, I wasn't talking about making something "hacky". I was talking about replicating the exact functionality the GUI uses for dismounting, which one would presume isn't hacky and therefore there must be a "correct" way to do it.
User avatar
Daedalus
 
Posts: 42
Joined: Sat Jun 18, 2011 1:30 am
Location: From Ireland, living in Glasgow

Re: USB Devices "Eject"

Postby xenic » Sun May 01, 2016 12:11 am

Daedalus wrote:I know that, and that's what I use personally when I want to remove a drive after writing to it. But the aim was to be able to right-click and dismount using a context-sensitive menu, which is even easier than calling up a GUI, searching for the device you want to eject and clicking the Dismount button. If the MassStorage GUI had an ARexx port or even relevant command line options it would be trivial, but alas...

Anyway, I wasn't talking about making something "hacky". I was talking about replicating the exact functionality the GUI uses for dismounting, which one would presume isn't hacky and therefore there must be a "correct" way to do it.


Actually, I tested the USB MassStorage "Dismount" command and it doesn't do anything on my system.
AmigaOne X1000 with 2GB memory - OS4.1 FE
xenic
 
Posts: 1047
Joined: Sun Jun 19, 2011 1:06 am

Re: USB Devices "Eject"

Postby Daedalus » Sun May 01, 2016 4:29 pm

xenic wrote:Actually, I tested the USB MassStorage "Dismount" command and it doesn't do anything on my system.

That's strange, maybe something on your system is holding a lock on whatever drive you're testing with because on my system it removes the drive from the device list. With some further testing I've found that the Dismount function of the GUI does exactly the same thing as the Dismount DOS command: it simply calls dos.library DismountDevice() with the relevant device. This also means the same limitation exists there - once a device is dismounted, disconnecting and reconnecting the device won't make the volume show up again without manually mounting it. So the mass storage GUI isn't a good reference for simple "eject" functionality after all.

Slightly worrying perhaps, is that while the USB drive is still attached, the Mount function of the GUI can me used to remount the drive as expected, but if the drive is removed and then reconnected, it shows up as dismounted in the GUI, but clicking on Mount crashes my entire system. So, once dismounted, there's no apparent way to use a particular device again without rebooting.
User avatar
Daedalus
 
Posts: 42
Joined: Sat Jun 18, 2011 1:30 am
Location: From Ireland, living in Glasgow

Previous

Return to AmigaOS Feature Requests

Who is online

Users browsing this forum: No registered users and 1 guest