1 /* multiboot.h - multiboot header file with grub definitions. */
3 * GRUB -- GRand Unified Bootloader
4 * Copyright (C) 2003,2007,2008,2010 Free Software Foundation, Inc.
6 * GRUB is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * GRUB is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef GRUB_MULTIBOOT_HEADER
21 #define GRUB_MULTIBOOT_HEADER 1
23 #include <grub/file.h>
25 #ifdef GRUB_USE_MULTIBOOT2
26 #include <multiboot2.h>
27 /* Same thing as far as our loader is concerned. */
28 #define MULTIBOOT_BOOTLOADER_MAGIC MULTIBOOT2_BOOTLOADER_MAGIC
29 #define MULTIBOOT_HEADER_MAGIC MULTIBOOT2_HEADER_MAGIC
31 #include <multiboot.h>
34 #include <grub/types.h>
37 #ifndef GRUB_USE_MULTIBOOT2
40 GRUB_MULTIBOOT_QUIRKS_NONE
= 0,
41 GRUB_MULTIBOOT_QUIRK_BAD_KLUDGE
= 1,
42 GRUB_MULTIBOOT_QUIRK_MODULES_AFTER_KERNEL
= 2
43 } grub_multiboot_quirks_t
;
44 extern grub_multiboot_quirks_t grub_multiboot_quirks
;
47 extern struct grub_relocator
*grub_multiboot_relocator
;
49 void grub_multiboot (int argc
, char *argv
[]);
50 void grub_module (int argc
, char *argv
[]);
52 void grub_multiboot_set_accepts_video (int val
);
53 grub_err_t
grub_multiboot_make_mbi (grub_uint32_t
*target
);
54 void grub_multiboot_free_mbi (void);
55 grub_err_t
grub_multiboot_init_mbi (int argc
, char *argv
[]);
56 grub_err_t
grub_multiboot_add_module (grub_addr_t start
, grub_size_t size
,
57 int argc
, char *argv
[]);
58 void grub_multiboot_set_bootdev (void);
60 grub_multiboot_add_elfsyms (grub_size_t num
, grub_size_t entsize
,
61 unsigned shndx
, void *data
);
63 grub_uint32_t
grub_get_multiboot_mmap_count (void);
64 grub_err_t
grub_multiboot_set_video_mode (void);
66 /* FIXME: support coreboot as well. */
67 #if defined (GRUB_MACHINE_PCBIOS)
68 #define GRUB_MACHINE_HAS_VBE 1
70 #define GRUB_MACHINE_HAS_VBE 0
73 #if defined (GRUB_MACHINE_PCBIOS) || defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_MULTIBOOT) || defined (GRUB_MACHINE_QEMU)
74 #define GRUB_MACHINE_HAS_VGA_TEXT 1
76 #define GRUB_MACHINE_HAS_VGA_TEXT 0
79 #if defined (GRUB_MACHINE_EFI) || defined (GRUB_MACHINE_PCBIOS) || defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_MULTIBOOT)
80 #define GRUB_MACHINE_HAS_ACPI 1
82 #define GRUB_MACHINE_HAS_ACPI 0
85 #define GRUB_MULTIBOOT_CONSOLE_EGA_TEXT 1
86 #define GRUB_MULTIBOOT_CONSOLE_FRAMEBUFFER 2
89 grub_multiboot_set_console (int console_type
, int accepted_consoles
,
90 int width
, int height
, int depth
,
91 int console_required
);
93 grub_multiboot_load (grub_file_t file
, const char *filename
);
94 /* Load ELF32 or ELF64. */
96 grub_multiboot_load_elf (grub_file_t file
, const char *filename
,
98 extern grub_size_t grub_multiboot_pure_size
;
99 extern grub_size_t grub_multiboot_alloc_mbi
;
100 extern grub_uint32_t grub_multiboot_payload_eip
;
103 #endif /* ! GRUB_MULTIBOOT_HEADER */