Subject: Re: atapi driver for -current
To: None <roskens@cs.umn.edu>
From: Jeff Thieleke <thieleke@lust.isca.uiowa.edu>
List: port-i386
Date: 06/08/1996 04:29:58
> > I've updated the files at ftp://lix.polytechnique.fr/pub/manu. There
> > is no functionnal changes, I've just updated the -current diffs, so that
> > they can be applied to 1.2ALPHA. Also, note that the new 'official' site is
> > now ftp://ftp.ensta.fr/pub/NetBSD/atapi/. The diffs at 
> > ftp://lix.polytechnique.fr/pub/manu are still up to date (and polytechnique.fr
> > has a better link to the internet than ensta.fr), but I certenly will lose my
> > acces to lix in 3 or 4 months, so I prefer give the two URL for
> > now.
> 
> I've tried it but have been unable to mount anything.
> I've tried two msdos cds, and one cd9660, which is unsupported apparently.
> 
> I could eject from the drive though. 8)
> 
> I toggled ATAPI_DEBUG and found that during bootup, there is a phase 1 check.
> That fails, as there is no phase 1. It appears that the end result is a
> atapi_exec_cmd failure.
> 
> My CDROM drive is a:
> atapibus1 drive0: <GCD-R542B, , 1.40> cdrom, removeable.


I had the damnest time getting this working, but when I did, it works
great! :)  

I actually don't have any FFS format CDROMs (is there such a thing?), but
I was able to test quite a few ISO9660 format disks, including the
Windoze95 installation disk, MSOffice95, and Flight Simulator 5.1.  The
driver works very well, even under some heavy access.

As for your cd9660 problem, make sure it the cd9660 file system is in your
kernel's conf file.  If so, 'mount -t cd9660 -o ro /dev/acd0a /mountpoint'
should work (it does for me).


I noted two things that might help you:

1. It seems to be best to leave the IRQ at 15, if you are using wdc1, as
   in the patched GENERIC files.  I tried it at 11 and it didn't work.
   When trying to eject the disk with IRQ 11, I get:

  acd: open
  atapi_exec_cmd: sleeping
  wdc1(atapibus1): lost interrupt
  wdc1(atapibus1): lost interrupt
  wdc1(atapibus1): lost interrupt
  wdc1(atapibus1): lost interrupt
  wdc1(atapibus1): lost interrupt
  atapi_done
  acd0(wdc1:0): illegal length indication, command:  0  0  0  0  0  0  0 0
  0  0  0  0
  calling private done
  atapidone: wakeup acp
  atapi_exec_cmd: done sleeping
  atapi_free_pkt: calling private start
  acd: acdstart


2. As the above diagonstics show, I could only get the driver working with
   some of the debugging #defines defined.  Specifically, add the
   following to your kernel conf file:

  options 	ATAPI_DEBUG_PROBE
  options	ATAPI_DEBUG
  options	ACD_DEBUG



I too have the phase 1 problem, but it doesn't seem to affect anything.  I
get it even on my working kernels.  But it seems you are SOL when you get
the 'atapi_exec_cmd failed' error.  I get that when I don't have the above
set of debugging options. 




For debugging info, here are my kernel messages for a working kernel:

wdc0 at isa0 port 0x1f0-0x1f7 irq 14
wd0 at wdc0 drive 0: 1039MB, 2112 cyl, 16 head, 63 sec, 512 bytes/sec <QUANTUM FIREBALL1080A>
wd0: using 8-sector 16-bit pio transfers, lba addressing
atapibus0 at wdc0
wdc1 at isa0 port 0x170-0x177 irq 15
atapibus1 at wdc1
Warning drive 0 returned 142/512 of indentify device data
atapibus1 drive0: <NEC                 CD-ROM DRIVE:273, , 4.21> cdrom, removable.
acd0 at atapibus1 drive 0: wdc_atapi_intr: unknown phase 1
atapi_free_pkt: calling private start
acd: acdstart
wdc_atapi_intr: unknown phase 1
atapi_free_pkt: calling private start
acd: acdstart
atapi_free_pkt: calling private start
acd: acdstart
medium type unknown
^^^^^^^^^^^^^^^^^^^
ocassionally, I get a "unknown medium type=0x6c" error.





Jeff Thieleke