How to change a media to CDFS/ISO9660 file system?

  • Follow


Hi,

I have a USB mass storage device that I wish to change to CDFS. It
responds to the SCSI command set. I initially thought that all CD
device related information(drive geometry/file system etc) would be
contained in a CD ISO image, so I tried sector level writing the ISO
image directly with an imaging software as well as using dd. I also
changed the device's peripheral device type to CDROM device. However,
this didn't work. Windows sees that it's a CDROM device, but the file
system is RAW and I cannot access the drive at all. I did a SCSI
inquiry and saw that the drive geometry remained as before when it was
FAT32, i.e. 512 bytes/block instead of 2048 bytes/block.

I'm wondering what else I have to change in order to make the device
turn up with a CDFS file system?

0
Reply goister (139) 10/18/2007 7:26:14 AM

"galapogos" <goister@gmail.com> wrote in message 
news:1192692374.989391.215430@q3g2000prf.googlegroups.com...
> Hi,
>
> I have a USB mass storage device that I wish to change to CDFS. It
> responds to the SCSI command set. I initially thought that all CD
> device related information(drive geometry/file system etc) would be
> contained in a CD ISO image, so I tried sector level writing the ISO
> image directly with an imaging software as well as using dd. I also
> changed the device's peripheral device type to CDROM device. However,
> this didn't work. Windows sees that it's a CDROM device, but the file
> system is RAW and I cannot access the drive at all. I did a SCSI
> inquiry and saw that the drive geometry remained as before when it was
> FAT32, i.e. 512 bytes/block instead of 2048 bytes/block.
>
> I'm wondering what else I have to change in order to make the device
> turn up with a CDFS file system?
>

Maybe you should tell a bit more of what you are trying to accomplish. You 
mention that you changed the peripheral device type to CDROM. This suggests 
that you are either building a hardware device or that you are developing a 
filter driver to make something look like a CD-ROM that is not. In both 
cases you will have to emulate/implement a whole bunch of CD-ROM 
functionality, such as Read TOC. I'm also curious how you determined the 
blocksize though Inquiry...

Rob



0
Reply Rob 10/18/2007 9:29:34 AM


On Oct 18, 5:29 pm, "Rob Turk" <wipe_this_r.t...@rtist.nl> wrote:
> "galapogos" <gois...@gmail.com> wrote in message
>
> news:1192692374.989391.215430@q3g2000prf.googlegroups.com...
>
>
>
> > Hi,
>
> > I have a USB mass storage device that I wish to change to CDFS. It
> > responds to the SCSI command set. I initially thought that all CD
> > device related information(drive geometry/file system etc) would be
> > contained in a CD ISO image, so I tried sector level writing the ISO
> > image directly with an imaging software as well as using dd. I also
> > changed the device's peripheral device type to CDROM device. However,
> > this didn't work. Windows sees that it's a CDROM device, but the file
> > system is RAW and I cannot access the drive at all. I did a SCSI
> > inquiry and saw that the drive geometry remained as before when it was
> > FAT32, i.e. 512 bytes/block instead of 2048 bytes/block.
>
> > I'm wondering what else I have to change in order to make the device
> > turn up with a CDFS file system?
>
> Maybe you should tell a bit more of what you are trying to accomplish. You
> mention that you changed the peripheral device type to CDROM. This suggests
> that you are either building a hardware device or that you are developing a
> filter driver to make something look like a CD-ROM that is not. In both
> cases you will have to emulate/implement a whole bunch of CD-ROM
> functionality, such as Read TOC. I'm also curious how you determined the
> blocksize though Inquiry...
>
> Rob

I'm actually developing the firmware for the device in order to make
it emulate a data CD. I used a tool called sg3_utils, it wasn't
inquiry but I believe a read capacity command that gave me back a
response telling me the block size is 512 instead of 2048. I'm just
trying to figure out what exactly I need to do, and where, in order to
make the device present itself as a CD-ROM to the OS. I've figured out
the peripheral device type, now I need to figure out the file system.
Any ideas?

0
Reply galapogos 10/19/2007 11:35:13 AM

"galapogos" <goister@gmail.com> wrote in message 
news:1192793713.184431.107320@t8g2000prg.googlegroups.com...
> On Oct 18, 5:29 pm, "Rob Turk" <wipe_this_r.t...@rtist.nl> wrote:
>>
>> Maybe you should tell a bit more of what you are trying to accomplish. 
>> You
>> mention that you changed the peripheral device type to CDROM. This 
>> suggests
>> that you are either building a hardware device or that you are developing 
>> a
>> filter driver to make something look like a CD-ROM that is not. In both
>> cases you will have to emulate/implement a whole bunch of CD-ROM
>> functionality, such as Read TOC. I'm also curious how you determined the
>> blocksize though Inquiry...
>>
>> Rob
>
> I'm actually developing the firmware for the device in order to make
> it emulate a data CD. I used a tool called sg3_utils, it wasn't
> inquiry but I believe a read capacity command that gave me back a
> response telling me the block size is 512 instead of 2048. I'm just
> trying to figure out what exactly I need to do, and where, in order to
> make the device present itself as a CD-ROM to the OS. I've figured out
> the peripheral device type, now I need to figure out the file system.
> Any ideas?
>

Your first stop would be to get the SCSI specs from www.t10.org . It shows a 
list of all mandatory SCSI commands you need to implement in order to 
emulate a CD-ROM drive. For starters, check out this link to the oldest 
Multimedia Commands (draft, just before becoming SCSI-2):
http://www.t10.org/ftp/t10/drafts/mmc/mmc-r10a.pdf

There are newer standards available, they add more commands for other 
devices.

Once you have this implemented, you will need to study the actual filesystem 
lay-out.

Rob


0
Reply Rob 10/19/2007 12:22:39 PM

galapogos wrote:
> 
> I have a USB mass storage device that I wish to change to CDFS.

The device type has nothing to do with the filesystem. To change the
device type from "direct access" (USB mass storage is IIRC derived from
this) to CDROM you have to implement another SCSI command set (Rob Turk
told you where to look). But you should assume that the result will be
no longer USB mass storage compliant and no generic driver will handle
it, so you should read the USB specification too:
http://www.usb.org/developers/docs/.

To use a different filesystem is one level above and in no way SCSI
related.

> It responds to the SCSI command set.

There is no single SCSI command set, every device type has its own
command set.

> I initially thought that all CD
> device related information(drive geometry/file system etc) would be
> contained in a CD ISO image, so I tried sector level writing the ISO
> image directly with an imaging software as well as using dd. I also
> changed the device's peripheral device type to CDROM device. However,
> this didn't work. Windows sees that it's a CDROM device, but the file
> system is RAW and I cannot access the drive at all.

If that is the goal you want to achive, I think you cannot use the USB
mass storage class.

> I did a SCSI
> inquiry and saw that the drive geometry remained as before when it was
> FAT32, i.e. 512 bytes/block instead of 2048 bytes/block.

Changing the device type field in the INQUIRY data (that is an
information for the host and normally never read by the device itself)
do neither change the blocksize nor the whole command set of the device.
You have expected a miracle ...

> I'm wondering what else I have to change in order to make the device
> turn up with a CDFS file system?

Think about the difference again: If you need a CD filesystem simply
copy the image to an arbitrary medium, but if you need a CDROM device
emulation you have to build one because USB mass storage is emulating a
direct access device.


Micha
0
Reply Michael 10/19/2007 2:51:26 PM

4 Replies
177 Views

(page loaded in 0.524 seconds)

Similiar Articles:




7/24/2012 4:00:17 PM


Reply: