how to eject a removable device in a software way, but not by "eject"command
hi...good afternoon ,friends :
i'm doing a software project about a embed device which i called "A" device "A" whose OS is linux...( for simplicity ,we can seem the device "A" as a normal computer and its OS is linux) ,i was told that device "A" doesn't have "eject" command , and the more unlucky things is that i have to eject the device "B" which is plug in the device "A" in a software way....how can i realize it !... any help will be appreciated! Viktor 2011.10.14 |
The best way is to read the documentation for device "A", and code to the specification. No documentation, no code.
|
Quote:
|
If the device doesn't respond to standard commands, it's not "normal". However it is uniquely defined, its control must be coded to specifically for the device. We don't know what that specification is, and we can't read minds. If you have been contracted to create the code, you have access, possibly under an NDA, to the specification. You have to code to that specification.
|
Quote:
thank you for your concentration to my post! |
Then just port the eject command. You will have to re-implement it anyway to perform the function. If you don't have the resource for 20k of code, you won't have the resource to do it any other way either.
|
Quote:
|
And how would you make use of that? Perhaps by writing some code?
|
Quote:
|
It's not a method, it's device control. The device specifies that, not the kernel. The kernel allows you to communicate with the device, but you have to write the code. The eject command (or the eject function in busybox, whatever userspace you're using) perform the necessary I/O. If you think you can code it better, pull the source for eject or busybox, and code away.
|
Quote:
|
Quote:
|
Removing a disk does not eject media, it simply makes it so the kernel will no longer communicate with it.
|
Quote:
|
All times are GMT -5. The time now is 11:18 AM. |