pc-chainloader bootcheck
This commit is contained in:
parent
89e07694dc
commit
e8ea4b8424
3 changed files with 80 additions and 0 deletions
63
grub-core/tests/boot/pc-chainloader.S
Normal file
63
grub-core/tests/boot/pc-chainloader.S
Normal file
|
@ -0,0 +1,63 @@
|
|||
|
||||
#define SHUTDOWN_PORT 0x8900
|
||||
|
||||
.text
|
||||
.globl _start
|
||||
_start:
|
||||
base:
|
||||
.code16
|
||||
jmp cont
|
||||
|
||||
portmsg:
|
||||
xorw %ax, %ax
|
||||
1:
|
||||
movb 0(%si), %al
|
||||
test %ax, %ax
|
||||
jz 1f
|
||||
outb %al, %dx
|
||||
incw %si
|
||||
jmp 1b
|
||||
1:
|
||||
ret
|
||||
|
||||
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:
|
||||
xorw %ax, %ax
|
||||
movw %ax, %ds
|
||||
lea message, %si
|
||||
call serialmsg
|
||||
lea shutdown, %si
|
||||
movw $SHUTDOWN_PORT, %dx
|
||||
call portmsg
|
||||
|
||||
1:
|
||||
hlt
|
||||
jmp 1b
|
||||
|
||||
shutdown:
|
||||
.ascii "Shutdown"
|
||||
.byte 0
|
||||
message:
|
||||
.ascii "Boot Test Passed Successfully\n" SUCCESSFUL_BOOT_STRING "\n"
|
||||
.byte 0
|
||||
|
||||
. = base + 510
|
||||
.short 0xaa55
|
4
grub-core/tests/boot/pc-chainloader.cfg
Normal file
4
grub-core/tests/boot/pc-chainloader.cfg
Normal file
|
@ -0,0 +1,4 @@
|
|||
chainloader /pc-chainloader.bin
|
||||
boot
|
||||
# Shouln't happen
|
||||
halt
|
Loading…
Add table
Add a link
Reference in a new issue