grub/grub-core/tests/boot/kernel-8086.S

51 lines
600 B
ArmAsm
Raw Normal View History

2010-08-25 19:55:48 +00:00
.text
.globl _start
_start:
base:
.code16
jmp cont
serialmsg:
1:
movb 0(%si), %bl
testb %bl, %bl
jz 1f
movw $0x3fd, %dx
2:
inb %dx, %al
testb $0x20, %al
jz 2b
movw $0x3f8, %dx
movb %bl, %al
outb %al, %dx
incw %si
jmp 1b
1:
ret
2010-08-28 14:05:20 +00:00
cont:
#ifdef TARGET_NTLDR
movw $0x2000, %ax
#elif defined (TARGET_CHAINLOADER)
2010-08-25 19:55:48 +00:00
xorw %ax, %ax
2010-08-28 14:05:20 +00:00
#else
#error unsupported target
#endif
2010-08-25 19:55:48 +00:00
movw %ax, %ds
lea message, %si
call serialmsg
#include "qemu-shutdown-x86.S"
2010-08-25 19:55:48 +00:00
1:
hlt
jmp 1b
message:
.ascii "Boot Test Passed Successfully\n" SUCCESSFUL_BOOT_STRING "\n"
.byte 0
.org 510
.short 0xaa55