diff --git a/Makefile.am b/Makefile.am index 64c9c7e0f..ea9a64ce2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -127,8 +127,14 @@ linux.init.i386: $(srcdir)/grub-core/tests/boot/linux.init-i386.S $(TARGET_CC) -o $@ $< -m32 -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" multiboot.elf: $(srcdir)/grub-core/tests/boot/multiboot.S + $(TARGET_CC) -o $@ $< -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -DTARGET_MULTIBOOT=1 -Wl,-N -Wl,-Ttext,0x100000 -m32 -I$(srcdir)/include + +kfreebsd.elf: $(srcdir)/grub-core/tests/boot/multiboot.S $(TARGET_CC) -o $@ $< -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -Wl,-N -Wl,-Ttext,0x100000 -m32 -I$(srcdir)/include +kfreebsd.aout: kfreebsd.elf + $(OBJCOPY) -O a.out-i386-linux $< $@ -R .note.gnu.build-id + pc-chainloader.elf: $(srcdir)/grub-core/tests/boot/pc-chainloader.S $(TARGET_CC) -o $@ $< -DTARGET_CHAINLOADER=1 -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -Wl,-N -Wl,-Ttext,0x7c00 -m32 @@ -142,7 +148,7 @@ ntldr.bin: ntldr.elf $(OBJCOPY) -O binary --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn $< $@; multiboot2.elf: $(srcdir)/grub-core/tests/boot/multiboot.S - $(TARGET_CC) -o $@ $< -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -Wl,-N -Wl,-Ttext,0x100000 -m32 -I$(srcdir)/include -DMULTIBOOT2=1 + $(TARGET_CC) -o $@ $< -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -Wl,-N -Wl,-Ttext,0x100000 -m32 -I$(srcdir)/include -DTARGET_MULTIBOOT2=1 kfreebsd.init.x86_64: $(srcdir)/grub-core/tests/boot/kfreebsd.init-x86_64.S $(TARGET_CC) -o $@ $< -m64 -nostdlib -nostdinc -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" && freebsd-brandelf -t FreeBSD $@ @@ -242,6 +248,9 @@ bootcheck-multiboot: multiboot.elf $(srcdir)/grub-core/tests/boot/multiboot.cfg bootcheck-multiboot2: multiboot2.elf $(srcdir)/grub-core/tests/boot/multiboot2.cfg grub-shell timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu-opts="$(GRUB_QEMU_OPTS)" --boot=$(BOOTTARGET) --qemu=$(QEMU32) --files=/multiboot2.elf=multiboot2.elf $(srcdir)/grub-core/tests/boot/multiboot2.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null +bootcheck-kfreebsd-aout: kfreebsd.aout $(srcdir)/grub-core/tests/boot/kfreebsd-aout.cfg grub-shell + timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu-opts="$(GRUB_QEMU_OPTS)" --boot=$(BOOTTARGET) --qemu=$(QEMU32) --files=/kfreebsd.aout=kfreebsd.aout $(srcdir)/grub-core/tests/boot/kfreebsd-aout.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null + bootcheck-pc-chainloader: pc-chainloader.bin $(srcdir)/grub-core/tests/boot/pc-chainloader.cfg grub-shell timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu-opts="$(GRUB_QEMU_OPTS)" --boot=$(BOOTTARGET) --qemu=$(QEMU32) --files=/pc-chainloader.bin=pc-chainloader.bin $(srcdir)/grub-core/tests/boot/pc-chainloader.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null @@ -254,6 +263,8 @@ if COND_i386_pc BOOTCHECKS += bootcheck-pc-chainloader bootcheck-ntldr endif +BOOTCHECKS += bootcheck-kfreebsd-aout + BOOTCHECKS += bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64 BOOTCHECKS += bootcheck-multiboot bootcheck-multiboot2 diff --git a/grub-core/tests/boot/kfreebsd-aout.cfg b/grub-core/tests/boot/kfreebsd-aout.cfg new file mode 100644 index 000000000..31e34b4ee --- /dev/null +++ b/grub-core/tests/boot/kfreebsd-aout.cfg @@ -0,0 +1,4 @@ +kfreebsd /kfreebsd.aout +boot +# Shouln't happen +halt diff --git a/grub-core/tests/boot/multiboot.S b/grub-core/tests/boot/multiboot.S index b9c0059c0..904b0d4c7 100644 --- a/grub-core/tests/boot/multiboot.S +++ b/grub-core/tests/boot/multiboot.S @@ -1,7 +1,7 @@ #define ASM_FILE 1 -#ifdef MULTIBOOT2 +#ifdef TARGET_MULTIBOOT2 #include -#else +#elif defined (TARGET_MULTIBOOT) #include #endif @@ -11,7 +11,7 @@ /* Align 32 bits boundary. */ .align 8 -#ifdef MULTIBOOT2 +#ifdef TARGET_MULTIBOOT2 /* Multiboot header. */ multiboot_header: /* magic */ @@ -26,7 +26,7 @@ multiboot_header: .short 0 .long 8 multiboot_header_end: -#else +#elif defined (TARGET_MULTIBOOT) /* Multiboot header. */ multiboot_header: /* magic */