From 062cdbc1ca22c1cfb5c984da0872c18f1ce97036 Mon Sep 17 00:00:00 2001 From: BVK Chaitanya Date: Mon, 10 May 2010 13:50:43 +0530 Subject: [PATCH] added i386-multiboot support --- configure.common | 7 +++++-- gentpl.py | 5 +++-- grub-core/Makefile.kernel | 11 +++++++++++ grub-core/modules.def | 25 ++++++++++++++++++++++++- 4 files changed, 43 insertions(+), 5 deletions(-) diff --git a/configure.common b/configure.common index cf40fca0f..a18bc803f 100644 --- a/configure.common +++ b/configure.common @@ -766,6 +766,8 @@ AS_IF([test x$target_cpu = xi386 -a x$platform = xpc], [AC_SUBST([GRUB_KERNEL_MACHINE_LINK_ADDR], 0x8200)]) AS_IF([test x$target_cpu = xi386 -a x$platform = xcoreboot], [AC_SUBST([GRUB_KERNEL_MACHINE_LINK_ADDR], 0x8200)]) +AS_IF([test x$target_cpu = xi386 -a x$platform = xmultiboot], + [AC_SUBST([GRUB_KERNEL_MACHINE_LINK_ADDR], 0x8200)]) AS_IF([test x$target_cpu = xmips -a x$platform = xyeeloong], [AC_SUBST([GRUB_KERNEL_MACHINE_LINK_ADDR], 0x80200000)]) AS_IF([test x$target_cpu = xpowerpc -a x$platform = xieee1275], @@ -784,9 +786,10 @@ AS_IF([test x$TARGET_APPLE_CC = x1], AM_CONDITIONAL([COND_emu], [test x$platform = xemu]) AM_CONDITIONAL([COND_i386_pc], [test x$target_cpu = xi386 -a x$platform = xpc]) AM_CONDITIONAL([COND_i386_efi], [test x$target_cpu = xi386 -a x$platform = xefi]) -AM_CONDITIONAL([COND_i386_coreboot], [test x$target_cpu = xi386 -a x$platform = xcoreboot]) -AM_CONDITIONAL([COND_i386_ieee1275], [test x$target_cpu = xi386 -a x$platform = xieee1275]) AM_CONDITIONAL([COND_i386_qemu], [test x$target_cpu = xi386 -a x$platform = xqemu]) +AM_CONDITIONAL([COND_i386_ieee1275], [test x$target_cpu = xi386 -a x$platform = xieee1275]) +AM_CONDITIONAL([COND_i386_coreboot], [test x$target_cpu = xi386 -a x$platform = xcoreboot]) +AM_CONDITIONAL([COND_i386_multiboot], [test x$target_cpu = xi386 -a x$platform = xmultiboot]) AM_CONDITIONAL([COND_x86_64_efi], [test x$target_cpu = xx86_64 -a x$platform = xefi]) AM_CONDITIONAL([COND_mips_yeeloong], [test x$target_cpu = xmips -a x$platform = xyeeloong]) AM_CONDITIONAL([COND_mips_qemu_mips], [test x$target_cpu = xmips -a x$platform = xqemu_mips]) diff --git a/gentpl.py b/gentpl.py index 214b58afd..d6043d05c 100644 --- a/gentpl.py +++ b/gentpl.py @@ -5,11 +5,12 @@ # GRUB_PLATFORMS = [ "emu", "i386_pc", "i386_efi", "i386_qemu", "i386_coreboot", - "i386_ieee1275", "x86_64_efi", "mips_yeeloong", "sparc64_ieee1275", + "i386_multiboot", "i386_ieee1275", "x86_64_efi", + "mips_yeeloong", "sparc64_ieee1275", "powerpc_ieee1275" ] GROUPS = {} -GROUPS["i386"] = [ "i386_pc", "i386_efi", "i386_qemu", "i386_coreboot", "i386_ieee1275" ] +GROUPS["i386"] = [ "i386_pc", "i386_efi", "i386_qemu", "i386_coreboot", "i386_multiboot", "i386_ieee1275" ] GROUPS["x86_64"] = [ "x86_64_efi" ] GROUPS["mips"] = [ "mips_yeeloong" ] GROUPS["sparc64"] = [ "sparc64_ieee1275" ] diff --git a/grub-core/Makefile.kernel b/grub-core/Makefile.kernel index 58e464805..38e2e0ab7 100644 --- a/grub-core/Makefile.kernel +++ b/grub-core/Makefile.kernel @@ -65,6 +65,17 @@ KERNEL_HEADER_FILES += include/grub/machine/memory.h KERNEL_HEADER_FILES += include/grub/machine/loader.h endif +if COND_i386_multiboot +KERNEL_HEADER_FILES += include/grub/boot.h +KERNEL_HEADER_FILES += include/grub/loader.h +KERNEL_HEADER_FILES += include/grub/msdos_partition.h +KERNEL_HEADER_FILES += include/grub/machine/boot.h +KERNEL_HEADER_FILES += include/grub/machine/console.h +KERNEL_HEADER_FILES += include/grub/machine/init.h +KERNEL_HEADER_FILES += include/grub/machine/memory.h +KERNEL_HEADER_FILES += include/grub/machine/loader.h +endif + if COND_i386_qemu KERNEL_HEADER_FILES += include/grub/boot.h KERNEL_HEADER_FILES += include/grub/loader.h diff --git a/grub-core/modules.def b/grub-core/modules.def index c3d90009b..b09516294 100644 --- a/grub-core/modules.def +++ b/grub-core/modules.def @@ -7,6 +7,7 @@ kernel = { x86_efi_ldflags = '-Wl,-r'; i386_pc_ldflags = '-Wl,-Ttext=$(GRUB_KERNEL_MACHINE_LINK_ADDR)'; i386_coreboot_ldflags = '-Wl,-Ttext=$(GRUB_KERNEL_MACHINE_LINK_ADDR)'; + i386_multiboot_ldflags = '-Wl,-Ttext=$(GRUB_KERNEL_MACHINE_LINK_ADDR)'; i386_qemu_ldflags = '-Wl,-Ttext=$(GRUB_KERNEL_MACHINE_LINK_ADDR)'; i386_ieee1275_ldflags = '-Wl,-Ttext=$(GRUB_KERNEL_MACHINE_LINK_ADDR)'; mips_yeeloong_ldflags = '-Wl,-Ttext,$(GRUB_KERNEL_MACHINE_LINK_ADDR)'; @@ -87,6 +88,21 @@ kernel = { i386_coreboot = term/i386/pc/vga_text.c; i386_coreboot = term/i386/vga_common.c; + i386_multiboot = kern/i386/coreboot/startup.S; + i386_multiboot = kern/i386/misc.S; + i386_multiboot = kern/i386/coreboot/init.c; + i386_multiboot = kern/i386/multiboot_mmap.c; + i386_multiboot = kern/i386/halt.c; + i386_multiboot = kern/mm.c; + i386_multiboot = kern/time.c; + i386_multiboot = kern/i386/dl.c; + i386_multiboot = kern/i386/tsc.c; + i386_multiboot = kern/i386/pit.c; + i386_multiboot = kern/generic/rtc_get_time_ms.c; + i386_multiboot = kern/generic/millisleep.c; + i386_multiboot = term/i386/pc/vga_text.c; + i386_multiboot = term/i386/vga_common.c; + i386_qemu = kern/i386/qemu/startup.S; i386_qemu = kern/i386/misc.S; i386_qemu = kern/i386/coreboot/init.c; @@ -202,7 +218,7 @@ kernel = { image_nostrip = { emu; }; image_strip_keep_kernel = { i386_efi; x86_64_efi; }; - image_strip = { powerpc_ieee1275; i386_coreboot; i386_ieee1275; }; + image_strip = { powerpc_ieee1275; i386_coreboot; i386_multiboot; i386_ieee1275; }; image_strip_macho2img = { mips_yeeloong; i386_pc; i386_qemu; sparc64_ieee1275; }; }; @@ -530,6 +546,7 @@ module = { i386_pc; i386_qemu; i386_coreboot; + i386_multiboot; i386_ieee1275; mips_yeeloong; powerpc_ieee1275; @@ -1231,6 +1248,7 @@ module = { i386_pc; i386_qemu; i386_coreboot; + i386_multiboot; i386_ieee1275; }; @@ -1244,6 +1262,7 @@ module = { i386_pc; i386_qemu; i386_coreboot; + i386_multiboot; }; module = { @@ -1328,6 +1347,10 @@ module = { i386_coreboot = mmap/i386/uppermem.c; i386_coreboot = mmap/i386/mmap.c; + i386_multiboot = mmap/mmap.c; + i386_multiboot = mmap/i386/uppermem.c; + i386_multiboot = mmap/i386/mmap.c; + i386_qemu = mmap/mmap.c; i386_qemu = mmap/i386/uppermem.c; i386_qemu = mmap/i386/mmap.c;