[U-Boot] Installing u-boot for x86 (non EFI) on a disk

Hello,
I have read the documentation coming with u-boot and several other links that I got from Google, but I am still confused on certain items.
I'll gladly provide patches for enhancing the documentation, if anyone can help me to understand better.
My impression is that the typical way of running u-boot in non-EFI mode is to create its raw version. Because the alternative is to build u-boot as coreboot payload, but not many target HW use coreboot. Is this correct?
Googling, I found this link [1] from the qemu ml archives, which shows how to build and start a u-boot rom file in qemu. Which works also for me.
However I would like to create a loop file, install u-boot in it and pass that file to qemu as hda, rather than using the rom file.
How do I install u-boot? From what I understood I should put something in the (disk? / partition?) MBR and copy something else elsewhere.
But I could not figure out what goes where, exactly. Could anybody please enlighten me?
[1] https://lists.gnu.org/archive/html/qemu-devel/2015-05/msg04835.html

Hi Igor,
On Tue, Aug 11, 2015 at 9:18 PM, Stoppa, Igor igor.stoppa@intel.com wrote:
Hello,
I have read the documentation coming with u-boot and several other links that I got from Google, but I am still confused on certain items.
I'll gladly provide patches for enhancing the documentation, if anyone can help me to understand better.
My impression is that the typical way of running u-boot in non-EFI mode is to create its raw version. Because the alternative is to build u-boot as coreboot payload, but not many target HW use coreboot. Is this correct?
U-Boot supports running bare-metal as well as being loaded as a coreboot payload. For the base-metal case, U-Boot is the actual BIOS which boots from the x86 reset vector.
Googling, I found this link [1] from the qemu ml archives, which shows how to build and start a u-boot rom file in qemu. Which works also for me.
This is documented in README.x86 @ http://git.denx.de/?p=u-boot.git;a=blob;f=doc/README.x86;h=af2459c7ed6af55d9...
However I would like to create a loop file, install u-boot in it and pass that file to qemu as hda, rather than using the rom file.
Why do you want to do this way? U-Boot does not support this use case so far.
How do I install u-boot? From what I understood I should put something in the (disk? / partition?) MBR and copy something else elsewhere.
But I could not figure out what goes where, exactly. Could anybody please enlighten me?
As mentioned above, this is not supported. But if you can figure it out, patches are welcome :-)
[1] https://lists.gnu.org/archive/html/qemu-devel/2015-05/msg04835.html
Regards, Bin

Hi Bin Meng, thanks for your reply, please find few comments inlined below.
On 11 August 2015 at 17:09, Bin Meng bmeng.cn@gmail.com wrote:
Hi Igor,
On Tue, Aug 11, 2015 at 9:18 PM, Stoppa, Igor igor.stoppa@intel.com wrote:
U-Boot supports running bare-metal as well as being loaded as a coreboot payload. For the base-metal case, U-Boot is the actual BIOS which boots from the x86 reset vector.
ok, thanks for the explanation. This case probably will not work for me, as I don't think I am allowed to reprogram the BIOS of the machine(s) I'm targeting.
[...]
However I would like to create a loop file, install u-boot in it and pass that file to qemu as hda, rather than using the rom file.
Why do you want to do this way? U-Boot does not support this use case so far.
I wrongly had the impression that it was supported. Thanks again for the clarification. The reason I wanted to do it, was to get familiar with the U-Boot build process and see the differences vs the EFI mode.
So, with the constraint that I have to not modify the existing BIOS, it seems that the only way to put U-Boot on a disk image for x86 is to use U-Boot as EFI payload.
Is this correct?

Hi Igor,
On Wed, Aug 12, 2015 at 5:54 PM, Stoppa, Igor igor.stoppa@intel.com wrote:
Hi Bin Meng, thanks for your reply, please find few comments inlined below.
On 11 August 2015 at 17:09, Bin Meng bmeng.cn@gmail.com wrote:
Hi Igor,
On Tue, Aug 11, 2015 at 9:18 PM, Stoppa, Igor igor.stoppa@intel.com wrote:
U-Boot supports running bare-metal as well as being loaded as a coreboot payload. For the base-metal case, U-Boot is the actual BIOS which boots from the x86 reset vector.
ok, thanks for the explanation. This case probably will not work for me, as I don't think I am allowed to reprogram the BIOS of the machine(s) I'm targeting.
And I believe your machine's BIOS is not coreboot, so kind of stuck.
[...]
However I would like to create a loop file, install u-boot in it and pass that file to qemu as hda, rather than using the rom file.
Why do you want to do this way? U-Boot does not support this use case so far.
I wrongly had the impression that it was supported. Thanks again for the clarification. The reason I wanted to do it, was to get familiar with the U-Boot build process and see the differences vs the EFI mode.
In your first email, you said you were running U-Boot on QEMU. You can try U-Boot on QEMU to get familiar with U-Boot build process. There is no need for you to get a real x86 board as QEMU is pretty easy to configure and use.
So, with the constraint that I have to not modify the existing BIOS, it seems that the only way to put U-Boot on a disk image for x86 is to use U-Boot as EFI payload.
Is this correct?
Yes, this is correct. If your BIOS is an EFI BIOS, you can try EFI payload. But right now you can only try the EFI payload on MinnowMax and QEMU as the EFI payload. There is another way of testing U-Boot on top of EFI which is to build U-Boot as an EFI application. Please check doc/README.efi for the information.
Regards, Bin
participants (2)
-
Bin Meng
-
Stoppa, Igor