*BSD News Article 18910


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!howland.reston.ans.net!xlink.net!fauern!news.tu-chemnitz.de!irz401!uriah!not-for-mail
From: j@bonnie.tcd-dresden.de (J Wunsch)
Newsgroups: comp.os.386bsd.questions
Subject: Re: 2 IDE controllers in one system
Date: 26 Jul 1993 17:23:25 +0200
Organization: Textil Computer Design GmbH, Dresden, Germany
Lines: 107
Message-ID: <230stdINN8fl@bonnie.tcd-dresden.de>
References: <2292i9$qfo@wzv.win.tue.nl>
NNTP-Posting-Host: bonnie.tcd-dresden.de

In article <2292i9$qfo@wzv.win.tue.nl> guido@gvr.win.tue.nl (Guido van Rooij) writes:
>I have heart that it should be possible to have 2 IDE controllers 
>in one ISA-system. I want to do that to allow having 4 IDE fixed disks 
>in my system.
I've set up a configuration with one IDE and one ESDI controller,
essentially the same.
>
>I've got a noname IDE controller on which you can set a jumper
>for which ioports to use for the fixed disks: either 170-177
So feel lucky.
>or 1f0-1f7. However, I can't see a jumper to set the IRQ channel.
>So I'll have to change the IRQ by hand (soldering)
>
>1) what is the default irq channel for the second controller
IRQ 15 (my ESDI controller has a jumper for it)

>2) Is there any special reason why I shouldn't have 2 IDE controllers 
>in general.
No. Except: no msdog user would ever be able to use this:-)
And: SCSI with bus-master DMA would give you better performance,
of course. IDE is still PIO interface.

>3) Are there any other sugestions.
The stock 386BSD wd driver needs fixing. NetBSD folks claim their
driver can use multiple controllers. The fix for 386bsd is as below.
It is still related to the pre-0.2.4 wd.c, but you can get the
picture.
Here's the relevant stuff out of my config file:

controller	wd0	at isa? port "IO_WD1" bio irq 14 vector wdintr
disk		wdk0	at wd0 drive 0
disk		wdk1	at wd0 drive 1

controller	wd1	at isa? port "IO_WD2" bio irq 15 vector wdintr
disk		wdk2	at wd1 drive 0
disk		wdk3	at wd1 drive 1



*** wd.c.pl3	Wed Feb  3 09:52:03 1993
--- wd.c	Wed Jun  9 18:07:57 1993
***************
*** 72,78 ****
  #include "syslog.h"
  #include "vm/vm.h"
  
! #define _NWD  (NWD - 1)       /* One is for the controller XXX 31 Jul 92*/
  
  #define	RETRIES		5	/* number of retries before giving up */
  #define	MAXTRANSFER	32	/* max size of transfer in page clusters */
--- 72,78 ----
  #include "syslog.h"
  #include "vm/vm.h"
  
! #define _NWD  (2 * NWD)		/* each controller can have 2 drives */
  
  #define	RETRIES		5	/* number of retries before giving up */
  #define	MAXTRANSFER	32	/* max size of transfer in page clusters */
***************
*** 157,165 ****
  	struct disk *du;
  	int wdc;
  
! 	if (unit >= _NWD)				/* 31 Jul 92*/
  		return(0);
  
  	if ((du = wddrives[unit]) == 0) {
  		du = wddrives[unit] = (struct disk *)
  			malloc (sizeof(struct disk), M_TEMP, M_NOWAIT);
--- 157,167 ----
  	struct disk *du;
  	int wdc;
  
! 	if (unit >= NWD)
  		return(0);
  
+ 	unit *= 2;	/* drive 0 of each controller */
+ 
  	if ((du = wddrives[unit]) == 0) {
  		du = wddrives[unit] = (struct disk *)
  			malloc (sizeof(struct disk), M_TEMP, M_NOWAIT);
***************
*** 202,210 ****
  wdattach(struct isa_device *dvp)
  {
  	int unit;
! /*	int unit = dvp->id_unit;*/
  
! 	for (unit=0; unit< _NWD; unit++) {
  		struct disk *du;
  		if ((du = wddrives[unit]) == 0) {
  			du = wddrives[unit] = (struct disk *)
--- 204,212 ----
  wdattach(struct isa_device *dvp)
  {
  	int unit;
! 	int ctrlr = dvp->id_unit;
  
! 	for (unit = ctrlr * 2; unit < (ctrlr + 1) * 2; unit++) {
  		struct disk *du;
  		if ((du = wddrives[unit]) == 0) {
  			du = wddrives[unit] = (struct disk *)
-- 
in real life: J"org Wunsch |   )  o o  | primary: joerg_wunsch@tcd-dresden.de
above 1.8 MHz:   DL 8 DTL  |    )  |   | private: joerg_wunsch@uriah.sax.de
                           | . * ) ==  |
          ``An elephant is a mouse with an operating system.''