2013-01-08 22:40:58 +08:00
|
|
|
/*
|
2021-02-19 23:55:17 +08:00
|
|
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
2013-01-08 22:40:58 +08:00
|
|
|
*
|
2021-02-19 23:55:17 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2013-01-08 22:40:58 +08:00
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
2021-03-12 10:22:45 +08:00
|
|
|
* 2006-10-09 Bernard the grub related definitions
|
2013-01-08 22:40:58 +08:00
|
|
|
* (multiboot)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GRUB_H__
|
|
|
|
#define __GRUB_H__
|
|
|
|
|
|
|
|
/* the magic number for the multiboot header. */
|
2021-03-12 10:22:45 +08:00
|
|
|
#define MULTIBOOT_HEADER_MAGIC 0x1BADB002
|
2013-01-08 22:40:58 +08:00
|
|
|
|
|
|
|
/* the flags for the multiboot header. */
|
2021-03-12 10:22:45 +08:00
|
|
|
#define MULTIBOOT_HEADER_FLAGS 0x00000003
|
2013-01-08 22:40:58 +08:00
|
|
|
|
|
|
|
/* the magic number passed by a multiboot-compliant boot loader. */
|
2021-03-12 10:22:45 +08:00
|
|
|
#define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002
|
2013-01-08 22:40:58 +08:00
|
|
|
|
|
|
|
#ifndef __ASM__
|
|
|
|
/* the multiboot header. */
|
|
|
|
typedef struct multiboot_header
|
|
|
|
{
|
2021-02-19 23:55:17 +08:00
|
|
|
unsigned long magic;
|
|
|
|
unsigned long flags;
|
|
|
|
unsigned long checksum;
|
|
|
|
unsigned long header_addr;
|
|
|
|
unsigned long load_addr;
|
|
|
|
unsigned long load_end_addr;
|
|
|
|
unsigned long bss_end_addr;
|
|
|
|
unsigned long entry_addr;
|
2013-01-08 22:40:58 +08:00
|
|
|
} multiboot_header_t;
|
|
|
|
|
|
|
|
/* the section header table for elf. */
|
|
|
|
typedef struct elf_section_header_table
|
|
|
|
{
|
2021-02-19 23:55:17 +08:00
|
|
|
unsigned long num;
|
|
|
|
unsigned long size;
|
|
|
|
unsigned long addr;
|
|
|
|
unsigned long shndx;
|
2013-01-08 22:40:58 +08:00
|
|
|
} elf_section_header_table_t;
|
|
|
|
|
|
|
|
/* the multiboot information. */
|
|
|
|
typedef struct multiboot_info
|
|
|
|
{
|
2021-02-19 23:55:17 +08:00
|
|
|
unsigned long flags;
|
|
|
|
unsigned long mem_lower;
|
|
|
|
unsigned long mem_upper;
|
|
|
|
unsigned long boot_device;
|
|
|
|
unsigned long cmdline;
|
|
|
|
unsigned long mods_count;
|
|
|
|
unsigned long mods_addr;
|
|
|
|
union
|
|
|
|
{
|
|
|
|
aout_symbol_table_t aout_sym;
|
|
|
|
elf_section_header_table_t elf_sec;
|
|
|
|
} u;
|
|
|
|
unsigned long mmap_length;
|
|
|
|
unsigned long mmap_addr;
|
2013-01-08 22:40:58 +08:00
|
|
|
} multiboot_info_t;
|
|
|
|
|
|
|
|
/* the module structure. */
|
|
|
|
typedef struct module
|
|
|
|
{
|
2021-02-19 23:55:17 +08:00
|
|
|
unsigned long mod_start;
|
|
|
|
unsigned long mod_end;
|
|
|
|
unsigned long string;
|
|
|
|
unsigned long reserved;
|
2013-01-08 22:40:58 +08:00
|
|
|
} module_t;
|
|
|
|
|
|
|
|
/* the memory map. be careful that the offset 0 is base_addr_low
|
|
|
|
but no size. */
|
|
|
|
typedef struct memory_map
|
|
|
|
{
|
2021-02-19 23:55:17 +08:00
|
|
|
unsigned long size;
|
|
|
|
unsigned long base_addr_low;
|
|
|
|
unsigned long base_addr_high;
|
|
|
|
unsigned long length_low;
|
|
|
|
unsigned long length_high;
|
|
|
|
unsigned long type;
|
2013-01-08 22:40:58 +08:00
|
|
|
} memory_map_t;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|