From owner-freebsd-hackers Thu Apr 17 07:57:38 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id HAA05551 for hackers-outgoing; Thu, 17 Apr 1997 07:57:38 -0700 (PDT) Received: from plains.nodak.edu (tinguely@plains.NoDak.edu [134.129.111.64]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id HAA05545 for ; Thu, 17 Apr 1997 07:57:35 -0700 (PDT) Received: (from tinguely@localhost) by plains.nodak.edu (8.8.5/8.8.5) id JAA00595; Thu, 17 Apr 1997 09:57:29 -0500 (CDT) Date: Thu, 17 Apr 1997 09:57:29 -0500 (CDT) From: Mark Tinguely Message-Id: <199704171457.JAA00595@plains.nodak.edu> To: freebsd-hackers@freebsd.org, joerg_wunsch@uriah.heep.sax.de Subject: Re: optical drives Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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 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.