From owner-freebsd-current Sat Sep 26 06:43:06 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA03936 for freebsd-current-outgoing; Sat, 26 Sep 1998 06:43:06 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id GAA03925; Sat, 26 Sep 1998 06:42:56 -0700 (PDT) (envelope-from luigi@labinfo.iet.unipi.it) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id NAA14371; Sat, 26 Sep 1998 13:55:23 +0200 From: Luigi Rizzo Message-Id: <199809261155.NAA14371@labinfo.iet.unipi.it> Subject: Re: cd9660 mounts... To: sos@FreeBSD.ORG Date: Sat, 26 Sep 1998 13:55:23 +0200 (MET DST) Cc: current@FreeBSD.ORG In-Reply-To: <199809261214.OAA24718@sos.freebsd.dk> from "Søren Schmidt" at Sep 26, 98 02:14:29 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > An alternative hack (which seems to work and requires very little > > modification -- just 4 lines in the device driver!) is to use the > > device minor number to identify the track, so that you can say > > > > mount -t cd9660 -o -s=3D0 /dev/wcd0tN /cdrom > > > > to mount the n-th track. > > > > In the above you _need_ to specify the "-s=3D0" option to mount_cd9660 > > because otherwise it tries to access the last data track on the disk. > > > > Opinions ? Is this something worth adding to the system ? It is totally > > backward compatible and nonintrusive. > > I think this method is the best one, we can keep the mods in the > atapi-cd devicedriver which still is sortof alpha code. That wont > make it work for SCSI CDROM's, but that just too bad... the diffs for wcd.c are below... atapi-cd.c has similar code, i think it will not take more than five minutes to patch the cdopen() and cdstart() functions in /sys/scsi ... (except that i cannot find the code for cdopen() !) luigi --- wcd.c Tue Jul 7 05:23:28 1998 +++ /sys/i386/isa/wcd.c Sat Sep 26 09:13:54 1998 @@ -225,6 +225,7 @@ struct audiopage aumask; /* Audio page mask */ struct subchan subchan; /* Subchannel info */ char description[80]; /* Device description */ + int starting_lba ; #ifdef DEVFS void *ra_devfs_token; void *rc_devfs_token; @@ -289,12 +290,12 @@ lun = t->lun = wcdnlun++; t->param = ap; t->flags = F_MEDIA_CHANGED; + t->starting_lba = 0; t->refcnt = 0; if (debug) { t->flags |= F_DEBUG; @@ -403,7 +401,7 @@ wcd_open (dev_t dev, int rawflag) { int lun = UNIT(dev); + int track = dkslice(dev); /* XXX */ struct wcd *t; /* Check that the device number is legal @@ -431,6 +458,11 @@ ++t->refcnt; else t->flags |= F_BOPEN; + t->starting_lba = ntohl(t->toc.tab[track].addr.lba) ; + if (track != 0) { + printf("Warning, opening track %d at %d\n", + track, t->starting_lba); + } return (0); } @@ -547,7 +578,7 @@ * First, translate the block to absolute and put it in terms of the * logical blocksize of the device. * What if something asks for 512 bytes not on a 2k boundary? */ - blkno = bp->b_blkno / (SECSIZE / 512); + blkno = t->starting_lba + bp->b_blkno / (SECSIZE / 512); nblk = (bp->b_bcount + (SECSIZE - 1)) / SECSIZE; atapi_request_callback (t->ata, t->unit, ATAPI_READ_BIG, 0, To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message