.long -(MULTIBOOT2_HEADER_MAGIC + GRUB_MULTIBOOT_ARCHITECTURE_I386 + (multiboot_header_end - multiboot_header))
#ifndef __ELF__
address_tag_start:
- .long MULTIBOOT_HEADER_TAG_ADDRESS
+ .short MULTIBOOT_HEADER_TAG_ADDRESS
+ .short MULTIBOOT_HEADER_TAG_OPTIONAL
.long address_tag_end - address_tag_start
- .long MULTIBOOT_HEADER_TAG_OPTIONAL
/* header_addr */
.long multiboot_header
/* load_addr */
.long _end
address_tag_end:
entry_address_tag_start:
- .long MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS
+ .short MULTIBOOT_HEADER_TAG_ENTRY_ADDRESS
+ .short MULTIBOOT_HEADER_TAG_OPTIONAL
.long entry_address_tag_end - entry_address_tag_start
- .long MULTIBOOT_HEADER_TAG_OPTIONAL
/* entry_addr */
.long multiboot_entry
entry_address_tag_end:
#endif /* __ELF__ */
framebuffer_tag_start:
- .long MULTIBOOT_HEADER_TAG_FRAMEBUFFER
+ .short MULTIBOOT_HEADER_TAG_FRAMEBUFFER
+ .short MULTIBOOT_HEADER_TAG_OPTIONAL
.long framebuffer_tag_end - framebuffer_tag_start
- .long MULTIBOOT_HEADER_TAG_OPTIONAL
.long 1024
.long 768
.long 32
framebuffer_tag_end:
- .long MULTIBOOT_HEADER_TAG_END
- .long 12
- .long 0
+ .short MULTIBOOT_HEADER_TAG_END
+ .short 0
+ .long 8
multiboot_header_end:
multiboot_entry:
/* Initialize the stack pointer. */
@node Header tags
@subsection General tag structure
-Tags constitutes a buffer of structures immediately following each other.
+Tags constitutes a buffer of structures following each other padded on @samp{u_virt} size.
Every structure has following format:
@example
@group
+-------------------+
-u32 | type |
+u16 | type |
+u16 | flags |
u32 | size |
-u32 | flags |
+-------------------+
@end group
@end example
-@samp{type} contains an identifier of contents of the rest of the tag.
+@samp{type} is divided into 2 parts. Lower contains an identifier of contents of the rest of the tag.
@samp{size} contains the size of tag including header fields.
If bit @samp{0} of @samp{flags} (also known as @samp{optional}) is set if bootloader may ignore this tag if it
lacks relevant support.
-Tags are terminated by a tag of type @samp{0} and size @samp{12}.
+Tags are terminated by a tag of type @samp{0} and size @samp{8}.
@node Information request header tag
@subsection Multiboot information request
@example
@group
+-------------------+
-u32 | type = 1 |
+u16 | type = 1 |
+u16 | flags |
u32 | size |
-u32 | flags |
u32[n] | mbi_tag_types |
+-------------------+
@end group
@example
@group
+-------------------+
-u32 | type = 2 |
-u32 | size = 28 |
-u32 | flags |
+u16 | type = 2 |
+u16 | flags |
+u32 | size |
u_virt | header_addr |
u_virt | load_addr |
u_virt | load_end_addr |
@example
@group
+-------------------+
-u32 | type = 3 |
-u32 | size = 16 |
-u32 | flags |
+u16 | type = 3 |
+u16 | flags |
+u32 | size |
u_virt | entry_addr |
+-------------------+
@end group
@example
@group
+-------------------+
-u32 | type = 4 |
-u32 | size = 16 |
-u32 | flags |
+u16 | type = 4 |
+u16 | flags |
+u32 | size = 12 |
u32 | console_flags |
+-------------------+
@end group
@example
@group
+-------------------+
-u32 | type = 5 |
-u32 | size = 24 |
-u32 | flags |
+u16 | type = 5 |
+u16 | flags |
+u32 | size = 20 |
u32 | width |
u32 | height |
u32 | depth |
@example
@group
+-------------------+
-u32 | type = 6 |
+u16 | type = 6 |
+u16 | flags |
u32 | size = 12 |
-u32 | flags |
+-------------------+
@end group
@end example
struct multiboot_header_tag
{
- multiboot_uint32_t type;
+ multiboot_uint16_t type;
+ multiboot_uint16_t flags;
multiboot_uint32_t size;
- multiboot_uint32_t flags;
};
struct multiboot_header_tag_information_request
{
- multiboot_uint32_t type;
+ multiboot_uint16_t type;
+ multiboot_uint16_t flags;
multiboot_uint32_t size;
- multiboot_uint32_t flags;
multiboot_uint32_t requests[0];
};
struct multiboot_header_tag_address
{
- multiboot_uint32_t type;
+ multiboot_uint16_t type;
+ multiboot_uint16_t flags;
multiboot_uint32_t size;
- multiboot_uint32_t flags;
multiboot_uint32_t header_addr;
multiboot_uint32_t load_addr;
multiboot_uint32_t load_end_addr;
struct multiboot_header_tag_entry_address
{
- multiboot_uint32_t type;
+ multiboot_uint16_t type;
+ multiboot_uint16_t flags;
multiboot_uint32_t size;
- multiboot_uint32_t flags;
multiboot_uint32_t entry_addr;
};
struct multiboot_header_tag_console_flags
{
- multiboot_uint32_t type;
+ multiboot_uint16_t type;
+ multiboot_uint16_t flags;
multiboot_uint32_t size;
- multiboot_uint32_t flags;
multiboot_uint32_t console_flags;
};
struct multiboot_header_tag_framebuffer
{
- multiboot_uint32_t type;
+ multiboot_uint16_t type;
+ multiboot_uint16_t flags;
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_uint16_t type;
+ multiboot_uint16_t flags;
multiboot_uint32_t size;
- multiboot_uint32_t flags;
multiboot_uint32_t width;
multiboot_uint32_t height;
multiboot_uint32_t depth;
{
multiboot_uint32_t type;
multiboot_uint32_t size;
- multiboot_uint32_t entry_size;
- multiboot_uint32_t entry_version;
char string[0];
};