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/>.
20
#define SYSCALL_RESET 208
21
#elif defined (TARGET_OPENBSD)
22
#define SYSCALL_RESET 55
29
#define SYSCALL_OPEN 5
30
#define SYSCALL_WRITE 4
31
#define SYSCALL_EXIT 1
32
#define SYSCALL_ARCH 165
33
#define SYSCALL_INT 0x80
34
#define SYSCALL_ARCH_IOPL 2
36
#define RESET_NOSYNC 0x4
37
#define RESET_HALT 0x8
38
#define RESET_POWEROFF 0x800
40
#define SHUTDOWN_PORT 0x8900
42
.section ".init", "ax"
47
movl $SYSCALL_OPEN, %eax
58
movl $SYSCALL_WRITE, %eax
59
pushl $(messageend-message)
68
movl $SYSCALL_ARCH, %eax
70
pushl $SYSCALL_ARCH_IOPL
75
movw $SHUTDOWN_PORT, %dx
94
movl $SYSCALL_RESET, %eax
96
pushl $(RESET_POWEROFF|RESET_HALT|RESET_NOSYNC)
101
/* exit (1). Shouldn't be reached. */
102
movl $SYSCALL_EXIT, %eax
106
.section ".fini", "ax"
108
.section ".text", "ax"
110
/* This section is needed for NetBSD to identify the binary. */
111
.section ".note.netbsd.ident", "a"
119
.ascii "/dev/console"
122
.ascii "Boot Test Passed Successfully\n" SUCCESSFUL_BOOT_STRING "\n"