Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 May 1996 10:19:13 +0000 ()
From:      Werner Griessl <croot@btp1da.phy.uni-bayreuth.de>
To:        questions@freebsd.org
Subject:   atapi-cdrom as master
Message-ID:  <199605031019.KAA15531@btp1da.phy.uni-bayreuth.de>

next in thread | raw e-mail | index | archive | help

Last week I got my atapi-cdrom-drive and had some problems with
my FreesBSD-2.1R .
The kernel detected the drive only as slave on the IDE-port.
Unfortunately with this configuration (disk master, cdrom slave)
the disk transfer slows down by a factor of 2.

So I had a look into the source of wd.c and voila, a few changes to
wd.c made the cdrom-drive working on the second IDE-port as master drive !

Here is the patchfile (hopefully not only working for me) :

---------- cut here and copy to wd.c.patch -----------------------------
*** wd.c.ori	Fri May  3 08:16:31 1996
--- wd.c	Fri May  3 08:44:31 1996
***************
*** 480,500 ****
  		} else {
  			free(du, M_TEMP);
  			wddrives[lunit] = NULL;
! 		}
! 	}
  #ifdef ATAPI
! 	/*
! 	 * Probe all free IDE units, searching for ATAPI drives.
! 	 */
! 	for (unit=0; unit<2; ++unit) {
! 		for (lunit=0; lunit<NWD && wddrives[lunit]; ++lunit)
! 			if (wddrives[lunit]->dk_ctrlr == dvp->id_unit &&
! 			    wddrives[lunit]->dk_unit == unit)
! 				goto next;
  		atapi_attach (dvp->id_unit, unit, dvp->id_iobase,
  			&kdc_wdc[dvp->id_unit]);
- next:   }
  #endif
  	/*
  	 * Discard any interrupts generated by wdgetctlr().  wdflushirq()
  	 * doesn't work now because the ambient ipl is too high.
--- 480,496 ----
  		} else {
  			free(du, M_TEMP);
  			wddrives[lunit] = NULL;
! 
! /* included werner@btp1da.phy.uni-bayreuth.de (29.4.1996) */
  #ifdef ATAPI
! 		/* no disk !, search for ATAPI drive */
  		atapi_attach (dvp->id_unit, unit, dvp->id_iobase,
  			&kdc_wdc[dvp->id_unit]);
  #endif
+ 
+ 		}
+ 	}
+ 
  	/*
  	 * Discard any interrupts generated by wdgetctlr().  wdflushirq()
  	 * doesn't work now because the ambient ipl is too high.
----- then do a "patch < wd.c.patch" and recompile the kernel -----------

This should also work in STABLE (the wd.c is the same as in Release)

Werner




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