2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2002,2003,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 OFFSETS_HEADER
20 #define OFFSETS_HEADER 1
22 /* The offset of GRUB_TOTAL_MODULE_SIZE. */
23 #define GRUB_KERNEL_I386_PC_TOTAL_MODULE_SIZE 0x8
25 /* The offset of GRUB_KERNEL_IMAGE_SIZE. */
26 #define GRUB_KERNEL_I386_PC_KERNEL_IMAGE_SIZE 0xc
28 /* The offset of GRUB_COMPRESSED_SIZE. */
29 #define GRUB_KERNEL_I386_PC_COMPRESSED_SIZE 0x10
31 /* The offset of GRUB_INSTALL_DOS_PART. */
32 #define GRUB_KERNEL_I386_PC_INSTALL_DOS_PART 0x14
34 /* The offset of GRUB_INSTALL_BSD_PART. */
35 #define GRUB_KERNEL_I386_PC_INSTALL_BSD_PART 0x18
37 /* Offset of reed_solomon_redundancy. */
38 #define GRUB_KERNEL_I386_PC_REED_SOLOMON_REDUNDANCY 0x1c
40 /* The size of the first region which won't be compressed. */
41 #define GRUB_KERNEL_I386_PC_RAW_SIZE 0xcd0
43 #define GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_PART 0x730
45 /* The offset of GRUB_PREFIX. */
46 #define GRUB_KERNEL_I386_PC_PREFIX GRUB_KERNEL_I386_PC_RAW_SIZE
48 /* End of the data section. */
49 #define GRUB_KERNEL_I386_PC_PREFIX_END (GRUB_KERNEL_I386_PC_PREFIX + 0x40)
51 /* The segment where the kernel is loaded. */
52 #define GRUB_BOOT_I386_PC_KERNEL_SEG 0x800
54 #define GRUB_KERNEL_I386_PC_LINK_ADDR 0x8200
56 /* The upper memory area (starting at 640 kiB). */
57 #define GRUB_MEMORY_I386_PC_UPPER 0xa0000
58 #define GRUB_MEMORY_I386_QEMU_UPPER GRUB_MEMORY_I386_PC_UPPER
60 /* The offset of GRUB_CORE_ENTRY_ADDR. */
61 #define GRUB_BOOT_I386_QEMU_CORE_ENTRY_ADDR 0x4
63 /* The offset of GRUB_CORE_ENTRY_ADDR. */
64 #define GRUB_KERNEL_I386_QEMU_CORE_ENTRY_ADDR 0x8
66 /* The offset of GRUB_KERNEL_IMAGE_SIZE. */
67 #define GRUB_KERNEL_I386_QEMU_KERNEL_IMAGE_SIZE 0xc
69 /* The offset of GRUB_PREFIX. */
70 #define GRUB_KERNEL_I386_QEMU_PREFIX 0x10
72 /* End of the data section. */
73 #define GRUB_KERNEL_I386_QEMU_PREFIX_END 0x50
75 #define GRUB_KERNEL_I386_QEMU_LINK_ADDR 0x8200
77 /* The offset of GRUB_TOTAL_MODULE_SIZE. */
78 #define GRUB_KERNEL_SPARC64_IEEE1275_TOTAL_MODULE_SIZE 0x8
80 /* The offset of GRUB_KERNEL_IMAGE_SIZE. */
81 #define GRUB_KERNEL_SPARC64_IEEE1275_KERNEL_IMAGE_SIZE 0xc
83 /* The offset of GRUB_COMPRESSED_SIZE. */
84 #define GRUB_KERNEL_SPARC64_IEEE1275_COMPRESSED_SIZE 0x10
86 /* The offset of GRUB_PREFIX. */
87 #define GRUB_KERNEL_SPARC64_IEEE1275_PREFIX 0x14
89 /* End of the data section. */
90 #define GRUB_KERNEL_SPARC64_IEEE1275_PREFIX_END 0x114
92 #define GRUB_BOOT_SPARC64_IEEE1275_LIST_SIZE 12
94 #define GRUB_BOOT_SPARC64_IEEE1275_IMAGE_ADDRESS 0x4400
95 #define GRUB_KERNEL_SPARC64_IEEE1275_RAW_SIZE 0
96 #define GRUB_KERNEL_SPARC64_IEEE1275_LINK_ADDR 0x4400
98 #define GRUB_KERNEL_POWERPC_IEEE1275_PREFIX 0x4
99 #define GRUB_KERNEL_POWERPC_IEEE1275_PREFIX_END 0x44
100 #define GRUB_KERNEL_POWERPC_IEEE1275_LINK_ALIGN 4
101 #define GRUB_KERNEL_POWERPC_IEEE1275_LINK_ADDR 0x200000
103 #define GRUB_KERNEL_MIPS_LOONGSON_LINK_ADDR 0x80200000
105 #define GRUB_KERNEL_MIPS_LOONGSON_LINK_ALIGN 32
107 #define GRUB_KERNEL_MIPS_LOONGSON_COMPRESSED_SIZE 0x8
108 #define GRUB_KERNEL_MIPS_LOONGSON_UNCOMPRESSED_SIZE 0xc
109 #define GRUB_KERNEL_MIPS_LOONGSON_UNCOMPRESSED_ADDR 0x10
111 #define GRUB_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE 0x08
112 #define GRUB_KERNEL_MIPS_LOONGSON_PREFIX 0x0c
113 #define GRUB_KERNEL_MIPS_LOONGSON_PREFIX_END 0x54
115 #define GRUB_KERNEL_MIPS_QEMU_MIPS_LINK_ADDR 0x80200000
116 #define GRUB_KERNEL_MIPS_QEMU_MIPS_LINK_ALIGN 32
117 #define GRUB_KERNEL_MIPS_QEMU_MIPS_COMPRESSED_SIZE 0x8
118 #define GRUB_KERNEL_MIPS_QEMU_MIPS_UNCOMPRESSED_SIZE 0xc
119 #define GRUB_KERNEL_MIPS_QEMU_MIPS_UNCOMPRESSED_ADDR 0x10
120 #define GRUB_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE 0x08
121 #define GRUB_KERNEL_MIPS_QEMU_MIPS_PREFIX 0x0c
122 #define GRUB_KERNEL_MIPS_QEMU_MIPS_PREFIX_END 0x54
124 #define GRUB_KERNEL_MIPS_ARC_LINK_ADDR 0x8bd00000
126 #define GRUB_KERNEL_MIPS_ARC_LINK_ALIGN 32
128 #define GRUB_KERNEL_MIPS_ARC_COMPRESSED_SIZE 0x8
129 #define GRUB_KERNEL_MIPS_ARC_UNCOMPRESSED_SIZE 0xc
130 #define GRUB_KERNEL_MIPS_ARC_UNCOMPRESSED_ADDR 0x10
132 #define GRUB_KERNEL_MIPS_ARC_TOTAL_MODULE_SIZE 0x08
133 #define GRUB_KERNEL_MIPS_ARC_PREFIX 0x0c
134 #define GRUB_KERNEL_MIPS_ARC_PREFIX_END 0x54
136 /* The offset of GRUB_PREFIX. */
137 #define GRUB_KERNEL_I386_EFI_PREFIX 0x8
139 /* End of the data section. */
140 #define GRUB_KERNEL_I386_EFI_PREFIX_END 0x50
142 /* The offset of GRUB_PREFIX. */
143 #define GRUB_KERNEL_IA64_EFI_PREFIX 0x50
145 /* End of the data section. */
146 #define GRUB_KERNEL_IA64_EFI_PREFIX_END 0xa0
148 /* The offset of GRUB_PREFIX. */
149 #define GRUB_KERNEL_X86_64_EFI_PREFIX 0x8
151 /* End of the data section. */
152 #define GRUB_KERNEL_X86_64_EFI_PREFIX_END 0x50
154 #define GRUB_KERNEL_I386_COREBOOT_PREFIX 0x2
155 #define GRUB_KERNEL_I386_COREBOOT_PREFIX_END 0x42
156 #define GRUB_KERNEL_I386_COREBOOT_LINK_ADDR 0x8200
158 #define GRUB_KERNEL_I386_MULTIBOOT_PREFIX GRUB_KERNEL_I386_COREBOOT_PREFIX
159 #define GRUB_KERNEL_I386_MULTIBOOT_PREFIX_END GRUB_KERNEL_I386_COREBOOT_PREFIX_END
161 #define GRUB_KERNEL_I386_IEEE1275_PREFIX 0x2
162 #define GRUB_KERNEL_I386_IEEE1275_PREFIX_END 0x42
163 #define GRUB_KERNEL_I386_IEEE1275_LINK_ADDR 0x10000
165 #define GRUB_KERNEL_I386_IEEE1275_MOD_ALIGN 0x1000
166 #define GRUB_KERNEL_I386_COREBOOT_MOD_ALIGN 0x1
167 #define GRUB_KERNEL_I386_MULTIBOOT_MOD_ALIGN GRUB_KERNEL_I386_COREBOOT_MOD_ALIGN
169 /* Non-zero value is only needed for PowerMacs. */
170 #define GRUB_KERNEL_I386_IEEE1275_MOD_GAP 0x0
171 #define GRUB_KERNEL_I386_COREBOOT_MOD_GAP 0x0
173 #define GRUB_KERNEL_POWERPC_IEEE1275_MOD_ALIGN 0x1000
175 #define GRUB_KERNEL_MIPS_LOONGSON_MOD_ALIGN 0x1
176 #define GRUB_KERNEL_MIPS_ARC_MOD_ALIGN 0x1
177 #define GRUB_KERNEL_MIPS_QEMU_MIPS_MOD_ALIGN 0x1
179 /* Minimal gap between _end and the start of the modules. It's a hack
180 for PowerMac to prevent "CLAIM failed" error. The real fix is to
181 rewrite grub-mkimage to generate valid ELF files. */
182 #define GRUB_KERNEL_POWERPC_IEEE1275_MOD_GAP 0x8000
185 #define GRUB_OFFSETS_CONCAT_(a,b,c) a ## b ## c
186 #define GRUB_OFFSETS_CONCAT(a,b,c) GRUB_OFFSETS_CONCAT_(a,b,c)
187 #define GRUB_KERNEL_MACHINE_MOD_ALIGN GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _MOD_ALIGN)
188 #define GRUB_KERNEL_MACHINE_MOD_GAP GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _MOD_GAP)
189 #define GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _TOTAL_MODULE_SIZE)
190 #define GRUB_KERNEL_MACHINE_KERNEL_IMAGE_SIZE GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _KERNEL_IMAGE_SIZE)
191 #define GRUB_KERNEL_MACHINE_COMPRESSED_SIZE GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _COMPRESSED_SIZE)
192 #define GRUB_KERNEL_MACHINE_UNCOMPRESSED_SIZE GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _UNCOMPRESSED_SIZE)
193 #define GRUB_KERNEL_MACHINE_UNCOMPRESSED_ADDR GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _UNCOMPRESSED_ADDR)
195 #define GRUB_KERNEL_MACHINE_PREFIX GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _PREFIX)
196 #define GRUB_KERNEL_MACHINE_PREFIX_END GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _PREFIX_END)
197 #define GRUB_BOOT_MACHINE_KERNEL_SEG GRUB_OFFSETS_CONCAT (GRUB_BOOT_, GRUB_MACHINE, _KERNEL_SEG)
198 #define GRUB_MEMORY_MACHINE_UPPER GRUB_OFFSETS_CONCAT (GRUB_MEMORY_, GRUB_MACHINE, _UPPER)
199 #define GRUB_KERNEL_MACHINE_RAW_SIZE GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _RAW_SIZE)
200 #define GRUB_KERNEL_MACHINE_INSTALL_BSD_PART GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _INSTALL_BSD_PART)
201 #define GRUB_KERNEL_MACHINE_INSTALL_DOS_PART GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _INSTALL_DOS_PART)
202 #define GRUB_MACHINE_LINK_ADDR GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _LINK_ADDR)
206 struct grub_pc_bios_boot_blocklist
210 grub_uint16_t segment
;
211 } __attribute__ ((packed
));