RE: USB gadget with drivers "on board"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

> -----Original Message-----
> From: Alan Stern [mailto:stern@xxxxxxxxxxxxxxxxxxx]
> Sent: Wednesday, April 28, 2010 12:25 AM
> To: Viral Mehta
> Cc: linux-usb@xxxxxxxxxxxxxxx
> Subject: RE: USB gadget with drivers "on board"
>
> On Tue, 27 Apr 2010, Viral Mehta wrote:
>
> > I want to store drivers/software for Windows
> > as well as Linux BUT on different partitions and "on board".
>
> Why on different partitions?  Doesn't that just make your life harder?
> What's wrong with putting everything into multiple top-level
> directories on the same partition?
>
No. other way around, it makes user's life easier. Here is the scenario,
I have one USB Digital Picture Frame. It has one NAND flash. I am doing 3 extra
Partitions on it (other than for uImage and etc). One has software for Windows, other
Partition has for Linux and third one will have for MAC. I will use those partitions
As "Backing File" while emulating this device as CD-ROM.

Now 3 partitions because,why a Windows user should see MAC and Linux softwares ?
Or a Linux user will not care about softwares for Windows and MAC.
Or even I should not confuse a user by giving 3 choices.

Instead best user experience
Will be if I can auto install those softwares by *detecting* OS on USB host.

I have seen USB CDMA modem devices. If you connect that device for the first
time to Windows (it will be emulated as CD-ROM), then it will automatically
install the software and second time onwards, it will start using that software.

If you connect the same device to MAC for the first time, then it will mount another flash
Partition and user will see just MAC related software for that device. (however, there
Is no auto install for MAC).

> > Now, when I connect my device to Windows, *partition-1* will be
> mounted
> > automatically and will install the driver/software from that
> partition.
> > And similarly if I connect to Linux, it will mount *partition-2*
> > and will install driver/software from that partition.
>
> You mean: you _want_ it to mount partition-2, not it _will_ mount
> partition-2.  IIUC, the problem is that currently it does _not_ mount
> partition-2.
>
> > To accomplish this, my device will need to know which USB host it is
> being connected to.
> > And as in USB everything is host centric,
> > I am not able to identify how my device can know about which
> Operating System USB host is running.
>
> There is no reliable way to do this.
Yes, I have the same opinion.
But any work around to achieve best user experience as I mentioned above.

Here is one more option that I am thinking of, but have not tested yet,
1. create 3 partitions on flash.
2. Burn first partition with Windows related software and use filesystem as CDFS
3. Burn second partition with MAC related software and use filesystem as HFS
4. Burn third partition with Linux related software and use filesystem as ext2

Now, when device is connected to USB host, set autoloading of the module on device something like,
insmod g_file_storage.ko file=/dev/<second partition>
(or e.g., insmod g_file_storage.ko file=/dev/block/mtdblock2>

now, assume that user is connecting this device to Windows, in that case Windows will report an error
saying that ohhh I don’t understand the filesystem on the device. (Note that I am trying with second partition
which has HFS filesystem on it.)

And if device can get, somehow, this error then it will try, okkk
insmod g_file_storage.ko file=/dev/<third partition>
and then if that fails too, try
insmod g_file_storage.ko file=/dev/<first partition>


>
> > I thought something on getting this information from USB enumeration
> Pattern. But this method is patented,
> > http://www.wikipatents.com/US-Patent-7574534/method-for-using-device-
> enumeration-information-to-identify-an
>
> Even if you can track the commands sent during device enumeration or
> initialization, what will you do if a later version of Windows decides
> to use a different sequence of commands?

Anyway, I have ruled out this possibility. Any thoughts on option that I aforesaid.
Or any other cleaner way to do this.

>
> No, you're much better off making everything the same -- all files
> available on all systems.  Besides, what if somebody wants to copy the
> Windows drivers and files from your device, but has only a Linux
> computer available to do the copying?
>
> Alan Stern
>
>
> ______________________________________________________________________

This Email may contain confidential or privileged information for the intended recipient (s) If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system.

______________________________________________________________________
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux