Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Mar 1997 00:11:03 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        dgy@rtd.com, terry@lambert.org
Cc:        bde@zeta.org.au, hackers@freebsd.org, helbig@MX.BA-Stuttgart.De
Subject:   Re: wd driver questions
Message-ID:  <199703171311.AAA12416@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>Yes, I don't understand why FBSD can't just use the same geometry
>settings that boot.c deduces?  Are the BIOS ROMs no longer accessible
>once boot() has completed (sorry, my ignorance is showing...)?

The ROMs are completely inaccessible, but that isn't the problem since
the geometry of all drives known to the BIOS (actually, only the first
10) is passed from boot.c to the kernel.  The problems are:

1. some drives may not be known to the BIOS
2. the kernel has no way of knowing to correspondence between BIOS drive
   numbers and FreeBSD drive names.  It could do the same thing as boot.c,
   which is to guess, and if the guess doesn't work then require the user
   to type in the correspondence, e.g.,

   	1:sd(0,a)
   	^ ^^^^ (BIOS drive number 1 = FreeBSD drive name sd0)

   boot.c could pass the mapping for the boot drive, but the kernel would
   have to do it for the other drives.  This is not much simpler for users
   than just typing in the correct geometry.

>> equal, it doesn't matter.  Where it seems to matter, you can look
>> for the FreeBSD partition, the DOS boot block to find the boot device,
>> or, if all else fails, ask the user (instead of asking by default).
>
>Why *should* there be a difference?  I would assume that you would
>err on the side of adhering to the BIOS geometry -- wouldn't
>adopting some *other* geometry make it tough (impossible?)
>to have a DOS partition on the same drive as FBSD and be able to
>*access* that DOS partition from FBSD?

The driver just uses the geometry reported by the drive.  This is simple
and works in all known cases where the drive reports it geometry.  There
is no reason to use the same geometry as the BIOS and many reasons not
to (e.g., the BIOS can't handle more than 1024 cylinders and some BIOSes
can't translate so that there are <= 1024 cylineders, and some translations
waste a lot of disk space, and translation is impossible for disks larger
than about 8GB (except by wasting everything above 8GB)).

>> Also if it is writing C/H/S values for use by the DOS MBR to get to
>> the BSD second stage boot, since the DOS MBR (incorrectly) looks at
>> the C/H/S values instead of the LBA values (since the DOS MBR has the
>> DOS geometry available, factoring an LBA to a C/H/S value is easy for
>> it to do, but it is too badly designed to do that).
>
>I think this is the problem I've currently been having -- DOS thinks
>the drive is 611/16/63 but FBSD reINITs it to 790/15/57.  It's been
>tough trying to get DOS and FBSD to fit onto the same drive...

I don't see any problem.  The BIOS geometry is 611/16/63 for some reason
(probably the BIOS is old and can't translate to > 16 heads).  You must
use the BIOS geometry in fdisk.  The geometry used elsewhere is almost
arbitrary.  The driver uses 790/15/57 for simplicity.  It prints 790/15/57
because that's the only one that it knows about.  Don't use this in fdisk
if it differs from the BIOS geometry.  OTOH, you may note that the BIOS
goemetry wastes about 30MB:

	790*15*57 = 675450
	611*16*63 = 615888
	wasted     = 59562

You can probably use these sectors for a non-DOS non-bootable partition
by telling fdisk that the geometry is 612/16/63 and being careful not
to use the nonexistent part of the last "cylinder".

Your probably may actually be that the drive is jumpered to force
611/16/63 and broken so that it still reports 790/15/57.  Some ESDI
drives had this problem.  I hope they are dead now (one I bought in
1990 cost 4 times as much as a modern IDE drive for 1/12 as much space,
1/10 as much performance, and 1/10 as much reliability).

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199703171311.AAA12416>