EDD safety; calling from userspace

Colin Watson cjwatson at ubuntu.com
Mon Nov 19 13:24:11 GMT 2007


I'm looking at making use of EDD in the Ubuntu installation process.
Ideally, we'd just use the kernel module and have grub fish out the
relevant information from /sys, in what seems to be the intended way.
However, we've had a number of bugs in the past that were due to
CONFIG_EDD being enabled; these claim either long delays during boot, or
complete failure to boot (although in the latter case it could well just
be that the user wasn't patient enough), and I don't want to turn this
on if there's a possibility that it could make Ubuntu (appear to) fail
to boot on a fair proportion of systems. Some references, although
unfortunately none of them are really all that detailed:


Matthew Garrett suggested that the same thing could be done in userspace
with libx86's real mode emulation, so I knocked together a
proof-of-concept test harness (attached for the sake of argument,
although obviously it also needs to do the hard work of correlating EDD
information with PCI bus layout and the like; it also still segfaults
somewhere inside the interrupt emulation on some of my systems, so
there's some way to go; and, er, please ignore the #define __KERNEL__ 1
hack for now). This would conceivably let us blacklist systems known to
have problems, perhaps by distributing a similar test harness widely and
asking users to report back results.

I wondered if you knew whether there have been any relevant fixes for
systems similar to those reported in the bugs above since then? I don't
see anything much interesting in the git history of edd.S - there's just
a fix for ghost devices showing up in /sys/firmware/edd and some
command-line parsing corrections. 

Do you think this is a viable approach in general? Ideally, I'd like to
distribute a standalone tool that does its best to map Linux devices to
BIOS devices independent of kernel support, and then everyone could use
it without having to worry about boot stability - in the worst case we
could just say "Analysing BIOS boot ordering; this may take some time".

Another option which is more viable in userspace is to read out the
whole of the first two sectors (or more). That would include the
partition table and stand a much better chance of being unique; we'd
then only have to look at EDD to disambiguate.


Colin Watson                                       [cjwatson at ubuntu.com]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: edd.c
Type: text/x-csrc
Size: 2269 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/ubuntu-installer/attachments/20071119/390f8063/attachment.c 

More information about the Ubuntu-installer mailing list