ntldr bootcheck

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-08-28 16:05:20 +02:00
parent c5c8cf354c
commit 0101a723ce
3 changed files with 22 additions and 3 deletions

View 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

View file

@ -0,0 +1,4 @@
ntldr /ntldr.bin
boot
# Shouln't happen
halt

View 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