xref: /haiku/src/system/boot/platform/bios_ia32/multiboot.h (revision f649b1fa771d961786e7d9988169489c19b2a3d8)
1 /*
2  * Copyright 2009, François Revol, revol@free.fr.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _MULTIBOOT_H
6 #define _MULTIBOOT_H
7 
8 
9 #ifndef __ASSEMBLER__
10 
11 #include <SupportDefs.h>
12 
13 #endif /* __ASSEMBLER__ */
14 
15 
16 /* minimal part of the MultiBoot API */
17 /* we use the official names */
18 
19 /* magics */
20 #define MULTIBOOT_MAGIC 0x1badb002
21 #define MULTIBOOT_MAGIC2 0x2badb002
22 
23 /* header flags */
24 #define MULTIBOOT_PAGE_ALIGN 0x00000001
25 #define MULTIBOOT_MEMORY_INFO 0x00000002
26 #define MULTIBOOT_VIDEO_MODE 0x00000004
27 #define MULTIBOOT_AOUT_KLUDGE 0x00010000
28 
29 /* info flags */
30 #define MULTIBOOT_INFO_MEMORY 0x00000001
31 #define MULTIBOOT_INFO_BOOTDEV 0x00000002
32 #define MULTIBOOT_INFO_CMDLINE 0x00000004
33 #define MULTIBOOT_INFO_MODS 0x00000008
34 #define MULTIBOOT_INFO_MEM_MAP 0x00000040
35 
36 #ifndef __ASSEMBLER__
37 
38 /* info struct passed to the loader */
39 struct multiboot_info {
40 	uint32 flags;
41 	uint32 mem_lower;
42 	uint32 mem_upper;
43 	uint32 boot_device;
44 	uint32 cmdline;
45 	uint32 mods_count;
46 	uint32 mods_addr;
47 	uint32 syms[4];
48 	uint32 mmap_length;
49 	uint32 mmap_addr;
50 	uint32 drives_length;
51 	uint32 drives_addr;
52 	uint32 config_table;
53 	uint32 boot_loader_name;
54 	uint32 apm_table;
55 	uint32 vbe_control_info;
56 	uint32 vbe_mode_info;
57 	uint16 vbe_interface_seg;
58 	uint16 vbe_interface_off;
59 	uint16 vbe_interface_len;
60 };
61 
62 
63 #ifdef __cplusplus
64 extern "C" {
65 #endif
66 
67 extern void dump_multiboot_info(void);
68 extern status_t parse_multiboot_commandline(struct stage2_args *args);
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif /* __ASSEMBLER__ */
75 
76 #endif /* _MULTIBOOT_H */
77