summaryrefslogtreecommitdiffstats
path: root/grub-core/tests/boot/kernel-8086.S
blob: 5ec5368ffc4df1576f67aae32c5ed97ea0ef14e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
	.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

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
#include "qemu-shutdown-x86.S"

1:
	hlt
	jmp 1b

message:
	.ascii "Boot Test Passed Successfully\n" SUCCESSFUL_BOOT_STRING "\n"
	.byte 0

	.org 510
	.short 0xaa55