]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Specify alignment requirements
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 27 Mar 2010 20:48:08 +0000 (21:48 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 27 Mar 2010 20:48:08 +0000 (21:48 +0100)
doc/boot.S
doc/multiboot.texi
doc/multiboot2.h

index 5aba5af7218c8749c8ab03dcdf1866aa7f185d62..8f6f66fcc472a4199b4d6aeed9fc302c2fcaf93c 100644 (file)
@@ -57,9 +57,9 @@ multiboot_header:
        .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 */
@@ -70,24 +70,24 @@ address_tag_start:
        .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.  */
index bd6bd6ddd1c8b7da9d179aa78acdb3d4dc03d428..8a4a8b588e17b1cf66f9661060c3b32fa294eeab 100644 (file)
@@ -407,24 +407,24 @@ and @samp{header_length}), must have a 32-bit unsigned sum of zero.
 
 @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
@@ -432,9 +432,9 @@ Tags are terminated by a tag of type @samp{0} and size @samp{12}.
 @example
 @group
         +-------------------+
-u32     | type = 1          |
+u16     | type = 1          |
+u16     | flags             |
 u32     | size              |
-u32     | flags             |
 u32[n]  | mbi_tag_types     |
         +-------------------+
 @end group
@@ -457,9 +457,9 @@ actually be present. E.g. on a videoless system even if you requested tag
 @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     |
@@ -506,9 +506,9 @@ assumes that no bss segment is present.
 @example
 @group
         +-------------------+
-u32     | type = 3          |
-u32     | size = 16         |
-u32     | flags             |
+u16     | type = 3          |
+u16     | flags             |
+u32     | size              |
 u_virt  | entry_addr        |
         +-------------------+
 @end group
@@ -530,9 +530,9 @@ start running the operating system.
 @example
 @group
         +-------------------+
-u32     | type = 4          |
-u32     | size = 16         |
-u32     | flags             |
+u16     | type = 4          |
+u16     | flags             |
+u32     | size = 12         |
 u32     | console_flags     |
         +-------------------+
 @end group
@@ -548,9 +548,9 @@ indicates that the OS image has EGA text support.
 @example
 @group
         +-------------------+
-u32     | type = 5          |
-u32     | size = 24         |
-u32     | flags             |
+u16     | type = 5          |
+u16     | flags             |
+u32     | size = 20         |
 u32     | width             |
 u32     | height            |
 u32     | depth             |
@@ -590,9 +590,9 @@ preference.
 @example
 @group
         +-------------------+
-u32     | type = 6          |
+u16     | type = 6          |
+u16     | flags             |
 u32     | size = 12         |
-u32     | flags             |
         +-------------------+
 @end group
 @end example
index 8204794252ab3ab509d0779b5091efa84fcd8b3f..59d7c951f6168e8e05dfb0deafd75619e660dc07 100644 (file)
@@ -103,24 +103,24 @@ struct multiboot_header
 
 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;
@@ -129,25 +129,25 @@ struct multiboot_header_tag_address
 
 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;
@@ -155,9 +155,9 @@ struct multiboot_header_tag_framebuffer
 
 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;
@@ -193,8 +193,6 @@ struct multiboot_tag_string
 {
   multiboot_uint32_t type;
   multiboot_uint32_t size;
-  multiboot_uint32_t entry_size;
-  multiboot_uint32_t entry_version;
   char string[0];
 };