bhyve on ARMv8 - initarm() and struct arm64_bootparams

Andrew Turner andrew at fubar.geek.nz
Sun Oct 8 13:51:09 UTC 2017


> On 7 Oct 2017, at 07:50, Alexandru Elisei <alexandru.elisei at gmail.com> wrote:
> 
> Hello,
> 
> I am currently working on porting bhyve to ARMv8 and I've managed to
> start a guest kernel inside bhyve.
> 
> I am having trouble getting past the initarm() function in the guest
> and I think the problem is the fact that I am not sending the correct
> boot parameter arm64_bootparams->modulep to the guest (the other
> struct variables are computed in locore.S before calling initarm()).
> 
> As far as I can I can tell modulep is a pointer to the mapped kernel
> image virtual address where module information is stored, but I don't
> know how to get that information from the guest kernel when creating
> the virtual machine.
> 
> Can anyone provide some help with this issue?

It should be the virtual address the module data has been loaded into. In loader.efi we handle this by searching for the virtual address of the last module, and add on its size, then add on space for the environment and dtb.

I would strongly suggest you use UEFI boot. It would fix this, and allow non-FreeBSD operating systems to also boot. There is an existing port of EDK2 to bhyve, however it’s based on an old code base. Alternatively u-boot now supports the required EFI parts. There are a few extra patches for FreeBSD in the repo at [1].

Andrew

[1] https://github.com/freebsd/u-boot/ <https://github.com/freebsd/u-boot/>


More information about the freebsd-arm mailing list