2 Copyright © 2002-2011, The AROS Development Team. All rights reserved.
5 Desc: Multiboot information structures
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
27 struct multiboot_header
29 unsigned int magic
; /* MB_MAGIC */
30 unsigned int flags
; /* See below */
33 unsigned int header_addr
;
34 unsigned int load_addr
;
35 unsigned int load_end_addr
;
36 unsigned int bss_end_addr
;
37 unsigned int entry_addr
;
39 /* Preferred video mode */
40 unsigned int mode_type
;
46 #define MB_MAGIC 0x1BADB002
49 #define MB_PAGE_ALIGN 0x00000001 /* Align modules to page boundary */
50 #define MB_MEMORY_INFO 0x00000002 /* We request memory information */
51 #define MB_VIDEO_MODE 0x00000004 /* We specify preferred video mode information */
52 #define MB_AOUT_KLUDGE 0x00010000
54 /* This is passed in by the bootloader */
55 #define MB_STARTUP_MAGIC 0x2BADB002
57 /* Structure passed from bootloader */
60 unsigned int flags
; /* See below */
61 unsigned int mem_lower
; /* Low memory size */
62 unsigned int mem_upper
; /* Upper memory size */
63 unsigned int bootdev
; /* Boot device, int13h encoding */
64 unsigned int cmdline
; /* 32-bit pointer to a command line string */
65 unsigned int mods_count
; /* Number of modules */
66 unsigned int mods_addr
; /* 32-bit pointer to module descriptors table */
67 unsigned int elf_num
; /* Copy of ELF section header */
68 unsigned int elf_size
;
69 unsigned int elf_addr
;
70 unsigned int elf_shndx
;
71 unsigned int mmap_length
; /* Length of memory map in bytes */
72 unsigned int mmap_addr
; /* 32-bit pointer to memory map */
73 unsigned int drives_length
; /* Size of drives table in bytes */
74 unsigned int drives_addr
; /* 32-bit pointer to drives table */
75 unsigned int config_table
; /* 32-bit pointer to ROM configuration table */
76 unsigned int loader_name
; /* 32-bit pointer to bootloader name string */
77 unsigned int apm_table
; /* 32-bit pointer to APM data table */
78 unsigned int vbe_control_info
; /* 32-bit pointer to VESA controller descriptor */
79 unsigned int vbe_mode_info
; /* 32-bit pointer to VESA mode descriptor */
80 unsigned short vbe_mode
; /* Current VESA video mode */
81 unsigned short vbe_if_seg
; /* VBE protected mode interface */
82 unsigned short vbe_if_off
;
83 unsigned short vbe_if_len
;
84 #ifdef MULTIBOOT_64BIT
85 unsigned long long framebuffer_addr
; /* Framebuffer address, 64-bit pointer */
87 unsigned int framebuffer_addr
;
88 unsigned int framebuffer_addr_high
;
90 unsigned int framebuffer_pitch
;
91 unsigned int framebuffer_width
;
92 unsigned int framebuffer_height
;
93 unsigned char framebuffer_bpp
;
94 unsigned char framebuffer_type
;
99 unsigned int framebuffer_palette_addr
;
100 unsigned short framebuffer_palette_num_colors
;
104 unsigned char framebuffer_red_field_position
;
105 unsigned char framebuffer_red_mask_size
;
106 unsigned char framebuffer_green_field_position
;
107 unsigned char framebuffer_green_mask_size
;
108 unsigned char framebuffer_blue_field_position
;
109 unsigned char framebuffer_blue_mask_size
;
115 #define MB_FLAGS_MEM 1
116 #define MB_FLAGS_BOOTDEV 2
117 #define MB_FLAGS_CMDLINE 4
118 #define MB_FLAGS_MODS 8
119 #define MB_FLAGS_AOUT 16
120 #define MB_FLAGS_ELF 32
121 #define MB_FLAGS_MMAP 64
122 #define MB_FLAGS_DRIVES 128
123 #define MB_FLAGS_CFGTBL 256
124 #define MB_FLAGS_LDRNAME 512
125 #define MB_FLAGS_APMTBL 1024
126 #define MB_FLAGS_GFX 2048
127 #define MB_FLAGS_FB 4096
129 /* framebuffer_type */
130 #define MB_FRAMEBUFFER_LUT 0
131 #define MB_FRAMEBUFFER_RGB 1
132 #define MB_FRAMEBUFFER_TEXT 2
136 unsigned int size
; /* Entry size (not including this field) */
137 #ifdef MULTIBOOT_64BIT
138 unsigned long long addr
; /* Full 64-bit address and length */
139 unsigned long long len
;
142 unsigned int addr_high
;
144 unsigned int len_high
;
146 unsigned int type
; /* Entry type, see below */
147 } __attribute((packed
));
149 /* Memory map entry types */
150 #define MMAP_TYPE_RAM 1 /* General purpose RAM */
151 #define MMAP_TYPE_RESERVED 2
152 #define MMAP_TYPE_ACPIDATA 3
153 #define MMAP_TYPE_ACPINVS 4
155 /* Disk drive information from PC BIOS */
159 unsigned char number
;
164 unsigned short ports
[10]; /* Ugly, needs to be fixed */
168 #define MB_MODE_CHS 0
169 #define MB_MODE_LBA 1
174 unsigned int mod_start
; /* from bytes */
175 unsigned int mod_end
; /* to 'mod_end-1' inclusive */
176 unsigned int cmdline
; /* Module command line */
177 unsigned int pad
; /* padding to take it to 16 bytes (must be zero) */