On Thu, May 07, 2020 at 03:09:23PM -0700, Zide Chen wrote: > In the cases of users have preferences over Multiboot2 module load > addresses, currently GRUB has no way to achieve it. > > Similar to the relocatable header tag, this new tag allows users to > specify the minimum and maximum load addresses, and other load > preferences on Multiboot2 modules. > > Signed-off-by: Zide Chen <zide.c...@intel.com> > --- > doc/multiboot.texi | 41 +++++++++++++++++++++++++++++++++++++++++ > doc/multiboot2.h | 11 +++++++++++ > 2 files changed, 52 insertions(+) > > diff --git a/doc/multiboot.texi b/doc/multiboot.texi > index df8a0d056e76..758ef7fd1e2d 100644 > --- a/doc/multiboot.texi > +++ b/doc/multiboot.texi > @@ -356,6 +356,7 @@ executable header. > * Module alignment tag:: > * EFI boot services tag:: > * Relocatable header tag:: > +* Module load preferences tag::
Please bump spec version to 2.1. > @end menu > > @@ -730,6 +731,46 @@ Boot loader should follow it. @samp{0} means none, > @samp{1} means > load image at lowest possible address but not lower than min_addr > and @samp{2} means load image at highest possible address but not > higher than max_addr. > + > +@node Module load preferences tag > +@subsection Module load preferences tag > + > +@example > +@group > + +-------------------+ > +u16 | type = 11 | > +u16 | flags | > +u32 | size = 20 | > +u32 | min_addr | > +u32 | max_addr | I have an itching to add "align" member here like in the relocatable header tag. I can imagine that some kernels may want aligned modules. If you do that then we have to resolve conflict with the module alignment tag. I think if both tags are in the image header then the bootloader should use max(align, PAGE_SIZE). This behavior should be described in one way or another next to both tags. > +u32 | preference | > + +-------------------+ > +@end group > +@end example > + Please describe shortly what this tag does. You can find good example in relocatable header tag. > +This tag is independent to the relocatable header tag. All of the This sentence should go to the end of the tag description. > +address fields in this tag are physical addresses. > + > +The meaning of each field is as follows: > + > +@table @code > +@item min_addr > +Lowest possible physical address at which any modules should be > +loaded. The bootloader cannot load any part of any modules below > +this address. > + > +@item max_addr > +Highest possible physical address at which any loaded modules should > +end. The bootloader cannot load any part of any modules above this > +address. > + > +@item preference > +It contains load address placement suggestion for boot loader. > +Boot loader should follow it. @samp{0} means load modules not lower > +than min_addr and not higher than max_addr, but no preference on either > +lower or higher address. @samp{1} means load modules at lowest possible > +address but not lower than min_addr. @samp{2} means load modules at > +highest possible address but not higher than max_addr. Please copy preference description from relocatable header tag and replace "image" with "module". Daniel _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel