2
* GRUB -- GRand Unified Bootloader
3
* Copyright (C) 2010 Free Software Foundation, Inc.
5
* GRUB is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
10
* GRUB is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
21
#define SYSCALL_ARCH 165
22
#define SYSCALL_OPEN 5
23
#define SYSCALL_WRITE 4
24
#define SYSCALL_RESET 55
25
#define SYSCALL_EXIT 1
26
#define SYSCALL_ARCH_IOPL 4
27
#define SYSCALL_FSYNC 95
29
#define RESET_NOSYNC 0x4
30
#define RESET_HALT 0x8
31
#define RESET_POWEROFF 0x4000
32
#define SHUTDOWN_PORT 0x8900
34
.section ".init", "ax"
39
movq $SYSCALL_OPEN, %rax
42
movq $FLAGS_NONE, %rdx
48
movq $SYSCALL_WRITE, %rax
49
movq $(messageend - message), %rdx
53
movq $SYSCALL_FSYNC, %rax
57
movq $SYSCALL_ARCH, %rax
58
movq $SYSCALL_ARCH_IOPL, %rdi
62
movw $SHUTDOWN_PORT, %dx
81
movq $SYSCALL_RESET, %rax
82
movq $(RESET_POWEROFF|RESET_HALT|RESET_NOSYNC), %rdi
85
/* exit (1). Shouldn't be reached. */
86
movq $SYSCALL_EXIT, %rax
93
.ascii "Boot Test Passed Successfully\n" SUCCESSFUL_BOOT_STRING "\n"