]> git.proxmox.com Git - grub2.git/blob - include/grub/i386/pc/boot.h
2007-07-22 Yoshinori K. Okuji <okuji@enbug.org>
[grub2.git] / include / grub / i386 / pc / boot.h
1 /*
2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 1999,2000,2002,2005,2006,2007 Free Software Foundation, Inc.
4 *
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.
9 *
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.
14 *
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/>.
17 */
18
19 #ifndef GRUB_BOOT_MACHINE_HEADER
20 #define GRUB_BOOT_MACHINE_HEADER 1
21
22 /* The signature for bootloader. */
23 #define GRUB_BOOT_MACHINE_SIGNATURE 0xaa55
24
25 /* The offset of the start of BPB (BIOS Parameter Block). */
26 #define GRUB_BOOT_MACHINE_BPB_START 0x3
27
28 /* The offset of the end of BPB (BIOS Parameter Block). */
29 #define GRUB_BOOT_MACHINE_BPB_END 0x3e
30
31 /* The offset of the major version. */
32 #define GRUB_BOOT_MACHINE_VER_MAJ 0x3e
33
34 /* The offset of BOOT_DRIVE. */
35 #define GRUB_BOOT_MACHINE_BOOT_DRIVE 0x4c
36
37 /* The offset of KERNEL_ADDRESS. */
38 #define GRUB_BOOT_MACHINE_KERNEL_ADDRESS 0x40
39
40 /* The offset of KERNEL_SECTOR. */
41 #define GRUB_BOOT_MACHINE_KERNEL_SECTOR 0x44
42
43 /* The offset of KERNEL_SEGMENT. */
44 #define GRUB_BOOT_MACHINE_KERNEL_SEGMENT 0x42
45
46 /* The offset of BOOT_DRIVE_CHECK. */
47 #define GRUB_BOOT_MACHINE_DRIVE_CHECK 0x4e
48
49 /* The offset of a magic number used by Windows NT. */
50 #define GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC 0x1b8
51
52 /* The offset of the start of the partition table. */
53 #define GRUB_BOOT_MACHINE_PART_START 0x1be
54
55 /* The offset of the end of the partition table. */
56 #define GRUB_BOOT_MACHINE_PART_END 0x1fe
57
58 /* The stack segment. */
59 #define GRUB_BOOT_MACHINE_STACK_SEG 0x2000
60
61 /* The segment of disk buffer. The disk buffer MUST be 32K long and
62 cannot straddle a 64K boundary. */
63 #define GRUB_BOOT_MACHINE_BUFFER_SEG 0x7000
64
65 /* The flag for BIOS drive number to designate a hard disk vs. a
66 floppy. */
67 #define GRUB_BOOT_MACHINE_BIOS_HD_FLAG 0x80
68
69 /* The segment where the kernel is loaded. */
70 #define GRUB_BOOT_MACHINE_KERNEL_SEG 0x800
71
72 /* The address where the kernel is loaded. */
73 #define GRUB_BOOT_MACHINE_KERNEL_ADDR (GRUB_BOOT_MACHINE_KERNEL_SEG << 4)
74
75 /* The size of a block list used in the kernel startup code. */
76 #define GRUB_BOOT_MACHINE_LIST_SIZE 12
77
78 #endif /* ! BOOT_MACHINE_HEADER */