Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Nov 1995 14:34:36 -0800 (PST)
From:      Julian Elischer <julian@ref.tfs.com>
To:        charlie_conklin@il.us.swissbank.com (Charlie Conklin)
Cc:        charlie_conklin@il.us.swissbank.com, freebsd-scsi@freebsd.org
Subject:   Re: Getting an optical drive to work
Message-ID:  <199511242234.OAA13797@ref.tfs.com>
In-Reply-To: <9511241010.AA01239@ln1d422iwk> from "Charlie Conklin" at Nov 24, 95 10:10:10 am

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> The first thing I did was add entries to the knowndevs[] of scsiconf.c which
> looked like this:
>         /* Added this one to force my fuji m2521A to device sd */
>         {
>                 T_OPTICAL, T_REMOV, "*", "*", "*",
>                 "sd", SC_ONE_LU
>         },
> and this:
>         /* Added this one to force my fuji m2521A to device sd */
>         {
>                 T_OPTICAL, T_REMOV, "FUJITSU", "any"
>                     ,"any", "sd", SC_ONE_LU
>         },
> 
correct

> for each of the defines (it turns out my kernel is compling with
> NEW_SCSICONF undefined).
> 
yes

> This resulted in no change of behavior :-( So I added a few printf in
> to see what was going on, and the problem is that when
> scsi_device_lookup(int type) is called, it checks the type of the device
> (T_OPTICAL in my case) against the type specified for the particular
> driver (T_DIRECT in the case of the sd driver). Since they never match,
> the uk driver is always defaulted to.
eh? this has been changed by someone.....!
I originally wrote it to specifically over-ride the default
type if the tables said to!
damn!

thanks for pointing this out.!

> 
> What I did was cheat, and make scsi_device_lookup() look like this...
> 
> static struct scsi_device *
> scsi_device_lookup(int type)
> {
>         struct scsi_device *sd;
> 
>         printf("scsi_device_lookup for type:%d\n", type);
>         for (sd = device_list; sd; sd = sd->next) {
>                 printf("scsi_device_lookup:%s:%s:%d to %d\n",
>                        sd->name,
>                        sd->desc,
>                        sd->type, type);
>                 if (sd->type == type ||
>                     (sd->type == T_DIRECT && type == T_OPTICAL)) {
>                         return sd;
>                  }
>         }
> 
>         return &uk_switch;
> }
heh heh!
great to have you aboard!
welcome to the kernel-hacker's club!

> 
> This successfully (kindof) found the optical, and assigned it to sd2.
> 
> Then my boot messages looked like this:
> 
>   ahc0 <Adaptec 294X SCSI host adapter> rev 0 int a irq 9 on pci0:6
>   ahc0: reading board settings
>   ahc0: 294x Single Channel, SCSI Id=7, aic7870, 16 SCBs
>   ahc0: Downloading Sequencer Program...Done
>   ahc0: Probing channel A
>   ahc0 waiting for scsi devices to settle
>   ahc0: target 0 synchronous at 10.0MB/s, offset = 0x8
>   (ahc0:0:0): "COMPAQ C2490A 3184" type 0 fixed SCSI 2
> 
>   standard-
>   COMPAQ-
>   MAXTOR  -
>   COMPAQ-scsi_device_lookup for type:0
>   scsi_device_lookup:cd:CD-ROM:5 to 0
>   scsi_device_lookup:st:Sequential-Access:1 to 0
>   scsi_device_lookup:sd:Direct-Access:0 to 0
>   sd0(ahc0:0:0): Direct-Access 2006MB (4110000 512 byte sectors)
>   ahc0: target 2 synchronous at 4.4MB/s, offset = 0x8
>   (ahc0:2:0): "FUJITSU M2266S-1024 0014" type 0 fixed SCSI 1
> 
>   standard-
>   FUJITSU-
>   MAXTOR  -
>   FUJITSU-scsi_device_lookup for type:0
>   scsi_device_lookup:cd:CD-ROM:5 to 0
>   scsi_device_lookup:st:Sequential-Access:1 to 0
>   scsi_device_lookup:sd:Direct-Access:0 to 0
>   sd1(ahc0:2:0): Direct-Access 1087MB (1113504 1024 byte sectors)
>   ahc0: target 6 synchronous at 5.0MB/s, offset = 0x8
>   (ahc0:6:0): "FUJITSU M2512A 1314" type 7 removable SCSI 2
> 
>   FUJITSU-
>   FUJITSU-
>   any-
>   M2512A-scsi_device_lookup for type:7
>   scsi_device_lookup:cd:CD-ROM:5 to 7
>   scsi_device_lookup:st:Sequential-Access:1 to 7
>   scsi_device_lookup:sd:Direct-Access:0 to 7
>   sd2(ahc0:6:0): Direct-Access
>   sd2(ahc0:6:0): ILLEGAL REQUEST asc:24,0 Invalid field in CDB sks:c0,4
>   sd2 could not mode sense (4). Using ficticious geometry
>   217MB (446325 512 byte sectors)
>   vga0 <VGA-compatible display device> rev 1 on pci0:14
> 
> There is a little cruft there due to my debugging printfs that
> you can ignore. The main thing is that the device was found,
> and assigned, but that it came up with some kind of error. Do
> you have any idea what that means?
yes, it couldn't figure out the geometry, so it decided to make one up
this is ok, because the SCSI code doesn't USE geometry..

you should now be able to use 'disklabel' on your drive
(disklabel -w -r .........)


> 
> Also,  for the heck of it, I tried to mount one of the opticals that
> had a working dos filesystem on it (formatted under Windows NT
> with the DOS FAT filesystem). When I executed the mount:
> 	mount -t msdos /dev/sd2 /mnt
> I could see the optical light go on as it tried to mount it, but it came
> back with:
> 	mount: Invalid argument
The Geometry is important to DOSFdo you know the geometry the BIOS uses?
what does 'fdisk sd2' say?
and disklabel sd2?
(on that platter)

(and for that matter, on a platter which is blank,)


> 
> Any ideas?
> 
> Thanks...
> 
> - Charlie		conklic@swissbank.com
> 
> 




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