PORTS Forum
Ports and Interfaces => USB => Topic started by: coolsunny2012 on December 14, 2012, 03:21:37 pm
-
I would like to find the host OS while enumerating and select only the corresponding OS image file with the mass storage driver.
For example:
"insmod g_mass_storage.ko file=/win.iso,mac.iso"
While executing the above command, when the device is attached to WINDOWS, i need to show up win.iso instead of exposing mac.iso.
The command should look like "insmod g_mass_storage.ko file=/win.iso"
While executing the above command, when the device is attached to MAC, i need to show up mac.iso instead of exposing win.iso.
The command should look like "insmod g_mass_storage.ko file=/mac.iso".
I would appreciate any other thoughts/work around to this problem.
-
The host doesn't announce its OS during enumeration.
Plus, the device must install the gadget driver before enumeration.
-
Is there any way to determine the OS Type may be with some other driver or something?
-
If you're designing the device, it could include a HID interface that sends a vendor-defined request for the OS. On the host system, you would have to provide an application that knows how to respond to the request.
But surely there are emulated CDs that can function on both OSes. Maybe it makes more sense to figure out how to get that working.
-
In fact it's a composite USB driver with HID + Mass Storage. And we do have a similar mechanism to your suggestion for detecting the OS.
But we need to find it while enumeration itself as the existing mechanism takes several seconds to determine the OS type.
I was wondering if there is already a mechanism instead of re-inventing the wheel.
There is also a patent for this approach: http://www.google.com/patents/US20120054372.
I am trying to quickly hack the mass storage & HID driver so that i can select only one image based on the OS even though the driver allows to take both windows & mac ISO images.
-
I'm not familiar with Windows or Mac scripting, but can you do it with environment variables?
-
It has to be done in Linux while it is booting and enumerating the mass storage driver. The tricky part is that, i should be aware of what OS the device is connected before i insert the mass storage driver.
I've not quite figured out this yet..
-
I don't know about anybody else, but I'm completely confused as to what you're trying to do.
You say the device is "attached" to Windows or Mac, but this is being done while Linux is booting. Is this some kind of Linux virtual machine running under Windows / Mac, and you're trying to determine the Host OS?
-
Yes, this is similar to USB thumb drive which has iMX processor running linux kernel and i am trying to figure out the OS before i pretend the thumb drive as Mass storage driver (using g_mass_storage.ko)