Skip to contentSkip to conversation

multiboot2 loader

RFC PATCH New Hollis Blanchard 1 participant 1 message Feb 21, 2007

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 multiboot2 loader

This patch implements multiboot2 loading, as described at
http://grub.enbug.org/MultibootDraft . I have included the architecture-independent infrastructure as well as the PowerPC-specific code. I have tested it by booting PowerPC Xen (with modifications to parse the multiboot tag list).

Right now I have implemented it as a completely separate command from the old i386 "multiboot" command. I was thinking it would be better to merge them into a single "multiboot" command that choose a loader based on the magic number found in the kernel header, but I'm not sure what the best interface is for the inter-module calls. I will not be checking it in until I come up with a solution.

I implemented the "module type" field we discussed on this list as a fixed 36-char field, and I'm using that in Xen to find the dom0 kernel. I think the GRUB commandline interface could be more friendly though.

Most of the work is in loader/multiboot2.c and
loader/powerpc/ieee1275/multiboot.c .

Comments and suggestions welcome.

conf/powerpc-ieee1275.rmk +13 -0
Index: grub2-cvs/conf/powerpc-ieee1275.rmk
===================================================================
@@ -86,6 +86,8 @@ grub_install_SOURCES = util/powerpc/ieee
 pkgdata_MODULES = halt.mod \
 	_linux.mod \
 	linux.mod \
+	_multiboot2.mod \
+	multiboot2.mod \
 	normal.mod \
 	reboot.mod \
 	suspend.mod
@@ -100,6 +102,17 @@ linux_mod_SOURCES = loader/powerpc/ieee1
 linux_mod_CFLAGS = $(COMMON_CFLAGS)
 linux_mod_LDFLAGS = $(COMMON_LDFLAGS)
 
+# For _multiboot2.mod.
+_multiboot2_mod_SOURCES = loader/multiboot2.c \
+	loader/powerpc/ieee1275/multiboot2.c
+_multiboot2_mod_CFLAGS = $(COMMON_CFLAGS)
+_multiboot2_mod_LDFLAGS = $(COMMON_LDFLAGS)
+
+# For multiboot2.mod.
+multiboot2_mod_SOURCES = loader/multiboot2_normal.c
+multiboot2_mod_CFLAGS = $(COMMON_CFLAGS)
+multiboot2_mod_LDFLAGS = $(COMMON_LDFLAGS)
+
 # For normal.mod.
 normal_mod_DEPENDENCIES = grub_script.tab.c grub_script.tab.h
 normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c	\
include/grub/powerpc/ieee1275/multiboot.h deleted +0 -184

184 lines not on this page · raw message

include/multiboot2.h new file +108 -0

108 lines not on this page · raw message

include/grub/multiboot2.h new file +51 -0

51 lines not on this page · raw message

loader/multiboot2.c new file +481 -0

481 lines not on this page · raw message

loader/powerpc/ieee1275/multiboot2.c new file +120 -0

120 lines not on this page · raw message

loader/multiboot2_normal.c new file +63 -0

63 lines not on this page · raw message

Signature · 2 lines
Hollis Blanchard
IBM Linux Technology Center