Preparation for mbh tag

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-03-08 15:40:57 +01:00
parent 8eb567e662
commit b1f6f35ae9
8 changed files with 318 additions and 305 deletions

View file

@ -20,6 +20,8 @@
#ifndef GRUB_MULTIBOOT_HEADER
#define GRUB_MULTIBOOT_HEADER 1
#include <grub/file.h>
#ifdef GRUB_USE_MULTIBOOT2
#include <multiboot2.h>
/* Same thing as far as our loader is concerned. */
@ -63,4 +65,18 @@ grub_multiboot_fill_vbe_info_real (struct grub_vbe_info_block *vbe_control_info,
#define GRUB_MACHINE_HAS_VGA_TEXT 0
#endif
#define GRUB_MULTIBOOT_CONSOLE_EGA_TEXT 1
#define GRUB_MULTIBOOT_CONSOLE_FRAMEBUFFER 2
grub_err_t
grub_multiboot_set_console (int console_type, int accepted_consoles,
int width, int height, int depth);
grub_err_t
grub_multiboot_load (grub_file_t file);
/* Load ELF32 or ELF64. */
grub_err_t
grub_multiboot_load_elf (grub_file_t file, void *buffer);
extern grub_size_t grub_multiboot_pure_size;
extern grub_size_t grub_multiboot_alloc_mbi;
#endif /* ! GRUB_MULTIBOOT_HEADER */

View file

@ -24,6 +24,7 @@
/* How many bytes from the start of the file we search for the header. */
#define MULTIBOOT_SEARCH 8192
#define MULTIBOOT_HEADER_ALIGN 4
/* The magic field should contain this. */
#define MULTIBOOT_HEADER_MAGIC 0x1BADB002

View file

@ -23,7 +23,8 @@
#define MULTIBOOT_HEADER 1
/* How many bytes from the start of the file we search for the header. */
#define MULTIBOOT_SEARCH 8192
#define MULTIBOOT_SEARCH 32768
#define MULTIBOOT_HEADER_ALIGN 8
/* The magic field should contain this. */
#define MULTIBOOT2_HEADER_MAGIC 0xe85250d6
@ -62,6 +63,17 @@
#define MULTIBOOT_TAG_TYPE_VBE 7
#define MULTIBOOT_TAG_TYPE_FRAMEBUFFER 8
#define MULTIBOOT_HEADER_TAG_END 0
#define MULTIBOOT_HEADER_TAG_INFORMATION_REQUEST 1
#define MULTIBOOT_HEADER_TAG_ADDRESS 2
#define MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS 3
#define MULTIBOOT_HEADER_TAG_CONSOLE_FLAGS 4
#define MULTIBOOT_HEADER_TAG_FRAMEBUFFER 5
#define MULTIBOOT_HEADER_TAG_MODULE_ALIGN 6
#define GRUB_MULTIBOOT_ARCHITECTURE_I386 0
#define MULTIBOOT_HEADER_TAG_OPTIONAL 1
#ifndef ASM_FILE
typedef unsigned char multiboot_uint8_t;
@ -74,21 +86,73 @@ struct multiboot_header
/* Must be MULTIBOOT_MAGIC - see above. */
multiboot_uint32_t magic;
/* Feature flags. */
multiboot_uint32_t flags;
/* ISA */
multiboot_uint32_t architecture;
/* Total header length. */
multiboot_uint32_t header_length;
/* The above fields plus this one must equal 0 mod 2^32. */
multiboot_uint32_t checksum;
};
/* These are only valid if MULTIBOOT_AOUT_KLUDGE is set. */
struct multiboot_header_tag
{
multiboot_uint32_t type;
multiboot_uint32_t size;
multiboot_uint32_t flags;
};
struct multiboot_header_tag_information_request
{
multiboot_uint32_t type;
multiboot_uint32_t size;
multiboot_uint32_t flags;
multiboot_uint32_t requests[0];
};
struct multiboot_header_tag_address
{
multiboot_uint32_t type;
multiboot_uint32_t size;
multiboot_uint32_t flags;
multiboot_uint32_t header_addr;
multiboot_uint32_t load_addr;
multiboot_uint32_t load_end_addr;
multiboot_uint32_t bss_end_addr;
multiboot_uint32_t entry_addr;
};
/* These are only valid if MULTIBOOT_VIDEO_MODE is set. */
multiboot_uint32_t mode_type;
struct multiboot_header_tag_entry_address
{
multiboot_uint32_t type;
multiboot_uint32_t size;
multiboot_uint32_t flags;
multiboot_uint32_t entry_addr;
};
struct multiboot_header_tag_console_flags
{
multiboot_uint32_t type;
multiboot_uint32_t size;
multiboot_uint32_t flags;
multiboot_uint32_t console_flags;
};
struct multiboot_header_tag_framebuffer
{
multiboot_uint32_t type;
multiboot_uint32_t size;
multiboot_uint32_t flags;
multiboot_uint32_t width;
multiboot_uint32_t height;
multiboot_uint32_t depth;
};
struct multiboot_header_tag_module_align
{
multiboot_uint32_t type;
multiboot_uint32_t size;
multiboot_uint32_t flags;
multiboot_uint32_t width;
multiboot_uint32_t height;
multiboot_uint32_t depth;