2003-11-16 16:36:39 +00:00
|
|
|
/* multiboot.h - multiboot header file. */
|
|
|
|
/*
|
2004-04-04 13:46:03 +00:00
|
|
|
* GRUB -- GRand Unified Bootloader
|
2007-07-21 23:32:33 +00:00
|
|
|
* Copyright (C) 2003,2007 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
|
|
|
*/
|
|
|
|
|
2004-04-04 13:46:03 +00:00
|
|
|
#ifndef GRUB_MULTIBOOT_MACHINE_HEADER
|
|
|
|
#define GRUB_MULTIBOOT_MACHINE_HEADER 1
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* How many bytes from the start of the file we search for the header. */
|
2004-04-04 13:46:03 +00:00
|
|
|
#define GRUB_MB_SEARCH 8192
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* The magic field should contain this. */
|
2004-04-04 13:46:03 +00:00
|
|
|
#define GRUB_MB_MAGIC 0x1BADB002
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* This should be in %eax. */
|
2004-04-04 13:46:03 +00:00
|
|
|
#define GRUB_MB_MAGIC2 0x2BADB002
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* The bits in the required part of flags field we don't support. */
|
2004-04-04 13:46:03 +00:00
|
|
|
#define GRUB_MB_UNSUPPORTED 0x0000fffc
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* Alignment of multiboot modules. */
|
2004-04-04 13:46:03 +00:00
|
|
|
#define GRUB_MB_MOD_ALIGN 0x00001000
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Flags set in the 'flags' member of the multiboot header.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Align all boot modules on i386 page (4KB) boundaries. */
|
2004-04-04 13:46:03 +00:00
|
|
|
#define GRUB_MB_PAGE_ALIGN 0x00000001
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* Must pass memory information to OS. */
|
2004-04-04 13:46:03 +00:00
|
|
|
#define GRUB_MB_MEMORY_INFO 0x00000002
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* Must pass video information to OS. */
|
2004-04-04 13:46:03 +00:00
|
|
|
#define GRUB_MB_VIDEO_MODE 0x00000004
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* This flag indicates the use of the address fields in the header. */
|
2004-04-04 13:46:03 +00:00
|
|
|
#define GRUB_MB_AOUT_KLUDGE 0x00010000
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Flags to be set in the 'flags' member of the multiboot info structure.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* is there basic lower/upper memory information? */
|
2004-04-04 13:46:03 +00:00
|
|
|
#define GRUB_MB_INFO_MEMORY 0x00000001
|
2003-11-16 16:36:39 +00:00
|
|
|
/* is there a boot device set? */
|
2004-04-04 13:46:03 +00:00
|
|
|
#define GRUB_MB_INFO_BOOTDEV 0x00000002
|
2003-11-16 16:36:39 +00:00
|
|
|
/* is the command-line defined? */
|
2004-04-04 13:46:03 +00:00
|
|
|
#define GRUB_MB_INFO_CMDLINE 0x00000004
|
2003-11-16 16:36:39 +00:00
|
|
|
/* are there modules to do something with? */
|
2004-04-04 13:46:03 +00:00
|
|
|
#define GRUB_MB_INFO_MODS 0x00000008
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* These next two are mutually exclusive */
|
|
|
|
|
|
|
|
/* is there a symbol table loaded? */
|
2004-04-04 13:46:03 +00:00
|
|
|
#define GRUB_MB_INFO_AOUT_SYMS 0x00000010
|
2003-11-16 16:36:39 +00:00
|
|
|
/* is there an ELF section header table? */
|
2004-04-04 13:46:03 +00:00
|
|
|
#define GRUB_MB_INFO_ELF_SHDR 0x00000020
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* is there a full memory map? */
|
2004-04-04 13:46:03 +00:00
|
|
|
#define GRUB_MB_INFO_MEM_MAP 0x00000040
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* Is there drive info? */
|
2004-04-04 13:46:03 +00:00
|
|
|
#define GRUB_MB_INFO_DRIVE_INFO 0x00000080
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* Is there a config table? */
|
2004-04-04 13:46:03 +00:00
|
|
|
#define GRUB_MB_INFO_CONFIG_TABLE 0x00000100
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* Is there a boot loader name? */
|
2004-04-04 13:46:03 +00:00
|
|
|
#define GRUB_MB_INFO_BOOT_LOADER_NAME 0x00000200
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* Is there a APM table? */
|
2004-04-04 13:46:03 +00:00
|
|
|
#define GRUB_MB_INFO_APM_TABLE 0x00000400
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* Is there video information? */
|
2004-04-04 13:46:03 +00:00
|
|
|
#define GRUB_MB_INFO_VIDEO_INFO 0x00000800
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
#ifndef ASM_FILE
|
|
|
|
|
2004-04-04 13:46:03 +00:00
|
|
|
#include <grub/types.h>
|
2003-11-16 16:36:39 +00:00
|
|
|
|
2004-04-04 13:46:03 +00:00
|
|
|
struct grub_multiboot_header
|
2003-11-16 16:36:39 +00:00
|
|
|
{
|
2004-04-04 13:46:03 +00:00
|
|
|
/* Must be GRUB_MB_MAGIC - see above. */
|
|
|
|
grub_uint32_t magic;
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* Feature flags. */
|
2004-04-04 13:46:03 +00:00
|
|
|
grub_uint32_t flags;
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* The above fields plus this one must equal 0 mod 2^32. */
|
2004-04-04 13:46:03 +00:00
|
|
|
grub_uint32_t checksum;
|
2003-11-16 16:36:39 +00:00
|
|
|
|
2004-04-04 13:46:03 +00:00
|
|
|
/* These are only valid if GRUB_MB_AOUT_KLUDGE is set. */
|
|
|
|
grub_uint32_t header_addr;
|
|
|
|
grub_uint32_t load_addr;
|
|
|
|
grub_uint32_t load_end_addr;
|
|
|
|
grub_uint32_t bss_end_addr;
|
|
|
|
grub_uint32_t entry_addr;
|
|
|
|
|
|
|
|
/* These are only valid if GRUB_MB_VIDEO_MODE is set. */
|
|
|
|
grub_uint32_t mode_type;
|
|
|
|
grub_uint32_t width;
|
|
|
|
grub_uint32_t height;
|
|
|
|
grub_uint32_t depth;
|
2003-11-16 16:36:39 +00:00
|
|
|
};
|
|
|
|
|
2004-04-04 13:46:03 +00:00
|
|
|
struct grub_multiboot_info
|
2003-11-16 16:36:39 +00:00
|
|
|
{
|
2006-02-01 06:12:58 +00:00
|
|
|
/* Multiboot info version number */
|
2004-04-04 13:46:03 +00:00
|
|
|
grub_uint32_t flags;
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* Available memory from BIOS */
|
2004-04-04 13:46:03 +00:00
|
|
|
grub_uint32_t mem_lower;
|
|
|
|
grub_uint32_t mem_upper;
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* "root" partition */
|
2004-04-04 13:46:03 +00:00
|
|
|
grub_uint32_t boot_device;
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* Kernel command line */
|
2004-04-04 13:46:03 +00:00
|
|
|
grub_uint32_t cmdline;
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* Boot-Module list */
|
2004-04-04 13:46:03 +00:00
|
|
|
grub_uint32_t mods_count;
|
|
|
|
grub_uint32_t mods_addr;
|
2003-11-16 16:36:39 +00:00
|
|
|
|
2004-04-04 13:46:03 +00:00
|
|
|
grub_uint32_t syms[4];
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* Memory Mapping buffer */
|
2004-04-04 13:46:03 +00:00
|
|
|
grub_uint32_t mmap_length;
|
|
|
|
grub_uint32_t mmap_addr;
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* Drive Info buffer */
|
2004-04-04 13:46:03 +00:00
|
|
|
grub_uint32_t drives_length;
|
|
|
|
grub_uint32_t drives_addr;
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* ROM configuration table */
|
2004-04-04 13:46:03 +00:00
|
|
|
grub_uint32_t config_table;
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* Boot Loader Name */
|
2004-04-04 13:46:03 +00:00
|
|
|
grub_uint32_t boot_loader_name;
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* APM table */
|
2004-04-04 13:46:03 +00:00
|
|
|
grub_uint32_t apm_table;
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* Video */
|
2004-04-04 13:46:03 +00:00
|
|
|
grub_uint32_t vbe_control_info;
|
|
|
|
grub_uint32_t vbe_mode_info;
|
|
|
|
grub_uint16_t vbe_mode;
|
|
|
|
grub_uint16_t vbe_interface_seg;
|
|
|
|
grub_uint16_t vbe_interface_off;
|
|
|
|
grub_uint16_t vbe_interface_len;
|
2003-11-16 16:36:39 +00:00
|
|
|
};
|
|
|
|
|
2004-04-04 13:46:03 +00:00
|
|
|
struct grub_mod_list
|
2003-11-16 16:36:39 +00:00
|
|
|
{
|
|
|
|
/* the memory used goes from bytes 'mod_start' to 'mod_end-1' inclusive */
|
2004-04-04 13:46:03 +00:00
|
|
|
grub_uint32_t mod_start;
|
|
|
|
grub_uint32_t mod_end;
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* Module command line */
|
2004-04-04 13:46:03 +00:00
|
|
|
grub_uint32_t cmdline;
|
2003-11-16 16:36:39 +00:00
|
|
|
|
|
|
|
/* padding to take it to 16 bytes (must be zero) */
|
2004-04-04 13:46:03 +00:00
|
|
|
grub_uint32_t pad;
|
2003-11-16 16:36:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* ! ASM_FILE */
|
|
|
|
|
2004-04-04 13:46:03 +00:00
|
|
|
#endif /* ! GRUB_MULTIBOOT_MACHINE_HEADER */
|