From owner-freebsd-hackers Fri Jun 16 19:07:27 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id TAA27881 for hackers-outgoing; Fri, 16 Jun 1995 19:07:27 -0700 Received: from cs.weber.edu (cs.weber.edu [137.190.16.16]) by freefall.cdrom.com (8.6.10/8.6.6) with SMTP id TAA27875 for ; Fri, 16 Jun 1995 19:07:25 -0700 Received: by cs.weber.edu (4.1/SMI-4.1.1) id AA14001; Fri, 16 Jun 95 20:00:35 MDT From: terry@cs.weber.edu (Terry Lambert) Message-Id: <9506170200.AA14001@cs.weber.edu> Subject: Re: HD Geometry dirty trick To: aflundi@sandia.gov (Alan F Lundin) Date: Fri, 16 Jun 95 20:00:34 MDT Cc: freebsd-hackers@freebsd.org In-Reply-To: <199506162115.PAA17715@sargon.mdl.sandia.gov> from "Alan F Lundin" at Jun 16, 95 03:15:34 pm X-Mailer: ELM [version 2.4dev PL52] Sender: hackers-owner@freebsd.org Precedence: bulk > > > Does this mean that it's possible that every distinct > > > BIOS could produce a different geometry for a given disk > > > drive, so that there is no way to predict via an algorithm > > > for all machines what the BIOS geometry should be? Bummer! > > > > Yes. Generally, it's on a per controller ROM revision basis, and > > is not specific to internal machine BIOS. It gets the general name > > of "BIOS" because the POST routines on the card point the INT 13 > > interface to their own ROMs, replacing/chaining the default BIOS. > > > > And there's no way to ask... there's a way to figure it out that mostly > > works, but which can run into LCF problems. > > If there's no way to ask, how does DOS do it? DOS *always* communicates via INT 21 calls (the file I/O interface) or INT 13 calls (the raw disk interface). INT 21 is a consumer of INT 13. Since the translation is done by software at INT 13, DOS never has a problem. Our problem comes from teh fact that we are a protected mode OS and so do not use the INT 13 interface (you can only make BIOS calls from protected mode if you have a protected mode BIOS or if you use a virtual x86 -- VM86 -- interface). The problem with a quick VM86 hack is that it would not fix the problem entirely, since the INT 13 is hooked in BIOS POST initialization order, and there's no way to ask it what it is. At that point, we would know the fictitios geometries of all devices, but we (still) would not be able to match the BIOS devices to the BSD devices (which show up in probe order). To complete the fix requires two pieces: the first is a "fallback" driver that uses a VM86 to do all of its disk I/O, period. This will acause BSD to work on all hardware DOS works on, though some issues of secondary drives will exist. Specifically, if two controllers have BIOS translations active, there will be an issue of figuring out devices after the first two on the controller. The second piece is a crc (or other mechanism) to ask the disks which is which by comparing their contents. Obviously, this would not fit in the current bootblocks. Terry Lambert terry@cs.weber.edu --- Any opinions in this posting are my own and not those of my present or previous employers.