[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Tag-alignment in multiboot2 image headers

From: Ahmed, Safayet (GE Global Research, US)
Subject: Tag-alignment in multiboot2 image headers
Date: Wed, 8 Mar 2017 22:17:02 +0000


I'm seeing an inconsistency in the multiboot2 specification and the 
implementation of the multiboot2 loader code in GRUB. It may be my 
understanding that's incorrect. A clarification would be appreciated.

This concerns the alignment requirements for tags in OS image headers. The 
specification states 4 bytes, but the code uses 8 bytes.

The specification states (Section 3.1.3) that "Tags constitutes a buffer of 
structures following each other padded on 'u32' size."

The "for" loop for parsing tags uses the following "increment" statement 
(grub/grub_core/loader/multiboot_mbi2.c: line 148):
    tag = (struct multiboot_header_tag *) ((grub_uint32_t *) tag + ALIGN_UP 
(tag->size, MULTIBOOT_TAG_ALIGN) / 4))

The macro MULTIBOOT_TAG_ALIGN is defined in (include/multiboot2.h) as 8. This 
alignment value is consistent with the specification for tags in the multiboot2 
information structure, but not for tags in an OS image header.

thank you,

Safayet N Ahmed Ph.D

Researcher, Computer Engineer
GE Global Research Center
One Research Circle,
Niskayuna, NY 12309  United States
General Electric Company, GE Global Research

GE imagination at work

reply via email to

[Prev in Thread] Current Thread [Next in Thread]