2 Copyright © 2011-2012, The AROS Development Team. All rights reserved.
5 Desc: Multiboot v2 information structures
9 #ifndef _AROS_MULTIBOOT2_H
10 #define _AROS_MULTIBOOT2_H
12 #include <aros/cpu.h> /* For __WORDSIZE */
13 #include <hardware/vbe.h>
15 #if (__WORDSIZE == 64)
16 #ifndef MULTIBOOT_64BIT
19 * Define this in your code if you want to build 32-bit code using full 64-bit pointers.
20 * Useful for building pc-x86_64 bootstrap which runs in 32 bit mode.
22 #define MULTIBOOT_64BIT
29 ULONG magic
; /* MB2_MAGIC */
30 ULONG arch
; /* Architecture - see below */
31 ULONG size
; /* Total size of the header (including all tags) */
32 ULONG checksum
; /* Header checksum */
36 #define MB2_MAGIC 0xe85250d6
39 #define MB2_ARCH_I386 0
40 #define MB2_ARCH_MIPS32 4
44 UWORD type
; /* Tag ID */
45 UWORD flags
; /* Flags, see below */
46 ULONG size
; /* Size of this tag, including data */
50 #define MB2_HEADER_TAG_END 0
51 #define MB2_HEADER_TAG_INFORMATION_REQUEST 1
52 #define MB2_HEADER_TAG_ADDRESS 2
53 #define MB2_HEADER_TAG_ENTRY_ADDRESS 3
54 #define MB2_HEADER_TAG_CONSOLE_FLAGS 4
55 #define MB2_HEADER_TAG_FRAMEBUFFER 5
56 #define MB2_HEADER_TAG_MODULE_ALIGN 6
59 #define MBTF_OPTIONAL 1
61 struct mb2_header_tag_info_request
63 UWORD type
; /* MB2_HEADER_TAG_INFORMATION_REQUEST */
69 struct mb2_header_tag_address
71 UWORD type
; /* MB2_HEADER_TAG_ADDRESS */
80 struct mb2_header_tag_entry_address
82 UWORD type
; /* MB2_HEADER_TAG_ENTRY_ADDRESS */
88 struct mb2_header_tag_console_flags
90 UWORD type
; /* MB2_HEADER_TAG_CONSOLE_FLAGS */
96 struct mb2_header_tag_framebuffer
98 UWORD type
; /* MB2_HEADER_TAG_FRAMEBUFFER */
106 struct mb2_header_tag_module_align
108 UWORD type
; /* MB2_HEADER_TAG_MODULE_ALIGN */
116 /* This value is passed in by the bootloader */
117 #define MB2_STARTUP_MAGIC 0x36d76289
120 * Multiboot v2 data is a UQUAD value representing overall length,
121 * followed by a sequence of tags.
122 * This is the generalized form of a tag.
127 ULONG size
; /* Data size (including header) */
131 #define MB2_TAG_END 0
132 #define MB2_TAG_CMDLINE 1
133 #define MB2_TAG_BOOTLOADER_NAME 2
134 #define MB2_TAG_MODULE 3
135 #define MB2_TAG_BASIC_MEMINFO 4
136 #define MB2_TAG_BOOTDEV 5
137 #define MB2_TAG_MMAP 6
138 #define MB2_TAG_VBE 7
139 #define MB2_TAG_FRAMEBUFFER 8
140 #define MB2_TAG_ELF_SECTIONS 9
141 #define MB2_TAG_APM 10
142 #define MB2_TAG_EFI32 11
143 #define MB2_TAG_EFI64 12
144 #define MB2_TAG_SMBIOS 13
145 #define MB2_TAG_ACPI_OLD 14
146 #define MB2_TAG_ACPI_NEW 15
147 #define MB2_TAG_NETWORK 16
149 struct mb2_tag_string
156 struct mb2_tag_module
165 struct mb2_tag_basic_meminfo
173 struct mb2_tag_bootdev
184 #ifdef MULTIBOOT_64BIT
185 UQUAD addr
; /* Address and length, 64-bit */
193 ULONG type
; /* Entry type, see below */
194 ULONG pad
; /* Reserved */
197 /* Memory map entry types */
198 #define MMAP2_TYPE_RAM 1 /* General purpose RAM */
199 #define MMAP2_TYPE_RESERVED 2 /* System private areas */
200 #define MMAP2_TYPE_ACPIDATA 3 /* ACPI data structures */
201 #define MMAP2_TYPE_ACPINVS 4
202 #define MMAP2_TYPE_BAD 5 /* Broken RAM */
210 struct mb2_mmap mmap
[0];
219 UWORD vbe_interface_seg
;
220 UWORD vbe_interface_off
;
221 UWORD vbe_interface_len
;
223 struct vbe_controller vbe_control_info
;
224 struct vbe_mode vbe_mode_info
;
227 struct mb2_tag_framebuffer_common
229 ULONG type
; /* Tag ID */
231 #ifdef MULTIBOOT_64BIT
232 UQUAD framebuffer_addr
; /* Framebuffer address, 64-bit pointer */
234 ULONG framebuffer_addr
;
235 ULONG framebuffer_addr_high
;
237 ULONG framebuffer_pitch
; /* Bytes per line */
238 ULONG framebuffer_width
; /* Size in pixels or characters */
239 ULONG framebuffer_height
;
240 UBYTE framebuffer_bpp
; /* Bits per pixel */
241 UBYTE framebuffer_type
; /* See below */
245 /* Framebuffer types */
246 #define MB2_FRAMEBUFFER_LUT 0
247 #define MB2_FRAMEBUFFER_RGB 1
248 #define MB2_FRAMEBUFFER_TEXT 2
257 struct mb2_tag_framebuffer
259 struct mb2_tag_framebuffer_common common
;
265 UWORD framebuffer_num_colors
;
266 struct fb_color framebuffer_palette
[0];
270 UBYTE framebuffer_red_field_position
;
271 UBYTE framebuffer_red_mask_size
;
272 UBYTE framebuffer_green_field_position
;
273 UBYTE framebuffer_green_mask_size
;
274 UBYTE framebuffer_blue_field_position
;
275 UBYTE framebuffer_blue_mask_size
;
280 struct mb2_tag_elf_sections
319 struct mb2_tag_smbios
329 struct mb2_tag_old_acpi
336 struct mb2_tag_new_acpi
343 struct mb2_tag_network