Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Apr 1997 09:57:29 -0500 (CDT)
From:      Mark Tinguely <tinguely@plains.nodak.edu>
To:        freebsd-hackers@freebsd.org, joerg_wunsch@uriah.heep.sax.de
Subject:   Re: optical drives
Message-ID:  <199704171457.JAA00595@plains.nodak.edu>

next in thread | raw e-mail | index | archive | help
With the media in the machine on boot, I can see that od_get_parms()
can determine the geometry. in fact it is used to create a disklabel.

od_open() calls dsopen() calls dsinit() which calls check_part().

eventhough dsinit() has a label with the correct geometery, it is
looking to verify the geometry by checking the DOS partitions,
but optial drives don't have partitions (?) and we get 0 for the value
of the sector per cylinder. check_part() does not check to see if the
secpercyl is zero before doing an integer divide. This zero value
for secpercyl causes the panic.

The optical drive did not work with the DOS fdisk. I do not know if this
means optical media act like diskettes and do not have DOS partitions or
fdisk is brain dead.

Jim Bryant <jbryant@argus> showed that his optical acts like a drive:

> (ahc0:1:0): "IBM MTA-3230TC2210!B 0" type 0 removable SCSI 2
> sd1(ahc0:1:0): Direct-Access 217MB (446325 512 byte sectors)
> sd1(ahc0:1:0): with 17934 cyls, 1 heads, and an average 24 sectors/track

notice his optical responses as a type 0 device, the drive I was working
with responds as a type 7 SCSI device:

(ahc0:2:0): "MATSHITA PD-1 LF-1000 A106" type 7 removable SCSI 2 634MB (1298496 512 byte sectors)
***od0(ahc0:2:0): Optical sctr = 1298496 dsct = 32 hds = 64
(ahc0:2:1): "MATSHITA PD-1 LF-1000 A106" type 5 removable SCSI 2
cd0(ahc0:2:1): CD-ROM 
cd0(ahc0:2:1): NOT READY asc:3a,0 Medium not present

I added the line starting with *** to get_parms to make sure the geometry
about the media was being reported.

A SCSI type 7 needs to use od0, and that results in the panic anytime
an application does an open on the device.

--mark.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704171457.JAA00595>