Path: utzoo!mnetor!uunet!husc6!think!ames!ptsfa!ihnp4!occrsh!uokmax!rmtodd From: rmtodd@uokmax.UUCP (Richard Michael Todd) Newsgroups: comp.os.minix Subject: Re: Hard Disk Problems Message-ID: <1055@uokmax.UUCP> Date: 20 Feb 88 06:36:52 GMT References: <998@bcd-dyn.UUCP> Reply-To: rmtodd@uokmax.UUCP () Organization: University of Oklahoma, Norman, OK Lines: 50 Keywords: Minix WD Hard Disk Problems Summary: There is a bug in the autoconfig code. In article <998@bcd-dyn.UUCP> sas@bcd-dyn.UUCP (432 2370.00) writes: >I'm still having problems with my western digital wd1002s-wx2 hard disk >and tandon tm262 combination. Is anyone running MINIX on hard disk #2? Yes and no. I've got the second hard disk partitioned into two partitions, 18.5M for DOS and 1.5M for MINIX. Currently I'm not doing anything much with the MINIX partition, but I did do a mkfs on /dev/hd7 and it worked fine. I should note that there is a bug in the wd_wini.c driver code, as I mention below. I'm using a WD controller with two Seagate ST225 drives. >Using drivers /dev/hd5-9? Using standard 1.2 Minix, I can only get the >os to recognize the drive as /dev/hd5, it doesn't even access the disk >when I try to use partitions 6-9. Using hd5, I can only mkfs about 1/2 >of the 20 meg disk. I fixed the AUTO_CONFIG definition, but my controller >isn't an autoconfig version, so that doesn't help, although that version There is a bug in the code to handle AUTO_CONFIG in a two-drive system. The code in wd_wini.c gets the info on the configuration of drive C from the first sector on the drive (the info is in a 16 byte table). One would expect that when the BIOS variable for "# of hard drives" was two, it would proceed to read the first sector of drive D to get its config information. It doesn't. It instead copies the next 16 bytes of the drive C config sector (the ones after the table for drive C) into the structure for drive D. It thus uses garbage values for the drive D parameters and the attempt to read drive D's partition table using these bogus parameters causes a kernel panic. I suspect that the intent of the code's author was to handle WD's "logical drive" scheme, where a single physical drive is partitioned into two logical drives, and apparently the config. info on both logical drives is stored in the first sector of the physical drive. But when you have two physical hard disk drives, the code bombs. I took the easy way out and patched wd_wini.c so that the parameters used for drive D were simply copied from those for C. I can get away with that since my two drives are both ST225s and thus have the same parameters. Obviously this isn't quite the problem you're experiencing, since you don't have an autoconfig controller and your system will at least boot, even though it doesn't correctly access drive D. However it shouldn't be two surprising that if they got the auto_config code wrong, the code for the non-auto-config case might be broken as well. One thing you might do is install debugging code in wd_wini.c to see just exactly what the driver thinks the drive parameters and partition tables are for both drives. There's an array of structures indexed by hard drive number for drive parameters and an array of structures indexed by partition number for the partition info. Sorry I don't remember what the names are, but they're fairly easy to find. As I said, I haven't used drive D extensively under MINIX, but I did check to see that "od -c /dev/hd5", "od -c /dev/hd6", etc., did read the right portions of the hard disk, and I did successfully mkfs on /dev/hd7. -------------------------------------------------------------------------- Richard Todd USSnail:820 Annie Court,Norman OK 73069 UUCP: {allegra!cbosgd|ihnp4}!occrsh!uokmax!rmtodd