2010-08-02 12:32:58 +00:00
|
|
|
|
/*
|
|
|
|
|
* Copyright 2010 Stefan Lankes, Chair for Operating Systems,
|
|
|
|
|
* RWTH Aachen University
|
|
|
|
|
*
|
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
|
*
|
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
*
|
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
|
* limitations under the License.
|
|
|
|
|
*
|
|
|
|
|
* This file is part of MetalSVM.
|
|
|
|
|
*/
|
2011-04-04 11:27:49 +02:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @author Stefan Lankes
|
|
|
|
|
* @file arch/x86/include/asm/multiboot.h
|
|
|
|
|
* @brief Structures related to the Multiboot interface
|
|
|
|
|
*
|
|
|
|
|
* MetalSVM is able to use Multiboot (http://www.gnu.org/software/grub/manual/multiboot/),
|
|
|
|
|
* which specifies an interface between a boot loader and a operating system.\n
|
|
|
|
|
* \n
|
|
|
|
|
* This file contains several structures needed to match the interface.
|
|
|
|
|
*/
|
|
|
|
|
|
2010-08-02 12:32:58 +00:00
|
|
|
|
#ifndef __ARCH_MULTIBOOT_H__
|
|
|
|
|
#define __ARCH_MULTIBOOT_H__
|
|
|
|
|
|
|
|
|
|
#include <metalsvm/stddef.h>
|
|
|
|
|
|
2010-08-05 11:53:02 +00:00
|
|
|
|
#ifdef CONFIG_MULTIBOOT
|
2010-08-02 12:32:58 +00:00
|
|
|
|
|
2013-11-20 11:20:52 +01:00
|
|
|
|
/// Does the bootloader provide mem_* fields?
|
|
|
|
|
#define MULTIBOOT_INFO_MEM 0x00000001
|
|
|
|
|
/// Does the bootloader provide a list of modules?
|
2011-02-09 07:07:07 +00:00
|
|
|
|
#define MULTIBOOT_INFO_MODS 0x00000008
|
2013-11-20 11:20:52 +01:00
|
|
|
|
/// Does the bootloader provide a full memory map?
|
2011-02-09 07:07:07 +00:00
|
|
|
|
#define MULTIBOOT_INFO_MEM_MAP 0x00000040
|
|
|
|
|
|
2010-08-02 12:32:58 +00:00
|
|
|
|
typedef uint16_t multiboot_uint16_t;
|
|
|
|
|
typedef uint32_t multiboot_uint32_t;
|
|
|
|
|
typedef uint64_t multiboot_uint64_t;
|
|
|
|
|
|
2011-04-04 11:27:49 +02:00
|
|
|
|
/** The symbol table for a.out. */
|
2010-08-02 12:32:58 +00:00
|
|
|
|
struct multiboot_aout_symbol_table
|
|
|
|
|
{
|
|
|
|
|
multiboot_uint32_t tabsize;
|
|
|
|
|
multiboot_uint32_t strsize;
|
|
|
|
|
multiboot_uint32_t addr;
|
|
|
|
|
multiboot_uint32_t reserved;
|
|
|
|
|
};
|
|
|
|
|
typedef struct multiboot_aout_symbol_table multiboot_aout_symbol_table_t;
|
|
|
|
|
|
2011-04-04 11:27:49 +02:00
|
|
|
|
/** The section header table for ELF. */
|
2010-08-02 12:32:58 +00:00
|
|
|
|
struct multiboot_elf_section_header_table
|
|
|
|
|
{
|
|
|
|
|
multiboot_uint32_t num;
|
|
|
|
|
multiboot_uint32_t size;
|
|
|
|
|
multiboot_uint32_t addr;
|
|
|
|
|
multiboot_uint32_t shndx;
|
|
|
|
|
};
|
|
|
|
|
typedef struct multiboot_elf_section_header_table multiboot_elf_section_header_table_t;
|
|
|
|
|
|
|
|
|
|
struct multiboot_info
|
|
|
|
|
{
|
2011-04-04 11:27:49 +02:00
|
|
|
|
/** Multiboot info version number */
|
2010-08-02 12:32:58 +00:00
|
|
|
|
multiboot_uint32_t flags;
|
|
|
|
|
|
2011-04-04 11:27:49 +02:00
|
|
|
|
/** Available memory from BIOS */
|
2010-08-02 12:32:58 +00:00
|
|
|
|
multiboot_uint32_t mem_lower;
|
|
|
|
|
multiboot_uint32_t mem_upper;
|
|
|
|
|
|
2011-04-04 11:27:49 +02:00
|
|
|
|
/** "root" partition */
|
2010-08-02 12:32:58 +00:00
|
|
|
|
multiboot_uint32_t boot_device;
|
|
|
|
|
|
2011-04-04 11:27:49 +02:00
|
|
|
|
/** Kernel command line */
|
2010-08-02 12:32:58 +00:00
|
|
|
|
multiboot_uint32_t cmdline;
|
|
|
|
|
|
2011-04-04 11:27:49 +02:00
|
|
|
|
/** Boot-Module list */
|
2010-08-02 12:32:58 +00:00
|
|
|
|
multiboot_uint32_t mods_count;
|
|
|
|
|
multiboot_uint32_t mods_addr;
|
|
|
|
|
|
|
|
|
|
union
|
|
|
|
|
{
|
|
|
|
|
multiboot_aout_symbol_table_t aout_sym;
|
|
|
|
|
multiboot_elf_section_header_table_t elf_sec;
|
|
|
|
|
} u;
|
|
|
|
|
|
2011-04-04 11:27:49 +02:00
|
|
|
|
/** Memory Mapping buffer */
|
2010-08-02 12:32:58 +00:00
|
|
|
|
multiboot_uint32_t mmap_length;
|
|
|
|
|
multiboot_uint32_t mmap_addr;
|
|
|
|
|
|
2011-04-04 11:27:49 +02:00
|
|
|
|
/** Drive Info buffer */
|
2010-08-02 12:32:58 +00:00
|
|
|
|
multiboot_uint32_t drives_length;
|
|
|
|
|
multiboot_uint32_t drives_addr;
|
|
|
|
|
|
2011-04-04 11:27:49 +02:00
|
|
|
|
/** ROM configuration table */
|
2010-08-02 12:32:58 +00:00
|
|
|
|
multiboot_uint32_t config_table;
|
|
|
|
|
|
2011-04-04 11:27:49 +02:00
|
|
|
|
/** Boot Loader Name */
|
2010-08-02 12:32:58 +00:00
|
|
|
|
multiboot_uint32_t boot_loader_name;
|
|
|
|
|
|
2011-04-04 11:27:49 +02:00
|
|
|
|
/** APM table */
|
2010-08-02 12:32:58 +00:00
|
|
|
|
multiboot_uint32_t apm_table;
|
|
|
|
|
|
2011-04-04 11:27:49 +02:00
|
|
|
|
/** Video */
|
2010-08-02 12:32:58 +00:00
|
|
|
|
multiboot_uint32_t vbe_control_info;
|
|
|
|
|
multiboot_uint32_t vbe_mode_info;
|
|
|
|
|
multiboot_uint16_t vbe_mode;
|
|
|
|
|
multiboot_uint16_t vbe_interface_seg;
|
|
|
|
|
multiboot_uint16_t vbe_interface_off;
|
|
|
|
|
multiboot_uint16_t vbe_interface_len;
|
|
|
|
|
};
|
|
|
|
|
typedef struct multiboot_info multiboot_info_t;
|
|
|
|
|
|
|
|
|
|
struct multiboot_mmap_entry
|
|
|
|
|
{
|
|
|
|
|
multiboot_uint32_t size;
|
|
|
|
|
multiboot_uint64_t addr;
|
|
|
|
|
multiboot_uint64_t len;
|
|
|
|
|
#define MULTIBOOT_MEMORY_AVAILABLE 1
|
|
|
|
|
#define MULTIBOOT_MEMORY_RESERVED 2
|
|
|
|
|
multiboot_uint32_t type;
|
|
|
|
|
} __attribute__((packed));
|
|
|
|
|
typedef struct multiboot_mmap_entry multiboot_memory_map_t;
|
|
|
|
|
|
|
|
|
|
struct multiboot_mod_list
|
|
|
|
|
{
|
2011-04-04 11:27:49 +02:00
|
|
|
|
/** the memory used goes from bytes ’mod start’ to ’mod end-1’ inclusive */
|
2010-08-02 12:32:58 +00:00
|
|
|
|
multiboot_uint32_t mod_start;
|
|
|
|
|
multiboot_uint32_t mod_end;
|
|
|
|
|
|
2011-04-04 11:27:49 +02:00
|
|
|
|
/** Module command line */
|
2010-08-02 12:32:58 +00:00
|
|
|
|
multiboot_uint32_t cmdline;
|
|
|
|
|
|
2011-04-04 11:27:49 +02:00
|
|
|
|
/** padding to take it to 16 bytes (must be zero) */
|
2010-08-02 12:32:58 +00:00
|
|
|
|
multiboot_uint32_t pad;
|
|
|
|
|
};
|
|
|
|
|
typedef struct multiboot_mod_list multiboot_module_t;
|
|
|
|
|
|
|
|
|
|
extern multiboot_info_t* mb_info;
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|