1N/A/*
1N/A * GRUB -- GRand Unified Bootloader
1N/A * Copyright (C) 2000,2003 Free Software Foundation, Inc.
1N/A *
1N/A * This program is free software; you can redistribute it and/or modify
1N/A * it under the terms of the GNU General Public License as published by
1N/A * the Free Software Foundation; either version 2 of the License, or
1N/A * (at your option) any later version.
1N/A *
1N/A * This program is distributed in the hope that it will be useful,
1N/A * but WITHOUT ANY WARRANTY; without even the implied warranty of
1N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1N/A * GNU General Public License for more details.
1N/A *
1N/A * You should have received a copy of the GNU General Public License
1N/A * along with this program; if not, write to the Free Software
1N/A * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
1N/A */
1N/A
1N/A/*
1N/A * The structure type "mod_list" is used by the "multiboot_info" structure.
1N/A */
1N/A
1N/Astruct mod_list
1N/A{
1N/A /* the memory used goes from bytes 'mod_start' to 'mod_end-1' inclusive */
1N/A unsigned long mod_start;
1N/A unsigned long mod_end;
1N/A
1N/A /* Module command line */
1N/A unsigned long cmdline;
1N/A
1N/A /* padding to take it to 16 bytes (must be zero) */
1N/A unsigned long pad;
1N/A};
1N/A
1N/A
1N/A/*
1N/A * INT-15, AX=E820 style "AddressRangeDescriptor"
1N/A * ...with a "size" parameter on the front which is the structure size - 4,
1N/A * pointing to the next one, up until the full buffer length of the memory
1N/A * map has been reached.
1N/A */
1N/A
1N/Astruct AddrRangeDesc
1N/A{
1N/A unsigned long size;
1N/A unsigned long long BaseAddr;
1N/A unsigned long long Length;
1N/A unsigned long Type;
1N/A
1N/A /* unspecified optional padding... */
1N/A} __attribute__ ((packed));
1N/A
1N/A/* usable memory "Type", all others are reserved. */
1N/A#define MB_ARD_MEMORY 1
1N/A
1N/A
1N/A/* Drive Info structure. */
1N/Astruct drive_info
1N/A{
1N/A /* The size of this structure. */
1N/A unsigned long size;
1N/A
1N/A /* The BIOS drive number. */
1N/A unsigned char drive_number;
1N/A
1N/A /* The access mode (see below). */
1N/A unsigned char drive_mode;
1N/A
1N/A /* The BIOS geometry. */
1N/A unsigned short drive_cylinders;
1N/A unsigned char drive_heads;
1N/A unsigned char drive_sectors;
1N/A
1N/A /* The array of I/O ports used for the drive. */
1N/A unsigned short drive_ports[0];
1N/A};
1N/A
1N/A/* Drive Mode. */
1N/A#define MB_DI_CHS_MODE 0
1N/A#define MB_DI_LBA_MODE 1
1N/A
1N/A
1N/A/* APM BIOS info. */
1N/Astruct apm_info
1N/A{
1N/A unsigned short version;
1N/A unsigned short cseg;
1N/A unsigned long offset;
1N/A unsigned short cseg_16;
1N/A unsigned short dseg_16;
1N/A unsigned short cseg_len;
1N/A unsigned short cseg_16_len;
1N/A unsigned short dseg_16_len;
1N/A};
1N/A
1N/A
1N/A/*
1N/A * MultiBoot Info description
1N/A *
1N/A * This is the struct passed to the boot image. This is done by placing
1N/A * its address in the EAX register.
1N/A */
1N/A
1N/Astruct multiboot_info
1N/A{
1N/A /* MultiBoot info version number */
1N/A unsigned long flags;
1N/A
1N/A /* Available memory from BIOS */
1N/A unsigned long mem_lower;
1N/A unsigned long mem_upper;
1N/A
1N/A /* "root" partition */
1N/A unsigned long boot_device;
1N/A
1N/A /* Kernel command line */
1N/A unsigned long cmdline;
1N/A
1N/A /* Boot-Module list */
1N/A unsigned long mods_count;
1N/A unsigned long mods_addr;
1N/A
1N/A union
1N/A {
1N/A struct
1N/A {
1N/A /* (a.out) Kernel symbol table info */
1N/A unsigned long tabsize;
1N/A unsigned long strsize;
1N/A unsigned long addr;
1N/A unsigned long pad;
1N/A }
1N/A a;
1N/A
1N/A struct
1N/A {
1N/A /* (ELF) Kernel section header table */
1N/A unsigned long num;
1N/A unsigned long size;
1N/A unsigned long addr;
1N/A unsigned long shndx;
1N/A }
1N/A e;
1N/A }
1N/A syms;
1N/A
1N/A /* Memory Mapping buffer */
1N/A unsigned long mmap_length;
1N/A unsigned long mmap_addr;
1N/A
1N/A /* Drive Info buffer */
1N/A unsigned long drives_length;
1N/A unsigned long drives_addr;
1N/A
1N/A /* ROM configuration table */
1N/A unsigned long config_table;
1N/A
1N/A /* Boot Loader Name */
1N/A unsigned long boot_loader_name;
1N/A
1N/A /* APM table */
1N/A unsigned long apm_table;
1N/A
1N/A /* Video */
1N/A unsigned long vbe_control_info;
1N/A unsigned long vbe_mode_info;
1N/A unsigned short vbe_mode;
1N/A unsigned short vbe_interface_seg;
1N/A unsigned short vbe_interface_off;
1N/A unsigned short vbe_interface_len;
1N/A};
1N/A
1N/A/*
1N/A * Flags to be set in the 'flags' parameter above
1N/A */
1N/A
1N/A/* is there basic lower/upper memory information? */
1N/A#define MB_INFO_MEMORY 0x00000001
1N/A/* is there a boot device set? */
1N/A#define MB_INFO_BOOTDEV 0x00000002
1N/A/* is the command-line defined? */
1N/A#define MB_INFO_CMDLINE 0x00000004
1N/A/* are there modules to do something with? */
1N/A#define MB_INFO_MODS 0x00000008
1N/A
1N/A/* These next two are mutually exclusive */
1N/A
1N/A/* is there a symbol table loaded? */
1N/A#define MB_INFO_AOUT_SYMS 0x00000010
1N/A/* is there an ELF section header table? */
1N/A#define MB_INFO_ELF_SHDR 0x00000020
1N/A
1N/A/* is there a full memory map? */
1N/A#define MB_INFO_MEM_MAP 0x00000040
1N/A
1N/A/* Is there drive info? */
1N/A#define MB_INFO_DRIVE_INFO 0x00000080
1N/A
1N/A/* Is there a config table? */
1N/A#define MB_INFO_CONFIG_TABLE 0x00000100
1N/A
1N/A/* Is there a boot loader name? */
1N/A#define MB_INFO_BOOT_LOADER_NAME 0x00000200
1N/A
1N/A/* Is there a APM table? */
1N/A#define MB_INFO_APM_TABLE 0x00000400
1N/A
1N/A/* Is there video information? */
1N/A#define MB_INFO_VIDEO_INFO 0x00000800
1N/A
1N/A/*
1N/A * The following value must be present in the EAX register.
1N/A */
1N/A
1N/A#define MULTIBOOT_VALID 0x2BADB002