how to eject a removable device in a software way, but not by "eject"command
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
Last edited by viktor2000; 10-14-2011 at 02:23 AM.
Reason: details
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.
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.
i'm sorry that i didn't explain it clearly.... actually , "A" is support the standard linux commands , the key is that it doesn't have all the commands of linux for it is an embeded device and its resource is very limited !
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.
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.
Thanks . .. is there a solution that just operating the linux kernel ?
And how would you make use of that? Perhaps by writing some code?
... i'm not sure if linux has this kind method that operating kernel to solve my problem, but my experience tell me that linux always has couple of method to realize a function.....so i guess ..haha
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.
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.
thank you, you are really kind ! haha , i will tell the manufacturer of "A"device tomorrow that: add the "eject " command ,otherwise i quit!
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.