I answer on help because it is surely not grub-devel material. 30.06.2016 16:34, Basin Ilya пишет: > Hi. > > I want to make my grub image file independent from the data in the MBR > gap, i.e. I want to embed the generated core.img into my custom image file. > > I have some questions: > > - Does the grub2 command "chainloader /foo.img" load the whole file or > just the 1st 512 bytes? >
Just 512 bytes. > - Does a BOOTSECTOR entry in Windows boot manager load the whole file or > just the 1st 512 bytes? > IIRC it loads full file. > If the answer to both questions is "yes", then a custom image can be > made that will include core.img and a very simple boot sector, that will > assume that core.img is already loaded. To my knowledge, neither of the > images that ship with grub2 does that. > That is what lnxboot.img is for. It makes core.img loadable both by Windows boot manager as well as grub2 "linux16" command. > What preparations should the custom boot sector do? At what offset > should core.img be loaded and jumped to? > cat lnxboot.img core.img > your-custom-boot.img If it turns out popular enough, it is trivial to add to grub-mkimage. P.S. Theoretically you should be able to do linux16 lnxboot.img initrd16 core.img boot Except it does not work ... _______________________________________________ Help-grub mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-grub
