2007-07-25 00:44:03 +00:00
|
|
|
/* multiboot.h - multiboot header file with grub definitions. */
|
2003-11-16 16:36:39 +00:00
|
|
|
/*
|
2004-04-04 13:46:03 +00:00
|
|
|
* GRUB -- GRand Unified Bootloader
|
2010-01-07 21:05:25 +00:00
|
|
|
* Copyright (C) 2003,2007,2008,2010 Free Software Foundation, Inc.
|
2003-11-16 16:36:39 +00:00
|
|
|
*
|
2007-07-21 23:32:33 +00:00
|
|
|
* GRUB is free software: you can redistribute it and/or modify
|
2003-11-16 16:36:39 +00:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2007-07-21 23:32:33 +00:00
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
2003-11-16 16:36:39 +00:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
2007-07-21 23:32:33 +00:00
|
|
|
* GRUB is distributed in the hope that it will be useful,
|
2003-11-16 16:36:39 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2007-07-21 23:32:33 +00:00
|
|
|
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
2003-11-16 16:36:39 +00:00
|
|
|
*/
|
|
|
|
|
2007-07-25 00:44:03 +00:00
|
|
|
#ifndef GRUB_MULTIBOOT_HEADER
|
|
|
|
#define GRUB_MULTIBOOT_HEADER 1
|
2003-11-16 16:36:39 +00:00
|
|
|
|
2010-03-08 14:40:57 +00:00
|
|
|
#include <grub/file.h>
|
|
|
|
|
2010-01-07 21:05:25 +00:00
|
|
|
#ifdef GRUB_USE_MULTIBOOT2
|
|
|
|
#include <multiboot2.h>
|
|
|
|
/* Same thing as far as our loader is concerned. */
|
|
|
|
#define MULTIBOOT_BOOTLOADER_MAGIC MULTIBOOT2_BOOTLOADER_MAGIC
|
|
|
|
#define MULTIBOOT_HEADER_MAGIC MULTIBOOT2_HEADER_MAGIC
|
|
|
|
#else
|
2007-07-25 00:44:03 +00:00
|
|
|
#include <multiboot.h>
|
2010-01-07 21:05:25 +00:00
|
|
|
#endif
|
2003-11-16 16:36:39 +00:00
|
|
|
|
2010-01-10 17:58:18 +00:00
|
|
|
#include <grub/types.h>
|
|
|
|
#include <grub/err.h>
|
|
|
|
|
2013-10-28 14:23:46 +00:00
|
|
|
#ifndef GRUB_USE_MULTIBOOT2
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
GRUB_MULTIBOOT_QUIRKS_NONE = 0,
|
|
|
|
GRUB_MULTIBOOT_QUIRK_BAD_KLUDGE = 1,
|
|
|
|
GRUB_MULTIBOOT_QUIRK_MODULES_AFTER_KERNEL = 2
|
|
|
|
} grub_multiboot_quirks_t;
|
|
|
|
extern grub_multiboot_quirks_t grub_multiboot_quirks;
|
|
|
|
#endif
|
|
|
|
|
2010-01-13 19:49:13 +00:00
|
|
|
extern struct grub_relocator *grub_multiboot_relocator;
|
|
|
|
|
2007-07-25 00:44:03 +00:00
|
|
|
void grub_multiboot (int argc, char *argv[]);
|
|
|
|
void grub_module (int argc, char *argv[]);
|
2003-11-16 16:36:39 +00:00
|
|
|
|
2010-01-14 14:54:14 +00:00
|
|
|
void grub_multiboot_set_accepts_video (int val);
|
2010-01-11 10:29:52 +00:00
|
|
|
grub_err_t grub_multiboot_make_mbi (grub_uint32_t *target);
|
2010-01-10 17:58:18 +00:00
|
|
|
void grub_multiboot_free_mbi (void);
|
|
|
|
grub_err_t grub_multiboot_init_mbi (int argc, char *argv[]);
|
|
|
|
grub_err_t grub_multiboot_add_module (grub_addr_t start, grub_size_t size,
|
|
|
|
int argc, char *argv[]);
|
|
|
|
void grub_multiboot_set_bootdev (void);
|
2010-01-14 18:14:24 +00:00
|
|
|
void
|
|
|
|
grub_multiboot_add_elfsyms (grub_size_t num, grub_size_t entsize,
|
|
|
|
unsigned shndx, void *data);
|
2010-01-10 17:58:18 +00:00
|
|
|
|
2010-03-07 13:59:15 +00:00
|
|
|
grub_uint32_t grub_get_multiboot_mmap_count (void);
|
2010-01-16 15:25:43 +00:00
|
|
|
grub_err_t grub_multiboot_set_video_mode (void);
|
|
|
|
|
2010-09-29 21:51:12 +00:00
|
|
|
/* FIXME: support coreboot as well. */
|
|
|
|
#if defined (GRUB_MACHINE_PCBIOS)
|
|
|
|
#define GRUB_MACHINE_HAS_VBE 1
|
|
|
|
#else
|
|
|
|
#define GRUB_MACHINE_HAS_VBE 0
|
|
|
|
#endif
|
|
|
|
|
2010-05-01 12:06:53 +00:00
|
|
|
#if defined (GRUB_MACHINE_PCBIOS) || defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_MULTIBOOT) || defined (GRUB_MACHINE_QEMU)
|
2010-01-16 15:25:43 +00:00
|
|
|
#define GRUB_MACHINE_HAS_VGA_TEXT 1
|
|
|
|
#else
|
|
|
|
#define GRUB_MACHINE_HAS_VGA_TEXT 0
|
|
|
|
#endif
|
2010-01-10 17:58:18 +00:00
|
|
|
|
2010-09-22 12:51:49 +00:00
|
|
|
#if defined (GRUB_MACHINE_EFI) || defined (GRUB_MACHINE_PCBIOS) || defined (GRUB_MACHINE_COREBOOT) || defined (GRUB_MACHINE_MULTIBOOT)
|
|
|
|
#define GRUB_MACHINE_HAS_ACPI 1
|
|
|
|
#else
|
|
|
|
#define GRUB_MACHINE_HAS_ACPI 0
|
|
|
|
#endif
|
|
|
|
|
2010-03-08 14:40:57 +00:00
|
|
|
#define GRUB_MULTIBOOT_CONSOLE_EGA_TEXT 1
|
|
|
|
#define GRUB_MULTIBOOT_CONSOLE_FRAMEBUFFER 2
|
|
|
|
|
|
|
|
grub_err_t
|
|
|
|
grub_multiboot_set_console (int console_type, int accepted_consoles,
|
2010-03-10 10:40:20 +00:00
|
|
|
int width, int height, int depth,
|
|
|
|
int console_required);
|
2010-03-08 14:40:57 +00:00
|
|
|
grub_err_t
|
2012-02-08 18:26:01 +00:00
|
|
|
grub_multiboot_load (grub_file_t file, const char *filename);
|
2010-03-08 14:40:57 +00:00
|
|
|
/* Load ELF32 or ELF64. */
|
|
|
|
grub_err_t
|
2012-02-08 18:26:01 +00:00
|
|
|
grub_multiboot_load_elf (grub_file_t file, const char *filename,
|
|
|
|
void *buffer);
|
2010-03-08 14:40:57 +00:00
|
|
|
extern grub_size_t grub_multiboot_pure_size;
|
|
|
|
extern grub_size_t grub_multiboot_alloc_mbi;
|
2010-04-01 20:17:26 +00:00
|
|
|
extern grub_uint32_t grub_multiboot_payload_eip;
|
2010-01-10 17:58:18 +00:00
|
|
|
|
|
|
|
|
2007-07-25 00:44:03 +00:00
|
|
|
#endif /* ! GRUB_MULTIBOOT_HEADER */
|