]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
ntldr bootcheck
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 28 Aug 2010 14:05:20 +0000 (16:05 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 28 Aug 2010 14:05:20 +0000 (16:05 +0200)
Makefile.am
grub-core/tests/boot/ntldr.cfg [new file with mode: 0644]
grub-core/tests/boot/pc-chainloader.S

index 53439fd42933e01936ac12e905797af692e23ef4..64c9c7e0f3d7da4825d08b8092c14525928c39d3 100644 (file)
@@ -130,11 +130,17 @@ multiboot.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
 
 pc-chainloader.elf: $(srcdir)/grub-core/tests/boot/pc-chainloader.S
-       $(TARGET_CC) -o $@ $< -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -Wl,-N -Wl,-Ttext,0x7c00 -m32
+       $(TARGET_CC) -o $@ $< -DTARGET_CHAINLOADER=1 -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -Wl,-N -Wl,-Ttext,0x7c00 -m32
 
 pc-chainloader.bin: pc-chainloader.elf
        $(OBJCOPY) -O binary --strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R .reginfo -R .rel.dyn $< $@;
 
+ntldr.elf: $(srcdir)/grub-core/tests/boot/pc-chainloader.S
+       $(TARGET_CC) -o $@ $< -DTARGET_NTLDR=1 -DSUCCESSFUL_BOOT_STRING=\"$(SUCCESSFUL_BOOT_STRING)\" -ffreestanding -nostdlib -nostdinc -Wl,-N -Wl,-Ttext,0 -m32
+
+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
 
@@ -239,10 +245,13 @@ bootcheck-multiboot2: multiboot2.elf $(srcdir)/grub-core/tests/boot/multiboot2.c
 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
 
+bootcheck-ntldr: ntldr.bin $(srcdir)/grub-core/tests/boot/ntldr.cfg grub-shell
+       timeout -s KILL $(BOOTCHECK_TIMEOUT) ./grub-shell --qemu-opts="$(GRUB_QEMU_OPTS)" --boot=$(BOOTTARGET) --qemu=$(QEMU32) --files=/ntldr.bin=ntldr.bin $(srcdir)/grub-core/tests/boot/ntldr.cfg | grep $(SUCCESSFUL_BOOT_STRING) > /dev/null
+
 BOOTCHECKS= 
 
 if COND_i386_pc
-BOOTCHECKS += bootcheck-pc-chainloader
+BOOTCHECKS += bootcheck-pc-chainloader bootcheck-ntldr
 endif
 
 BOOTCHECKS += bootcheck-kopenbsd-i386 bootcheck-kopenbsd-x86_64
diff --git a/grub-core/tests/boot/ntldr.cfg b/grub-core/tests/boot/ntldr.cfg
new file mode 100644 (file)
index 0000000..cd438a4
--- /dev/null
@@ -0,0 +1,4 @@
+ntldr /ntldr.bin
+boot
+# Shouln't happen
+halt
index fc7429940bef6aad6e17a4875e5e9a4c30ac0715..20040dabc617b03fd95a059bd82ba0f9f591850d 100644 (file)
@@ -39,8 +39,14 @@ serialmsg:
 1:
        ret
 
-cont:  
+cont:
+#ifdef TARGET_NTLDR
+       movw $0x2000, %ax
+#elif defined (TARGET_CHAINLOADER)
        xorw %ax, %ax
+#else
+#error unsupported target
+#endif
        movw %ax, %ds
        lea message, %si
        call serialmsg