help-grub
[Top][All Lists]
Advanced

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

Re: How to make a GRUB image file that can be chainloaded and will not r


From: Andrei Borzenkov
Subject: Re: How to make a GRUB image file that can be chainloaded and will not read the MBR gap?
Date: Thu, 30 Jun 2016 20:20:30 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0

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 ...




reply via email to

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