Subject: Re: Capturing a CD image
To: None <netbsd-users@netbsd.org>
From: Wolfgang Rupprecht <wolfgang@wsrcc.com>
List: netbsd-users
Date: 04/06/2000 20:44:25
tls@rek.tjls.com (Thor Lancelot Simon) writes:
> On Thu, Apr 06, 2000 at 05:45:46PM -0700, Wolfgang Rupprecht wrote:
> > netbsd@precedence.co.uk (Stephen Borrill) writes:
> > > What is the best way to capture an ISO image from a CD-ROM. Under Linux it
> > > is as simple as the equivalent of cat /dev/cd0a > image. 
> > I have managed to copy CD's with a simple:
> >         dd if=/dev/rcd0d of=cdimage.iso bs=1024k
> This probably screwed up the very last few blocks of your image (you may not
> have noticed) because most of our drivers will happily attempt to tell the
> hardware to read off the end of the disk, then return an error when it can't,
> instead of reading *to* the end of the disk, then returning a short read for
> the last request.  

Just to make sure I understand, does the last read not happen (as
opposed to the last read returning extra data?)

> I think this is a serious bug, but some other developers
> disagree; it's been this wasy ~forever and basically requires writing a small
> C program to efficiently copy a CD (since the largest size that divides
> evenly into the number of records on the CD is often not very large...)

I agree with you.

Isn't the model for the network code is to return a short read for the
last read, followed by a read of "0" bytes, followed by a "-1".  This
seems like a nice and gentle way to clue in a program that it just hit
the brick wall.

-wolfgang
-- 
       Wolfgang Rupprecht <wolfgang+gnus@dailyplanet.wsrcc.com>
		    http://www.wsrcc.com/wolfgang/
DGPS signals via the Internet  http://www.wsrcc.com/wolfgang/gps/dgps-ip.html