Date: Fri, 22 Mar 1996 11:00:18 -0700 (MST) From: Terry Lambert <terry@lambert.org> To: joerg_wunsch@uriah.heep.sax.de Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Adding a damn 2nd disk Message-ID: <199603221800.LAA02908@phaeton.artisoft.com> In-Reply-To: <199603220748.IAA17322@uriah.heep.sax.de> from "J Wunsch" at Mar 22, 96 08:48:07 am
next in thread | previous in thread | raw e-mail | index | archive | help
> > In any case, a linear congruential search for the boundry conditions > > followed by a binary search could easily find the last sector on > > any device for you. This is what is done in a partition recognition > > TSD under Win95. > > How big is the chance that this will jam an good ol' ``dumb'' drive? > (Seeking beyond the last cylinder, that it is.) I remember well the > times where people gave the advice in Usenet to ``put a business card > into the floppy drive'' to stop it from jamming. This was due to a > too aggressive floppy tape driver. A plain binary search will fail at twice address wrap boundry; that's why you can't start at 32 bit and work down with a vanilla binary search. There is a possibility for failure on MFM drive in excess of 8G... seen one of those, ever? If you disallow the possibility, the problem goes away (and IDE controllers respond to geometry requests, so they aren't a problem). You can make the assumption, based on drive type, and you can make the drive type assumption in the controller driver (since a controller can only push drives of a specific type). So you linear search the boundry ranges where errors are possible, and only include those areas which respond positively immediately below the boundry. This will *always* give you the drive size, in sectors. I haven't seen a "jam" for an illegal address. I'd find it hard to believe one could occur if you never went too far past the addressable range (to the point where it's ignoring address bits). As far as I've been able to determine, the only potential problem is a false positive on address bits -- ie: the address range wraps and a simple binary search fails to note the gaps in the address space (which is why you must do the other search first). If you can show me a drive with exactly N cylinders, where log2(N) is 12 or 16, and the controller is also flawed such that the 13th or 17th bit is treated as 0 in all cases, then I can show you a drive that will fail. Of course, the BIOS drive table and the CMOS drive type can be used to handle these cases as well (the largest MFM drives typically have 9 heads, which isn't an even power of 2), since only the number of cylinders will be increased... the heads and sectors must remain invariant. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199603221800.LAA02908>