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_OPEN 5
22
#define SYSCALL_WRITE 4
23
#define SYSCALL_RESET 55
24
#define SYSCALL_FSYNC 95
25
#define SYSCALL_ARCH 165
26
#define SYSCALL_EXIT 1
27
#define SYSCALL_ARCH_IOPL 4
28
#define SYSCALL_INT 0x80
30
#define RESET_NOSYNC 0x4
31
#define RESET_HALT 0x8
32
#define RESET_POWEROFF 0x4000
33
#define SHUTDOWN_PORT 0x8900
35
.section ".init", "ax"
40
movl $SYSCALL_OPEN, %eax
51
movl $SYSCALL_WRITE, %eax
52
pushl $(messageend-message)
61
movl $SYSCALL_FSYNC, %eax
68
movl $SYSCALL_ARCH, %eax
70
pushl $SYSCALL_ARCH_IOPL
75
movw $SHUTDOWN_PORT, %dx
94
movl $SYSCALL_RESET, %eax
95
pushl $(RESET_POWEROFF|RESET_HALT|RESET_NOSYNC)
100
/* exit (1). Shouldn't be reached. */
101
movl $SYSCALL_EXIT, %eax
106
.ascii "/dev/console"
109
.ascii "Boot Test Passed Successfully\n" SUCCESSFUL_BOOT_STRING "\n"