How can I make a USB flash drive appear/not appear as a CD drive?

7

1

I recently was given a small USB flash drive as an advertising gimmick. When I plug it in, only one drive appears: a CD drive with 42kb used (just an autorun.inf file which launches the manufacturer's website). I know U3 drives also appear as CD drives, but their uninstall utility only works for their own drives.

How can I make it appear as a USB drive instead? Conversely, if I wanted to do the same thing for myself, how would I make it appear as a CD drive?

I'm sure it can be done programmatically, or else the uninstall program wouldn't work.

mmyers

Posted 2009-01-10T18:09:46.003

Reputation: 388

it is related. More to embedded programming of the device, but still programming. – Ilya – 2009-01-11T11:44:25.283

Haven't had time to check into any of these answers; I'll check back next week, I hope. – mmyers – 2009-01-18T05:02:05.490

...or not. (The drive is still plugged in, I just still haven't had time to mess with it.a) – mmyers – 2009-04-10T21:59:05.780

This is probably due to the drivers for the actual drive its self. – Tom Anderson – 2009-01-10T18:11:11.820

You're saying it's hopeless unless I write my own drivers? – mmyers – 2009-01-10T18:14:48.020

Answers

7

This is done in hardware. The device identifies as a composite device containing two children - one for the CD drive and one for the removable storage drive.

On Freund

Posted 2009-01-10T18:09:46.003

Reputation: 183

Unfortunately, there isn't even a removable storage drive shown. – mmyers – 2009-01-10T18:51:16.823

By "hardware", do you mean the actual circuitry or the firmware? – mmyers – 2009-01-10T18:51:48.913

Firmware and/or drivers. – Mihai Limbăşan – 2009-01-10T19:34:05.833

3Drivers usually don't play a part here since the generic OS storage drivers are used (you don't have to install anything to use U3 drives). – On Freund – 2009-01-10T20:52:50.510

They can very much play a part - for example most composite devices (think 3G/HDSPA stick which contains a "CD drive" with the software) aren't fully recognized by the OS until they install an USB enumerator for their IDs. – Mihai Limbăşan – 2009-01-12T16:36:33.507

1The 3G/HDSPA devices I've seen had their CD drive working with no installation. The drivers were needed to enable the actual modem functionality. I've never encountered any device that requires driver installation to enable its 'virtual CD" function, and I work with new devices on a daily basis. – On Freund – 2009-01-13T12:45:47.717

"autoinstall" feature does not require any additional drivers as On Freund correctly stated. The drivers are needed for CDC class which does not implemented on Windows and possible for additional clever tasks, but not for CD itself. – Ilya – 2009-01-15T17:20:21.467

Many USB devices, such as the 3G modems, implement some very very ugly USB trickery in order to work with multiple configurations in Windows. USB allows fallback configurations to be chosen if the host does not understand a previous configuration, but Windows doesn't really follow the specification here. This makes the Linux support for the devices somewhat interesting - they usually implement a SCSI endpoint or HID device which the installed driver writes to in order for the device to switch personality. In the case of USB disks, the hardware gives a composite device with two mass storage pts – Yann Ramin – 2010-05-12T19:20:35.927

0

The flash drive has been partitioned and formatted using the cdfs file system, use the dos command diskpart to look at and delete\create the partitions as fat fat32 or ntfs

BBV

Posted 2009-01-10T18:09:46.003

Reputation: 1

0

Ok, there is 2 questions here :

1) How can I make it appear as a USB drive instead?

It's depends on device itself. I can see 2 options.

  • Device support writing, but represent itself as CDROM and read only. In this case you just need to tweak the device descriptor and you will get working storage device.
  • Device does not implement write and nothing can be done.

By tweaking device descriptor i mean filter driver that will receive device descriptor and will pass a modified one to Windows. Writing filter driver is not very hard and you can find an examples of filter driver in Driver development Kit. A basic understanding of USB protocol will be needed as well.

2) Conversely, if I wanted to do the same thing for myself, how would I make it appear as a CD drive?

Basically same, filter driver that will change the device descriptor to be recognized by CDROM device, but in additional once Windows will recognize CDROM it will send additional SCSI commands to device. Ideally device will just return unsupported command and it's OK, but from my experience most devices are not generic enough and the behavior will be undefined. In this case you will need additional filter driver that will catch this additional commands and will complete the commands without actually sending them to device.

P.S
My answer assume that you don't have access to device firmware, If you do have access to firmware it's really easy to accomplish by modifying device descriptor and making sure that not supported commands are handled correctly.

P.P.S
I don't provide any links to resources since i don't think that practically you going to implement this. If I'm wrong let me know and i will provide relevant resources. Ok one link with general information

Ilya

Posted 2009-01-10T18:09:46.003

Reputation: 101

Windows will load different drivers depending on the storage type (Disk.sys and its relevant filters for USB driver, and cdrom.sys and its relevant filters for a CD). I'm not sure that fooling the OS into loading a different driver stack is a good idea. – On Freund – 2009-01-13T12:51:59.153

I did not tested it. But based on my long experience with USB and device drivers i can't see any reason why it's might not work. Any way it's the only way to do it without changing the hardware ... – Ilya – 2009-01-14T08:48:54.853

It isn't really related to USB layer but to the storage layer. I'm not sure that DISK.sys (not to mention any 3rd party filters it might have on that machine) will gracefully handle devices that should be handled by CDROM.sys – On Freund – 2009-01-14T11:24:52.900

There is almost no differences on device side between regular usb flash disk or usb cdrom, filter i suggest is below disk.sys or cdrom.sys layer i,e at usb layer, this filter should eliminate this difference again hard to argue without testing, but can't see how it can affect something ... – Ilya – 2009-01-15T07:55:16.427

As I said, disk.sys and cdrom.sys have different filters (some of them could be 3rd party) that might rely on specific behavior. Of course you can have a PnP filter to change device identification (or just create an INF file for that device), but you can't guarantee how these filters will behave. – On Freund – 2009-01-15T13:18:28.070

Specific behavior of usb based cdrom device can be mimic using filter drivers on usb layer, properly designed filter driver at disk layer will not notice the change. Bad written filter probably will crash even if real usb device will misbehave. – Ilya – 2009-01-15T16:43:59.043

And most of them (real usb devices) are misbehave :) – Ilya – 2009-01-15T16:44:36.577

0

Hey guy, I have done with my usb FD serveral times to make it into 2 devices CD and usb. The only thing you must do is download chipgenius then run it,wait for it to identify your usb then go to http://flashboot.ru/files/ search your usb firmware tool. If you get the correct one i'm sure there will be no problem. I had done that and turned my usb into hiren boot cdrom, and when boot from bios you no longer choose your usb name but choose usb-cdrom option.

user236472

Posted 2009-01-10T18:09:46.003

Reputation:

4Interesting, but frankly the .ru domain scares me. Is there any other alternative? – mmyers – 2009-12-22T15:16:43.457