Fix dumpfs kernel. case 1: IDE0=primary=disk IDE1=primary=disk IDE1=secondary=disk filsys main ch0f{h2h3} -> panic: ataxfer: sdunits[3].subno is 0, not 1 case 2: install SATA-RAID cards. this card has 4port 2controllers. card1=ctlr0=port0=disk card1=ctlr1=port0=disk card2=ctlr0=port0=disk auto detect: ata h4 ... ata h4 ... ata h4 ... all h4? filsys main ch4f{h6h8} -> panic: ataxfer: sdunits[4].dev=$p1 is wrong controller (want $p2) Notes: Sat May 5 17:47:18 EDT 2007 geoff The first case should be fixed; the second is a problem because we've defined ide device names to be either h. or h where is *2+, so more than two drives per controller won't work. It's also not obvious to me how one would address more than two drives when talking to the controller. Reference: /n/sources/patch/sorry/fs-ata Date: Sat May 5 16:25:47 CES 2007 Signed-off-by: lufia1@gmail.com Reviewed-by: geoff --- /sys/src/fs/pc/sdata.c Sat May 5 16:09:56 2007 +++ /sys/src/fs/pc/sdata.c Sat May 5 16:09:47 2007 @@ -778,15 +778,13 @@ } static Drive* -atagetdrive(int cmdport, int ctlport, int dev) +atagetdrive(int cmdport, int ctlport, int dev, int driveno) { Drive *drive; - int as, i, pkt, driveno; + int as, i, pkt; uchar buf[512], *p; ushort iconfig, *sp; - driveno = (cmdport == Ctlr0cmd? 0: - cmdport == Ctlr1cmd? NCtlrdrv: 2*NCtlrdrv); if (dev == Dev1) driveno++; @@ -1026,7 +1024,7 @@ * If the one drive found is Dev0 and the EDD command * didn't indicate Dev1 doesn't exist, check for it. */ - if((drive = atagetdrive(cmdport, ctlport, dev)) == nil) + if((drive = atagetdrive(cmdport, ctlport, dev, drivenum)) == nil) goto release; if((ctlr = malloc(sizeof(Ctlr))) == nil){ free(drive); @@ -1039,6 +1037,7 @@ goto release; } memset(sdev, 0, sizeof(SDev)); + sdev->index = drivenum; drive->ctlr = ctlr; atactlr[drivenum/NCtlrdrv] = ctlr; @@ -1055,7 +1054,7 @@ * Ataprobe is the only place possibly invalid * drives should be selected. */ - drive = atagetdrive(cmdport, ctlport, Dev1); + drive = atagetdrive(cmdport, ctlport, Dev1, drivenum-1); if(drive != nil){ drive->ctlr = ctlr; ctlr->drive[1] = drive; @@ -2533,7 +2532,7 @@ i = sdpp - sdevs; sdp->ifc = &sdataifc; sdp->nunit = NCtlrdrv; - sdp->index = i; + //sdp->index = i; sdp->idno = 'C' + i; sdp->ctlr = atactlr[i]; if (sdp->ctlr != nil)