From owner-freebsd-questions Fri May 3 01:19:26 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id BAA10735 for questions-outgoing; Fri, 3 May 1996 01:19:26 -0700 (PDT) Received: from btp1da.phy.uni-bayreuth.de (btp1da.phy.uni-bayreuth.de [132.180.20.32]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id BAA10718 for ; Fri, 3 May 1996 01:19:21 -0700 (PDT) Received: (from root@localhost) by btp1da.phy.uni-bayreuth.de (8.7.5/8.6.12) id KAA15531 for questions@freebsd.org; Fri, 3 May 1996 10:19:14 GMT From: Werner Griessl Message-Id: <199605031019.KAA15531@btp1da.phy.uni-bayreuth.de> Subject: atapi-cdrom as master To: questions@freebsd.org Date: Fri, 3 May 1996 10:19:13 +0000 () X-Mailer: ELM [version 2.4ME+ PL15 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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; lunitdk_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