From: Vladimir 'phcoder' Serbinenko Date: Thu, 24 Jun 2010 19:22:40 +0000 (+0200) Subject: Merge mainline into newreloc X-Git-Tag: 1.99~629^2~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a1d16154d85ce086c44029e0f6c28bf37755f07;p=thirdparty%2Fgrub.git Merge mainline into newreloc --- 2a1d16154d85ce086c44029e0f6c28bf37755f07 diff --cc conf/common.rmk index ee5152553,bf73c2d59..9a572288d --- a/conf/common.rmk +++ b/conf/common.rmk @@@ -102,10 -101,10 +101,10 @@@ DEFSYMFILES += kernel_syms.ls kernel_img_HEADERS += boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \ - list.h handler.h command.h i18n.h env_private.h libgcc.h mm_private.h - list.h command.h i18n.h env_private.h libgcc.h ++ list.h command.h i18n.h env_private.h libgcc.h mm_private.h ifneq ($(platform), emu) -kernel_img_HEADERS += machine/memory.h machine/loader.h +kernel_img_HEADERS += machine/memory.h endif symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh diff --cc conf/i386-coreboot.rmk index 821431cbb,259f4e162..7486aa618 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@@ -52,24 -68,11 +52,30 @@@ datetime_mod_SOURCES = lib/cmos_datetim datetime_mod_CFLAGS = $(COMMON_CFLAGS) datetime_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For cmostest.mod + pkglib_MODULES += cmostest.mod + cmostest_mod_SOURCES = commands/i386/cmostest.c + cmostest_mod_CFLAGS = $(COMMON_CFLAGS) + cmostest_mod_LDFLAGS = $(COMMON_LDFLAGS) + +pkglib_MODULES += efiemu.mod +efiemu_mod_SOURCES = efiemu/main.c efiemu/i386/loadcore32.c \ + efiemu/i386/loadcore64.c efiemu/i386/pc/cfgtables.c \ + efiemu/mm.c efiemu/loadcore_common.c efiemu/symbols.c \ + efiemu/loadcore32.c efiemu/loadcore64.c \ + efiemu/prepare32.c efiemu/prepare64.c efiemu/pnvram.c \ + efiemu/i386/coredetect.c +efiemu_mod_CFLAGS = $(COMMON_CFLAGS) +efiemu_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For acpi.mod. +pkglib_MODULES += acpi.mod +acpi_mod_SOURCES = commands/acpi.c commands/i386/pc/acpi.c +acpi_mod_CFLAGS = $(COMMON_CFLAGS) +acpi_mod_LDFLAGS = $(COMMON_LDFLAGS) + +BOOTTARGET=coreboot +QEMU32=qemu-system-i386 + include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --cc conf/i386-pc.rmk index e1927c0b0,96058e807..91b0cb041 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@@ -223,17 -243,58 +223,23 @@@ ata_pthru_mod_LDFLAGS = $(COMMON_LDFLAG hdparm_mod_SOURCES = commands/hdparm.c lib/hexdump.c hdparm_mod_CFLAGS = $(COMMON_CFLAGS) hdparm_mod_LDFLAGS = $(COMMON_LDFLAGS) + + # For cmostest.mod + pkglib_MODULES += cmostest.mod + cmostest_mod_SOURCES = commands/i386/cmostest.c + cmostest_mod_CFLAGS = $(COMMON_CFLAGS) + cmostest_mod_LDFLAGS = $(COMMON_LDFLAGS) -ifeq ($(enable_efiemu), yes) - -efiemu32.o: efiemu/runtime/efiemu.c $(TARGET_OBJ2ELF) - -rm -f $@ -ifeq ($(TARGET_APPLE_CC), 1) - -rm -f $@.bin - $(TARGET_CC) -c -m32 -DELF32 -DAPPLE_CC -o $@.bin -Wall -Werror $< -nostdlib -O2 -I$(srcdir)/efiemu/runtime -I$(srcdir)/include -Iinclude - $(OBJCONV) -felf32 -nu -nd $@.bin $@ - -rm -f $@.bin -else - $(TARGET_CC) -c -m32 -DELF32 -o $@ -Wall -Werror $< -nostdlib -O2 -I$(srcdir)/efiemu/runtime -I$(srcdir)/include -Iinclude - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi -endif - -efiemu64_c.o: efiemu/runtime/efiemu.c -ifeq ($(TARGET_APPLE_CC), 1) - $(TARGET_CC) -c -m64 -DAPPLE_CC=1 -DELF64 -o $@ -Wall -Werror $< -nostdlib -mno-red-zone -O2 -I$(srcdir)/efiemu/runtime -I$(srcdir)/include -Iinclude -else - $(TARGET_CC) -c -m64 -DELF64 -o $@ -Wall -Werror $< -nostdlib -mcmodel=large -mno-red-zone -O2 -I$(srcdir)/efiemu/runtime -I$(srcdir)/include -Iinclude -endif - -efiemu64_s.o: efiemu/runtime/efiemu.S - -rm -f $@ -ifeq ($(TARGET_APPLE_CC), 1) - $(TARGET_CC) -c -m64 -DAPPLE_CC=1 -DELF64 -o $@ -Wall -Werror $< -nostdlib -mno-red-zone -O2 -I$(srcdir)/efiemu/runtime -I$(srcdir)/include -Iinclude -else - $(TARGET_CC) -c -m64 -DELF64 -o $@ -Wall -Werror $< -nostdlib -mcmodel=large -mno-red-zone -O2 -I$(srcdir)/efiemu/runtime -I$(srcdir)/include -Iinclude -endif - -efiemu64.o: efiemu64_c.o efiemu64_s.o $(TARGET_OBJ2ELF) - -rm -f $@ -ifeq ($(TARGET_APPLE_CC), 1) - -rm -f $@.bin - $(TARGET_CC) -m64 -o $@.bin -Wl,-r $^ -nostdlib - $(OBJCONV) -felf64 -nu -nd $@.bin $@ - -rm -f $@.bin -else - $(TARGET_CC) -m64 -o $@ -Wl,-r $^ -nostdlib - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi -endif - -CLEANFILES += efiemu32.o efiemu64.o efiemu64_c.o efiemu64_s.o -pkglib_DATA += efiemu32.o efiemu64.o - -endif +BOOTTARGET=cd +QEMU32=qemu-system-i386 + +bootcheck-linux16-i386: linux-initramfs.i386 $(GRUB_PAYLOADS_DIR)/linux.i386 $(srcdir)/tests/boot/linux.cfg grub-shell + timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu-opts="$(GRUB_QEMU_OPTS)" --boot=$(BOOTTARGET) --qemu=$(QEMU32) --files=/initrd=linux-initramfs.i386 --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.i386 $(srcdir)/tests/boot/linux16.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null + +bootcheck-linux16-x86_64: linux-initramfs.x86_64 $(GRUB_PAYLOADS_DIR)/linux.x86_64 $(srcdir)/tests/boot/linux.cfg grub-shell + timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu-opts="$(GRUB_QEMU_OPTS)" --boot=$(BOOTTARGET) --qemu=qemu-system-x86_64 --files=/initrd=linux-initramfs.x86_64 --files=/linux=$(GRUB_PAYLOADS_DIR)/linux.x86_64 $(srcdir)/tests/boot/linux16.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null + +BOOTCHECKS += bootcheck-linux16-i386 bootcheck-linux16-x86_64 include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --cc conf/i386-qemu.rmk index 5ec3c7eea,adb5f7f0f..209eb2e5b --- a/conf/i386-qemu.rmk +++ b/conf/i386-qemu.rmk @@@ -29,9 -32,9 +32,9 @@@ kernel_img_SOURCES = kern/i386/qemu/sta kern/generic/rtc_get_time_ms.c \ kern/generic/millisleep.c \ kern/env.c \ - term/i386/pc/vga_text.c term/i386/vga_common.c \ + term/i386/pc/vga_text.c term/i386/vga_common.c bus/pci.c \ symlist.c - kernel_img_HEADERS += i386/pit.h -kernel_img_HEADERS += pci.h ++kernel_img_HEADERS += pci.h i386/pit.h kernel_img_CFLAGS = $(COMMON_CFLAGS) -DGRUB_BOOT_MACHINE_LINK_ADDR=$(GRUB_BOOT_MACHINE_LINK_ADDR) kernel_img_ASFLAGS = $(COMMON_ASFLAGS) -DGRUB_KERNEL_MACHINE_LINK_ADDR=$(GRUB_KERNEL_MACHINE_LINK_ADDR) kernel_img_LDFLAGS += $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)$(GRUB_KERNEL_MACHINE_LINK_ADDR) diff --cc conf/i386.rmk index bca07c8e5,b1df584a6..6fa12402a --- a/conf/i386.rmk +++ b/conf/i386.rmk @@@ -15,26 -14,19 +15,36 @@@ pkglib_MODULES += vga_text.mo vga_text_mod_SOURCES = term/i386/pc/vga_text.c term/i386/vga_common.c vga_text_mod_CFLAGS = $(COMMON_CFLAGS) vga_text_mod_LDFLAGS = $(COMMON_LDFLAGS) +endif + pkglib_MODULES += video_cirrus.mod + video_cirrus_mod_SOURCES = video/cirrus.c + video_cirrus_mod_CFLAGS = $(COMMON_CFLAGS) + video_cirrus_mod_LDFLAGS = $(COMMON_LDFLAGS) + + pkglib_MODULES += video_bochs.mod + video_bochs_mod_SOURCES = video/bochs.c + video_bochs_mod_CFLAGS = $(COMMON_CFLAGS) + video_bochs_mod_LDFLAGS = $(COMMON_LDFLAGS) + pkglib_MODULES += relocator.mod -relocator_mod_SOURCES = lib/i386/relocator.c lib/i386/relocator_asm.S lib/i386/relocator_backward.S +ifeq ($(platform), ieee1275) +relocator_mod_SOURCES = lib/relocator.c lib/i386/relocator32.S \ + lib/i386/relocator64.S lib/i386/relocator16.S \ + lib/$(target_cpu)/relocator_asm.S lib/i386/relocator.c \ + lib/ieee1275/relocator.c +else +ifeq ($(platform), efi) +relocator_mod_SOURCES = lib/relocator.c lib/i386/relocator32.S \ + lib/i386/relocator64.S lib/i386/relocator16.S \ + lib/$(target_cpu)/relocator_asm.S lib/i386/relocator.c \ + lib/efi/relocator.c +else +relocator_mod_SOURCES = lib/relocator.c lib/i386/relocator32.S \ + lib/i386/relocator64.S lib/i386/relocator16.S \ + lib/$(target_cpu)/relocator_asm.S lib/i386/relocator.c +endif +endif relocator_mod_CFLAGS = $(COMMON_CFLAGS) relocator_mod_ASFLAGS = $(COMMON_ASFLAGS) relocator_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --cc loader/i386/xnu.c index d110293e0,5f18d744b..643a895e8 --- a/loader/i386/xnu.c +++ b/loader/i386/xnu.c @@@ -885,17 -883,17 +885,29 @@@ grub_xnu_set_video (struct grub_xnu_boo return grub_error (GRUB_ERR_IO, "couldn't retrieve video parameters"); if (grub_xnu_bitmap) + { + if (grub_xnu_bitmap_mode == GRUB_XNU_BITMAP_STRETCH) + err = grub_video_bitmap_create_scaled (&bitmap, + mode_info.width, + mode_info.height, + grub_xnu_bitmap, + GRUB_VIDEO_BITMAP_SCALE_METHOD_BEST); + else + bitmap = grub_xnu_bitmap; + } + ++ if (bitmap) + { + if (grub_xnu_bitmap_mode == GRUB_XNU_BITMAP_STRETCH) + err = grub_video_bitmap_create_scaled (&bitmap, + mode_info.width, + mode_info.height, + grub_xnu_bitmap, + GRUB_VIDEO_BITMAP_SCALE_METHOD_BEST); + else + bitmap = grub_xnu_bitmap; + } + if (bitmap) { int x, y;