UEFI BootLoader

2019-04-16 06:36发布

I am looking at developing a simple (to start with) UEFI Boot loader to load a ELF image, and was wondering if anyone had a good entry point into maybe any existing projects, or examples that I can use to get started out with.

In addition I was wondering if any one had any experience in getting virtual box to run an EFI application. I have set up a VM with EFI mother board but can seam to create an EFI System Partition for it to load out of (without using an OS), all I can achieve is the UEFI command line.

3条回答
霸刀☆藐视天下
2楼-- · 2019-04-16 06:55

You might try taking a look at the GRUB or elilo source code. These are also good because they support loading ELF images. You might also look to the EDK2, there is a lot of good code there, and it's easy to build EFI executable images with it.

When referencing the UEFI, I also like to use Phoenix's wiki. I find the boot services entry to be especially useful.

Hope this helps at least a little!

查看更多
等我变得足够好
3楼-- · 2019-04-16 06:59

GRUB installation on UEFI is possible by means of grub-mkimage. ELF binaries are known to be similarly masqueraded as complying UEFI's PE32+ requirement. If some C developers will refactor the code as done by https://www.kernel.org/doc/Documentation/efi-stub.txt and then generalize mkimage's that code as a separate tool for the sake of multibooters without PE32+ kernel loaders for every OS...

Just imagine

ld -b input-format -o <output>.efi --oformat=output-format objfile ...
查看更多
对你真心纯属浪费
4楼-- · 2019-04-16 07:06

I recently became interested in bootloaders too. I'm still a newbie in this field, but I found this interesting step-by-step tutorial to code a "Hello World" bootloader. Hope it gives you or anyone else with the same question a starting point for developing your bootloader.

查看更多
登录 后发表回答