Port-i386 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [patch] improved multiboot support in kernel and boot(8)



rjs%fdy2.demon.co.uk@localhost wrote:

The existing multiboot code was only intended to be enough to load Xen,
the expectation was that native kernels would still be loaded using
the old method.

But the NetBSD kernel is also multiboot-compliant.  Wouldn't it be
better if multibooting the kernel from the boot-loader also worked?

What is the benefit of adding your patch ?

Let me quote the boot(8) man page [1]:

   NetBSD multiboot kernels
           A NetBSD kernel that was built with options MULTIBOOT
           (see multiboot(8)) may be booted with either the boot
           or multiboot command, passing the same arguments in
           either case.

   Non-NetBSD kernels
           A kernel for a non-NetBSD operating system that expects
           to be booted using the multiboot protocol (such as by
           the GNU ``GRUB'' boot loader) may be booted using the
           multiboot command.  See the foreign operating system's
           documentation for the available arguments.

IMHO, the patch makes the implementation closer to the man page.

To properly set the boot_device field of the MBI, the DOS partition
number is now stored in the biosdisk structure in biosdisk.c.

What happens if there is no DOS partition table on the boot disk ?

Indeed, this is a delicate point.  I find the multiboot specification
ambiguous on the boot_device field (section 3.3 in [2]).  I asked on the
grub-devel mailing list [3], but I did not get any answer yet.  The way
GRUB does it would give a clue, but I couldn't make GRUB accept disks
that only have a NetBSD disklabel.

So the patch makes the following choice (which is consistent with the
kernel part):

- the NetBSD disklabel partition (a, b, ...) shall always be part2,
  whether the NetBSD disklabel is top-level or contained in a DOS
  partition.

- the DOS partition number is stored in part1, and this field defaults
  to 0xFF if there is no DOS partition table.

- part3 is set to 0xFF.

An alternative solution would be to store the NetBSD disklabel partition
in part1 (and set part2 = part3 = 0xFF) when the NetBSD disklabel is the
top-level one.

What do you think?

Grégoire

[1] http://netbsd.gw.com/cgi-bin/man-cgi?boot++NetBSD-current
[2] http://www.gnu.org/software/grub/manual/multiboot/multiboot.html
[3] http://lists.gnu.org/archive/html/grub-devel/2010-01/msg00351.html


Home | Main Index | Thread Index | Old Index