2020-01-18 08:38:21 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are met:
|
|
|
|
*
|
|
|
|
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
|
|
* list of conditions and the following disclaimer.
|
|
|
|
*
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer in the documentation
|
|
|
|
* and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
|
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
|
|
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
|
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
2019-06-02 07:50:18 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AK/Types.h>
|
|
|
|
|
|
|
|
struct multiboot_aout_symbol_table {
|
2019-07-03 19:17:35 +00:00
|
|
|
u32 tabsize;
|
|
|
|
u32 strsize;
|
|
|
|
u32 addr;
|
|
|
|
u32 reserved;
|
2019-06-02 07:50:18 +00:00
|
|
|
};
|
|
|
|
typedef struct multiboot_aout_symbol_table multiboot_aout_symbol_table_t;
|
|
|
|
|
|
|
|
struct multiboot_elf_section_header_table {
|
2019-07-03 19:17:35 +00:00
|
|
|
u32 num;
|
|
|
|
u32 size;
|
|
|
|
u32 addr;
|
|
|
|
u32 shndx;
|
2019-06-02 07:50:18 +00:00
|
|
|
};
|
|
|
|
typedef struct multiboot_elf_section_header_table multiboot_elf_section_header_table_t;
|
|
|
|
|
2019-06-09 09:48:58 +00:00
|
|
|
#define MULTIBOOT_MEMORY_AVAILABLE 1
|
|
|
|
#define MULTIBOOT_MEMORY_RESERVED 2
|
|
|
|
#define MULTIBOOT_MEMORY_ACPI_RECLAIMABLE 3
|
|
|
|
#define MULTIBOOT_MEMORY_NVS 4
|
|
|
|
#define MULTIBOOT_MEMORY_BADRAM 5
|
|
|
|
|
|
|
|
struct multiboot_mmap_entry {
|
2019-07-03 19:17:35 +00:00
|
|
|
u32 size;
|
|
|
|
u64 addr;
|
|
|
|
u64 len;
|
|
|
|
u32 type;
|
2019-06-09 09:48:58 +00:00
|
|
|
} __attribute__((packed));
|
|
|
|
typedef struct multiboot_mmap_entry multiboot_memory_map_t;
|
|
|
|
|
2019-06-02 07:50:18 +00:00
|
|
|
struct multiboot_info {
|
|
|
|
// Multiboot info version number.
|
2019-07-03 19:17:35 +00:00
|
|
|
u32 flags;
|
2019-06-02 07:50:18 +00:00
|
|
|
|
|
|
|
// Available memory from BIOS.
|
2019-07-03 19:17:35 +00:00
|
|
|
u32 mem_lower;
|
|
|
|
u32 mem_upper;
|
2019-06-02 07:50:18 +00:00
|
|
|
|
|
|
|
// "root" partition.
|
2019-07-03 19:17:35 +00:00
|
|
|
u32 boot_device;
|
2019-06-02 07:50:18 +00:00
|
|
|
|
|
|
|
// Kernel command line.
|
2019-07-03 19:17:35 +00:00
|
|
|
u32 cmdline;
|
2019-06-02 07:50:18 +00:00
|
|
|
|
|
|
|
// Boot-Module list.
|
2019-07-03 19:17:35 +00:00
|
|
|
u32 mods_count;
|
|
|
|
u32 mods_addr;
|
2019-06-02 07:50:18 +00:00
|
|
|
|
|
|
|
union {
|
|
|
|
multiboot_aout_symbol_table_t aout_sym;
|
|
|
|
multiboot_elf_section_header_table_t elf_sec;
|
|
|
|
} u;
|
|
|
|
|
|
|
|
// Memory Mapping buffer.
|
2019-07-03 19:17:35 +00:00
|
|
|
u32 mmap_length;
|
|
|
|
u32 mmap_addr;
|
2019-06-02 07:50:18 +00:00
|
|
|
|
|
|
|
// Drive Info buffer.
|
2019-07-03 19:17:35 +00:00
|
|
|
u32 drives_length;
|
|
|
|
u32 drives_addr;
|
2019-06-02 07:50:18 +00:00
|
|
|
|
|
|
|
// ROM configuration table.
|
2019-07-03 19:17:35 +00:00
|
|
|
u32 config_table;
|
2019-06-02 07:50:18 +00:00
|
|
|
|
|
|
|
// Boot Loader Name.
|
2019-07-03 19:17:35 +00:00
|
|
|
u32 boot_loader_name;
|
2019-06-02 07:50:18 +00:00
|
|
|
|
|
|
|
// APM table.
|
2019-07-03 19:17:35 +00:00
|
|
|
u32 apm_table;
|
2019-06-02 07:50:18 +00:00
|
|
|
|
|
|
|
// Video.
|
2019-07-03 19:17:35 +00:00
|
|
|
u32 vbe_control_info;
|
|
|
|
u32 vbe_mode_info;
|
|
|
|
u16 vbe_mode;
|
|
|
|
u16 vbe_interface_seg;
|
|
|
|
u16 vbe_interface_off;
|
|
|
|
u16 vbe_interface_len;
|
|
|
|
|
|
|
|
u64 framebuffer_addr;
|
|
|
|
u32 framebuffer_pitch;
|
|
|
|
u32 framebuffer_width;
|
|
|
|
u32 framebuffer_height;
|
|
|
|
u8 framebuffer_bpp;
|
2019-06-02 07:50:18 +00:00
|
|
|
#define MULTIBOOT_FRAMEBUFFER_TYPE_INDEXED 0
|
|
|
|
#define MULTIBOOT_FRAMEBUFFER_TYPE_RGB 1
|
|
|
|
#define MULTIBOOT_FRAMEBUFFER_TYPE_EGA_TEXT 2
|
2019-07-03 19:17:35 +00:00
|
|
|
u8 framebuffer_type;
|
2019-06-02 07:50:18 +00:00
|
|
|
union {
|
|
|
|
struct
|
|
|
|
{
|
2019-07-03 19:17:35 +00:00
|
|
|
u32 framebuffer_palette_addr;
|
|
|
|
u16 framebuffer_palette_num_colors;
|
2019-06-02 07:50:18 +00:00
|
|
|
};
|
|
|
|
struct
|
|
|
|
{
|
2019-07-03 19:17:35 +00:00
|
|
|
u8 framebuffer_red_field_position;
|
|
|
|
u8 framebuffer_red_mask_size;
|
|
|
|
u8 framebuffer_green_field_position;
|
|
|
|
u8 framebuffer_green_mask_size;
|
|
|
|
u8 framebuffer_blue_field_position;
|
|
|
|
u8 framebuffer_blue_mask_size;
|
2019-06-02 07:50:18 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
typedef struct multiboot_info multiboot_info_t;
|
|
|
|
|
|
|
|
extern "C" multiboot_info_t* multiboot_info_ptr;
|