2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 1999,2000,2002,2005,2006,2007,2008 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/>.
19 #ifndef GRUB_BOOT_MACHINE_HEADER
20 #define GRUB_BOOT_MACHINE_HEADER 1
22 /* The signature for bootloader. */
23 #define GRUB_BOOT_MACHINE_SIGNATURE 0xaa55
25 /* The offset of the start of BPB (BIOS Parameter Block). */
26 #define GRUB_BOOT_MACHINE_BPB_START 0x3
28 /* The offset of the end of BPB (BIOS Parameter Block). */
29 #define GRUB_BOOT_MACHINE_BPB_END 0x3e
31 /* The offset of the major version. */
32 #define GRUB_BOOT_MACHINE_VER_MAJ 0x3e
34 /* The offset of BOOT_DRIVE. */
35 #define GRUB_BOOT_MACHINE_BOOT_DRIVE 0x4c
37 /* The offset of ROOT_DRIVE. */
38 #define GRUB_BOOT_MACHINE_ROOT_DRIVE 0x4d
40 /* The offset of KERNEL_ADDRESS. */
41 #define GRUB_BOOT_MACHINE_KERNEL_ADDRESS 0x40
43 /* The offset of KERNEL_SECTOR. */
44 #define GRUB_BOOT_MACHINE_KERNEL_SECTOR 0x44
46 /* The offset of KERNEL_SEGMENT. */
47 #define GRUB_BOOT_MACHINE_KERNEL_SEGMENT 0x42
49 /* The offset of BOOT_DRIVE_CHECK. */
50 #define GRUB_BOOT_MACHINE_DRIVE_CHECK 0x4f
52 /* The offset of a magic number used by Windows NT. */
53 #define GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC 0x1b8
55 /* The offset of the start of the partition table. */
56 #define GRUB_BOOT_MACHINE_PART_START 0x1be
58 /* The offset of the end of the partition table. */
59 #define GRUB_BOOT_MACHINE_PART_END 0x1fe
61 /* The stack segment. */
62 #define GRUB_BOOT_MACHINE_STACK_SEG 0x2000
64 /* The segment of disk buffer. The disk buffer MUST be 32K long and
65 cannot straddle a 64K boundary. */
66 #define GRUB_BOOT_MACHINE_BUFFER_SEG 0x7000
68 /* The flag for BIOS drive number to designate a hard disk vs. a
70 #define GRUB_BOOT_MACHINE_BIOS_HD_FLAG 0x80
72 /* The segment where the kernel is loaded. */
73 #define GRUB_BOOT_MACHINE_KERNEL_SEG 0x800
75 /* The address where the kernel is loaded. */
76 #define GRUB_BOOT_MACHINE_KERNEL_ADDR (GRUB_BOOT_MACHINE_KERNEL_SEG << 4)
78 /* The size of a block list used in the kernel startup code. */
79 #define GRUB_BOOT_MACHINE_LIST_SIZE 12
81 #endif /* ! BOOT_MACHINE_HEADER */