vaseboot/include/VasEBoot/multiboot2.h

105 lines
3.5 KiB
C

/* multiboot.h - multiboot header file with VasEBoot definitions. */
/*
* VAS_EBOOT -- GRand Unified Bootloader
* Copyright (C) 2003,2007,2008,2010 Free Software Foundation, Inc.
*
* VAS_EBOOT is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VAS_EBOOT is distributed in the hope that it will be useful,
* 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
* along with VAS_EBOOT. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VAS_EBOOT_MULTIBOOT2_HEADER
#define VAS_EBOOT_MULTIBOOT2_HEADER 1
#include <VasEBoot/file.h>
#include <multiboot2.h>
#include <VasEBoot/types.h>
#include <VasEBoot/err.h>
extern struct VasEBoot_relocator *VasEBoot_multiboot2_relocator;
void VasEBoot_multiboot2 (int argc, char *argv[]);
void VasEBoot_module2 (int argc, char *argv[]);
void VasEBoot_multiboot2_set_accepts_video (int val);
VasEBoot_err_t VasEBoot_multiboot2_make_mbi (VasEBoot_uint32_t *target);
void VasEBoot_multiboot2_free_mbi (void);
VasEBoot_err_t VasEBoot_multiboot2_init_mbi (int argc, char *argv[]);
VasEBoot_err_t VasEBoot_multiboot2_add_module (VasEBoot_addr_t start, VasEBoot_size_t size,
int argc, char *argv[]);
void VasEBoot_multiboot2_set_bootdev (void);
void
VasEBoot_multiboot2_add_elfsyms (VasEBoot_size_t num, VasEBoot_size_t entsize,
unsigned shndx, void *data);
VasEBoot_uint32_t VasEBoot_multiboot2_get_mmap_count (void);
VasEBoot_err_t VasEBoot_multiboot2_set_video_mode (void);
/* FIXME: support coreboot as well. */
#if defined (VAS_EBOOT_MACHINE_PCBIOS)
#define VAS_EBOOT_MACHINE_HAS_VBE 1
#else
#define VAS_EBOOT_MACHINE_HAS_VBE 0
#endif
#if defined (VAS_EBOOT_MACHINE_PCBIOS) || defined (VAS_EBOOT_MACHINE_COREBOOT) || defined (VAS_EBOOT_MACHINE_MULTIBOOT) || defined (VAS_EBOOT_MACHINE_QEMU)
#define VAS_EBOOT_MACHINE_HAS_VGA_TEXT 1
#else
#define VAS_EBOOT_MACHINE_HAS_VGA_TEXT 0
#endif
#if defined (VAS_EBOOT_MACHINE_EFI) || defined (VAS_EBOOT_MACHINE_PCBIOS) || defined (VAS_EBOOT_MACHINE_COREBOOT) || defined (VAS_EBOOT_MACHINE_MULTIBOOT)
#define VAS_EBOOT_MACHINE_HAS_ACPI 1
#else
#define VAS_EBOOT_MACHINE_HAS_ACPI 0
#endif
#define VAS_EBOOT_MULTIBOOT2_CONSOLE_EGA_TEXT 1
#define VAS_EBOOT_MULTIBOOT2_CONSOLE_FRAMEBUFFER 2
VasEBoot_err_t
VasEBoot_multiboot2_set_console (int console_type, int accepted_consoles,
int width, int height, int depth,
int console_required);
VasEBoot_err_t
VasEBoot_multiboot2_load (VasEBoot_file_t file, const char *filename);
struct mbi_load_data
{
VasEBoot_file_t file;
const char *filename;
void *buffer;
unsigned int mbi_ver;
int relocatable;
VasEBoot_uint32_t min_addr;
VasEBoot_uint32_t max_addr;
VasEBoot_size_t align;
VasEBoot_uint32_t preference;
VasEBoot_uint32_t link_base_addr;
VasEBoot_uint32_t load_base_addr;
int avoid_efi_boot_services;
};
typedef struct mbi_load_data mbi_load_data_t;
/* Load ELF32 or ELF64. */
VasEBoot_err_t
VasEBoot_multiboot2_load_elf (mbi_load_data_t *mld);
extern VasEBoot_size_t VasEBoot_multiboot2_pure_size;
extern VasEBoot_size_t VasEBoot_multiboot2_alloc_mbi;
extern VasEBoot_uint32_t VasEBoot_multiboot2_payload_eip;
#endif /* ! VAS_EBOOT_MULTIBOOT_HEADER */