loading a simple hypervisor(just prints Hello World) before the linux kernel

Mushahid Hussain mushi.shar at gmail.com
Wed Nov 10 13:38:11 EST 2021


I'm trying to learn about the Linux kernel and the bare metal world on
raspberry pi 4.  After writing a simple kernel, which would print Hello
World to UART, I tried to write Hello World using two different binaries
loaded at two different addresses(and on two different exception
levels!(EL2 and EL1).

el2-kernel.img - this just prints Hello to UART.
el1-kernel.img - this just prints World to UART.

I used the following configuration on rpi4, to load both binaries on rpi4.

initramfs el1-kernel.img 0x400000

In the el2-kernel.img, I wrote a function which would jump from any
exception level to EL1 at 0x400000.

I have successfully done so. I can see the Hello World printed to UART by
two different binaries. What I cannot do is to jump from a binary(let's
call it a simple hypervisor, which prints Hello World) at EL2 to the
standard linux kernel at El1.

How would I be able to do so? I have tried the same with standard linux
kernel and "kept" dtb address in x0, so it can used by the linux kernel.

My code for the simple hypervisor: https://github.com/SikkiLadho/Leo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20211110/101cea4a/attachment.html>

More information about the Kernelnewbies mailing list