Subject: Re: scsipi woes: can't call scsi command from kernel by ioctl?
To: Bill Studenmund <wrstuden@netbsd.org>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 08/31/2005 10:35:37
On Tue, Aug 30, 2005 at 07:29:21PM -0700, Bill Studenmund wrote:
> > 
> > Yes; I think we should also allow writing though the raw or block device;
> > so we could allow writing using e.g. dd (instead of writing only though
> > the UDF filesystem).
> 
> Are you sure that these devices will support that? Perhaps I'm 
> overly-conditioned, but I have never looked to dd as a way to write CDs, 
> so I don't see why it should be a way to write UDF disks.

As far as I understand, UDF is only a file system (designed to handle
certain properties of direct-access write-once medias). But CDs could
also be written though writes to /dev/(r)cdxd, just as (if I understood
it) UDF would do. This could allow to use CD/DVDs for backups using dump or
tar, for example, but there could be other usages a well (snapshots of
filesystems maybe ? although this may require some more hacking).

> 
> > > I've thought about implementing a /dev/mmc* device that is specific for 
> > > cd/dvd/bd recordables/rewritables since they are a special breed of 
> > > critters quite different from normal cd-rom/dvd-rom. Seperating mmc devices 
> > > from the generic `cd' devices also enables more targeted code to be 
> > > written. Code could also be simplified. How to use the detection framework 
> > > i haven't figured out yet though. What i've read indicates that Linux also 
> > > split off mmc devices from the older legacy CD driver.
> > 
> > How much code would this represent ? I don't know if it's really
> > worth it, and /dev/mmc vs /dev/cd could be confusing for users (not counting
> > the third-party packages that would need to be adapted to use both :)
> 
> Can't say here.
> 
> However my understanding is that UDF is designed to work with MMC devices. 
> As such, I don't think it's unusual to expect it to know about SCSI 
> commands, and to not work so well with non-SCSI/ATAPI devices.

I agree that it's unlikely to see non-SCSI/ATAPI CD/DVD in the future.
My main concern is that UDF may not be the only user of these functionalities,
and also that some device may need some quirk to work around bugs. Better
keep this code in only one place.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--