2N/A/* multiboot.h - Multiboot header file. */
2N/A/* Copyright (C) 1999,2003,2007,2008,2009,2010 Free Software Foundation, Inc.
2N/A * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
2N/A *
2N/A * Permission is hereby granted, free of charge, to any person obtaining a copy
2N/A * of this software and associated documentation files (the "Software"), to
2N/A * deal in the Software without restriction, including without limitation the
2N/A * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
2N/A * sell copies of the Software, and to permit persons to whom the Software is
2N/A * furnished to do so, subject to the following conditions:
2N/A *
2N/A * The above copyright notice and this permission notice shall be included in
2N/A * all copies or substantial portions of the Software.
2N/A *
2N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ANY
2N/A * DEVELOPER OR DISTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
2N/A * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
2N/A * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2N/A */
2N/A
2N/A#ifndef MULTIBOOT_HEADER
2N/A#define MULTIBOOT_HEADER 1
2N/A
2N/A#include <multiboot_types.h>
2N/A
2N/A/* How many bytes from the start of the file we search for the header. */
2N/A#define MULTIBOOT_SEARCH 8192
2N/A#define MULTIBOOT_HEADER_ALIGN 4
2N/A
2N/A/* The magic field should contain this. */
2N/A#define MULTIBOOT_HEADER_MAGIC 0x1BADB002
2N/A
2N/A/* This should be in %eax. */
2N/A#define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002
2N/A
2N/A/* Alignment of multiboot modules. */
2N/A#define MULTIBOOT_MOD_ALIGN 0x00001000
2N/A
2N/A/* Alignment of the multiboot info structure. */
2N/A#define MULTIBOOT_INFO_ALIGN 0x00000004
2N/A
2N/A/* Flags set in the 'flags' member of the multiboot header. */
2N/A
2N/A/* Align all boot modules on i386 page (4KB) boundaries. */
2N/A#define MULTIBOOT_PAGE_ALIGN 0x00000001
2N/A
2N/A/* Must pass memory information to OS. */
2N/A#define MULTIBOOT_MEMORY_INFO 0x00000002
2N/A
2N/A/* Must pass video information to OS. */
2N/A#define MULTIBOOT_VIDEO_MODE 0x00000004
2N/A
2N/A/* This flag indicates the use of the address fields in the header. */
2N/A#define MULTIBOOT_AOUT_KLUDGE 0x00010000
2N/A
2N/A/* Flags to be set in the 'flags' member of the multiboot info structure. */
2N/A
2N/A/* is there basic lower/upper memory information? */
2N/A#define MULTIBOOT_INFO_MEMORY 0x00000001
2N/A/* is there a boot device set? */
2N/A#define MULTIBOOT_INFO_BOOTDEV 0x00000002
2N/A/* is the command-line defined? */
2N/A#define MULTIBOOT_INFO_CMDLINE 0x00000004
2N/A/* are there modules to do something with? */
2N/A#define MULTIBOOT_INFO_MODS 0x00000008
2N/A
2N/A/* These next two are mutually exclusive */
2N/A
2N/A/* is there a symbol table loaded? */
2N/A#define MULTIBOOT_INFO_AOUT_SYMS 0x00000010
2N/A/* is there an ELF section header table? */
2N/A#define MULTIBOOT_INFO_ELF_SHDR 0X00000020
2N/A
2N/A/* is there a full memory map? */
2N/A#define MULTIBOOT_INFO_MEM_MAP 0x00000040
2N/A
2N/A/* Is there drive info? */
2N/A#define MULTIBOOT_INFO_DRIVE_INFO 0x00000080
2N/A
2N/A/* Is there a config table? */
2N/A#define MULTIBOOT_INFO_CONFIG_TABLE 0x00000100
2N/A
2N/A/* Is there a boot loader name? */
2N/A#define MULTIBOOT_INFO_BOOT_LOADER_NAME 0x00000200
2N/A
2N/A/* Is there a APM table? */
2N/A#define MULTIBOOT_INFO_APM_TABLE 0x00000400
2N/A
2N/A/* Is there video information? */
2N/A#define MULTIBOOT_INFO_VBE_INFO 0x00000800
2N/A#define MULTIBOOT_INFO_FRAMEBUFFER_INFO 0x00001000
2N/A
2N/A#ifndef ASM_FILE
2N/A
2N/Astruct multiboot_header
2N/A{
2N/A /* Must be MULTIBOOT_MAGIC - see above. */
2N/A multiboot_uint32_t magic;
2N/A
2N/A /* Feature flags. */
2N/A multiboot_uint32_t flags;
2N/A
2N/A /* The above fields plus this one must equal 0 mod 2^32. */
2N/A multiboot_uint32_t checksum;
2N/A
2N/A /* These are only valid if MULTIBOOT_AOUT_KLUDGE is set. */
2N/A multiboot_uint32_t header_addr;
2N/A multiboot_uint32_t load_addr;
2N/A multiboot_uint32_t load_end_addr;
2N/A multiboot_uint32_t bss_end_addr;
2N/A multiboot_uint32_t entry_addr;
2N/A
2N/A /* These are only valid if MULTIBOOT_VIDEO_MODE is set. */
2N/A multiboot_uint32_t mode_type;
2N/A multiboot_uint32_t width;
2N/A multiboot_uint32_t height;
2N/A multiboot_uint32_t depth;
2N/A};
2N/A
2N/A/* The symbol table for a.out. */
2N/Astruct multiboot_aout_symbol_table
2N/A{
2N/A multiboot_uint32_t tabsize;
2N/A multiboot_uint32_t strsize;
2N/A multiboot_uint32_t addr;
2N/A multiboot_uint32_t reserved;
2N/A};
2N/Atypedef struct multiboot_aout_symbol_table multiboot_aout_symbol_table_t;
2N/A
2N/A/* The section header table for ELF. */
2N/Astruct multiboot_elf_section_header_table
2N/A{
2N/A multiboot_uint32_t num;
2N/A multiboot_uint32_t size;
2N/A multiboot_uint32_t addr;
2N/A multiboot_uint32_t shndx;
2N/A};
2N/Atypedef struct multiboot_elf_section_header_table multiboot_elf_section_header_table_t;
2N/A
2N/Astruct multiboot_info
2N/A{
2N/A /* Multiboot info version number */
2N/A multiboot_uint32_t flags;
2N/A
2N/A /* Available memory from BIOS */
2N/A multiboot_uint32_t mem_lower;
2N/A multiboot_uint32_t mem_upper;
2N/A
2N/A /* "root" partition */
2N/A multiboot_uint32_t boot_device;
2N/A
2N/A /* Kernel command line */
2N/A multiboot_uint32_t cmdline;
2N/A
2N/A /* Boot-Module list */
2N/A multiboot_uint32_t mods_count;
2N/A multiboot_uint32_t mods_addr;
2N/A
2N/A union
2N/A {
2N/A multiboot_aout_symbol_table_t aout_sym;
2N/A multiboot_elf_section_header_table_t elf_sec;
2N/A } u;
2N/A
2N/A /* Memory Mapping buffer */
2N/A multiboot_uint32_t mmap_length;
2N/A multiboot_uint32_t mmap_addr;
2N/A
2N/A /* Drive Info buffer */
2N/A multiboot_uint32_t drives_length;
2N/A multiboot_uint32_t drives_addr;
2N/A
2N/A /* ROM configuration table */
2N/A multiboot_uint32_t config_table;
2N/A
2N/A /* Boot Loader Name */
2N/A multiboot_uint32_t boot_loader_name;
2N/A
2N/A /* APM table */
2N/A multiboot_uint32_t apm_table;
2N/A
2N/A /* Video */
2N/A multiboot_uint32_t vbe_control_info;
2N/A multiboot_uint32_t vbe_mode_info;
2N/A multiboot_uint16_t vbe_mode;
2N/A multiboot_uint16_t vbe_interface_seg;
2N/A multiboot_uint16_t vbe_interface_off;
2N/A multiboot_uint16_t vbe_interface_len;
2N/A
2N/A multiboot_uint64_t framebuffer_addr;
2N/A multiboot_uint32_t framebuffer_pitch;
2N/A multiboot_uint32_t framebuffer_width;
2N/A multiboot_uint32_t framebuffer_height;
2N/A multiboot_uint8_t framebuffer_bpp;
2N/A#define MULTIBOOT_FRAMEBUFFER_TYPE_INDEXED 0
2N/A#define MULTIBOOT_FRAMEBUFFER_TYPE_RGB 1
2N/A#define MULTIBOOT_FRAMEBUFFER_TYPE_EGA_TEXT 2
2N/A multiboot_uint8_t framebuffer_type;
2N/A union
2N/A {
2N/A struct
2N/A {
2N/A multiboot_uint32_t framebuffer_palette_addr;
2N/A multiboot_uint16_t framebuffer_palette_num_colors;
2N/A };
2N/A struct
2N/A {
2N/A multiboot_uint8_t framebuffer_red_field_position;
2N/A multiboot_uint8_t framebuffer_red_mask_size;
2N/A multiboot_uint8_t framebuffer_green_field_position;
2N/A multiboot_uint8_t framebuffer_green_mask_size;
2N/A multiboot_uint8_t framebuffer_blue_field_position;
2N/A multiboot_uint8_t framebuffer_blue_mask_size;
2N/A };
2N/A };
2N/A};
2N/Atypedef struct multiboot_info multiboot_info_t;
2N/A
2N/Astruct multiboot_mmap_entry
2N/A{
2N/A multiboot_uint32_t size;
2N/A multiboot_uint64_t addr;
2N/A multiboot_uint64_t len;
2N/A#define MULTIBOOT_MEMORY_AVAILABLE 1
2N/A#define MULTIBOOT_MEMORY_RESERVED 2
2N/A#define MULTIBOOT_MEMORY_ACPI_RECLAIMABLE 3
2N/A#define MULTIBOOT_MEMORY_NVS 4
2N/A#define MULTIBOOT_MEMORY_BADRAM 5
2N/A multiboot_uint32_t type;
2N/A} __attribute__((packed));
2N/Atypedef struct multiboot_mmap_entry multiboot_memory_map_t;
2N/A
2N/Astruct multiboot_mod_list
2N/A{
2N/A /* the memory used goes from bytes 'mod_start' to 'mod_end-1' inclusive */
2N/A multiboot_uint32_t mod_start;
2N/A multiboot_uint32_t mod_end;
2N/A
2N/A /* Module command line */
2N/A multiboot_uint32_t cmdline;
2N/A
2N/A /* padding to take it to 16 bytes (must be zero) */
2N/A multiboot_uint32_t pad;
2N/A};
2N/Atypedef struct multiboot_mod_list multiboot_module_t;
2N/A
2N/A/* APM BIOS info. */
2N/Astruct multiboot_apm_info
2N/A{
2N/A grub_uint16_t version;
2N/A grub_uint16_t cseg;
2N/A grub_uint32_t offset;
2N/A grub_uint16_t cseg_16;
2N/A grub_uint16_t dseg;
2N/A grub_uint16_t flags;
2N/A grub_uint16_t cseg_len;
2N/A grub_uint16_t cseg_16_len;
2N/A grub_uint16_t dseg_len;
2N/A};
2N/A
2N/A#endif /* ! ASM_FILE */
2N/A
2N/A#endif /* ! MULTIBOOT_HEADER */