Support a Xen boot protocol
We should support at least one of Xen's guest boot processes:
- [ ] ~~hvmloader + GRUB~~
- ~~Might already work~~
- [ ] ~~direct kernel boot~~
- ~~probably Linux boot protocol~~
- ~~maybe also more flexible ELF loading?~~
- [ ] PVH (x86/HVM direct boot ABI)
- See rust-hypervisor-firmware for reference.
- Maybe rust-vmm/xen is helpful?
Related: https://github.com/hermit-os/hermit-rs/issues/389#issuecomment-2470537494
For projects like HermitOS, PVH is prefered and hvmloader + GRUB should be avoided (it has much more overhead and complexity when compared to PVH). Direct kernel boot is not really supported, actually, it's falling back to uncompressing the bzImage and loading it as PVH.
rust-hypervisor-firmware uses PVH and boots fine in Xen (even though there is no supported device to boot on), so that could be a good starting point for Xen support.
Thanks so much for the info, @TSnake41! I have adjusted our goals above. :)
PVH boot protocol and x86/HVM direct boot ABI are actually the same thing though ^^
What I meant is that rust-hypervisor-firmware has a Rust PVH boot entry which can be reused on Hermit for booting on Xen (among some others like firecracker, ...).
Thanks for clearing that up! :D
So are you suggesting to reuse the entry source code and adapting the Hermit loader to be bootable via PVH directly, or are you suggesting to use rust-hypervisor-firmware to chainload the Hermit loader?
Since I am not very familiar with PVH, I am not sure how much effort the former would be compared to the latter. Both are very possible, though, I think.
So are you suggesting to reuse the entry source code and adapting the Hermit loader to be bootable via PVH directly, or are you suggesting to use rust-hypervisor-firmware to chainload the Hermit loader?
Adapting Hermit loader to be bootable via PVH (so you directly boot onto it).
use rust-hypervisor-firmware to chainload the Hermit loader
I guess it is already possible, as rust-hypervisor-firmware supports booting using UEFI and bzImage (boot loader specification).