Subject: Re: Old bug, who'll fix it?
To: None <port-atari@NetBSD.ORG, leo@ahwau.ahold.nl>
From: Waldi Ravens <waldi@moacs.indiv.nl.net>
List: port-atari
Date: 11/27/1995 16:04:38
Hi Leo,

> > $ disklabel cd0a
> > # /dev/rcd0a:
> > type: SCSI
> > disk: SCSI CD-ROM
> > label: fictitious
> > flags: removable
> > bytes/sector: 2048
> > sectors/track: 100
> > tracks/cylinder: 1
> > sectors/cylinder: 100
> > cylinders: 2950
> > rpm: 300
> > interleave: 1
> > trackskew: 0
> > cylinderskew: 0
> > headswitch: 0		# milliseconds
> > track-to-track seek: 0	# milliseconds
> > drivedata: 0 
> > 
> > 3 partitions:
> > #        size   offset    fstype   [fsize bsize   cpg]
> >   a:  1179604        0   ISO9660                    	# (Cyl.    0 - 11796*)
> >   c:  1179604        0   ISO9660                    	# (Cyl.    0 - 11796*)
> > disklabel: boot block size 0
> > disklabel: super block size 0
> > disklabel: partition a: partition extends past end of unit
> > disklabel: partition c: partition extends past end of unit
> > 
> > 
> > Now why does this give me the impression that someone still believes
> > that DEV_BSIZE is not a bug, but a feature. :-)
>
> I think the bug is caused by the code in sys/scsi/cd.c, I saw a line
> calculating the number of cylinders that says:
> 	lp->d_ncylinders = (cd->params.disksize / 100) + 1;
> given that the number of sectors/cylinders is fixed at 100 (can also be
> deduced from the above statement), this will nearly always give you an
> invalid label.
> I'm not sure what the 'correct' solution is here. You could say, the number
> of sectors/cylinder & sectors/track is fixed to 1. In this case this would
> yield 294901 cylinders.

I think, the bug is that the partition size is expressed in DEV_BSIZE
units, rather than # of sectors. The partition size should have been
(1179604*DEV_BSIZE/secsize) => 294901, which is less than 2950*100.


Waldi