[syslinux] BIOS disk geometry and Linux 2.6

Michael_E_Brown at Dell.com Michael_E_Brown at Dell.com
Thu Feb 26 20:04:03 PST 2004


Yes, it may give you this info, but that info is absolutely useless. Here is
why (and just to be fair, I'll even tell you how to fix it)

Problem:
	Once you have booted Linux, you have absolutely, positively, no way
of determining which Linux device the geometry that you got from BIOS refers
to. You know that BIOS device 0x80 has geometry xxxx/255/63. But you do
_not_ know with any certainty which exact Linux /dev/hdX or /dev/sdX that
corresponds to. You may think you do, but there exist many, many exceptions
that will absolutely kill you.

Here is how you fix it:
	Unfortunately, you cannot fix it without a little help from
userspace. You need a way of knowing which Linux device bios disk 0x80 is.
There are two ways to do this.
	First, BIOS EDD 3.0. The thing that EDD 3.0 gives you is PCI
bus/dev/fun information. You can write a small userspace utility to parse
this info and find the matching linux device. You then 'fix' the geometry
from userspace.
	Failing EDD 3.0 (assuming EDD 1.0), you can use the disksig patch
(recently accepted into both 2.4 and 2.6). This is less reliable, and you
may have to write to disks and reboot. What happens is that Linux early
16-bit boot reads bios dev 0x80 and stores the 32 bits at offset 0x1B8,
which is reserved for a "unique" signature. It stores this info in
empty-zero-page and exports this info in /proc or /sysfs. Userspace can then
search all linux devices at this offset for this signature. IFF you find
exactly one disk with a matching signature, you can then fixup the geometry.

This is the short version. Hopefully I have been clear enough. Search
linux-kernel for disksig to find recent discussion from when Matt Domsch
submitted the patch to l-k.

--
Michael

-----Original Message-----
From: H. Peter Anvin [mailto:hpa at zytor.com] 
Sent: Thursday, February 26, 2004 9:00 PM
To: Brown, Michael E
Cc: Patrick J. LoPresti; syslinux at zytor.com
Subject: Re: [syslinux] BIOS disk geometry and Linux 2.6


Michael Brown wrote:
> The vast majority of bios/adapters do not support EDD at this time.

Probably not EDD 3.0, but you should only need EDD 1.0 (which they 
pretty much all support) in order to get the geometry info, right?

	-hpa




More information about the Syslinux mailing list