Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 May 1996 11:51:03 +0200
From:      Marco Masotti <mc7953@mclink.it>
To:        questions@freebsd.org
Cc:        mc7953@mclink.it
Subject:   RE: atapi-cdrom as master
Message-ID:  <31A82987.41C67EA6@mclink.it>

next in thread | raw e-mail | index | archive | help
I've never been able to utilize my ATAPI Cdrom drive with 2.1R or stable
with a fairly old hardware I own.

However, just applying the patch below copied, I've at last got my CD
unit working. I believe also that the patch is really a a sort of
"cut"... but in my case it did work well.

With the recurring problems in handling ATAPI drives, I considered
patching the wd.c code, despite I've seen no reply (unless I missed some
message around) to the Werner article, in the positive or negative.

Since I'm somewhat believing that such a patch is temporary palliative
to a real problem, can someone state what negative impact could this fix
lead to?

My hardware is:

SiS 486 P3 Green PC (bios 24/12/1994), 24Mram, Intel 486 Overdrive DX4
IDE controller P2630VL
ATAPI Mtsumi FX400 Cd drive

The primary controller has two hard disks installed
The secondary one has only the CD drive as master.


Regards, Marco

>
> From: Werner Griessl <croot@btp1da.phy.uni-bayreuth.de>
> Date: Fri, 3 May 1996 10:19:13 +0000 ()
> Subject: atapi-cdrom as master
> 
> 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
> 
> ------------------------------
> 
> End of questions-digest V1 #805
> *******************************



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?31A82987.41C67EA6>