Qemu emulation
Run arm32 UEFI in a virtual machine.
Emulating a arm32 UEFI device is useful for developing Linux and debugging it.
In the GDB Debugging page you can find instructions on how to compile Linux for this virtual machine.
Compile OVMF for qemu
Install required packages
Run the following commands to install the required packages.
sudo apt install python python3 python3-distutils
sudo apt install gcc-arm-none-eabi
sudo apt install uuid-dev
sudo apt install build-essential
sudo apt install bison
sudo apt install flexYou will need other stuff too, but that is probably already installed. (e.g. git)
Download source
You need the source code of edk2 and acpica.
# Go to the directory you want to work in
export WORKSPACE=$PWD
# Download edk2 and acpica
git clone https://github.com/acpica/acpica.git
git clone https://github.com/tianocore/edk2.git
# Download submodules
cd edk2
git submodule update --init
cd ..Compile OVMF
Go to your source directory and run the following commands.
Your output OVMF firmware file for qemu is$WORKSPACE/Build/ArmVirtQemu-ARM/RELEASEGCC5/FV/QEMU_EFI.fd
Setup qemu files and run it
Create a directory, where you want your files to be in. Put your QEMU_EFI.fd firmware file in this directory, compiled in the previous section. Now run the following commands to create some disk images:
Now create a directory named boot. This will be your EFI partition. You can now easily place your EFI files in there.
Run qemu
To start your virtual machine run the following command, and make sure qemu-system-arm is installed.
This will run qemu with 4 virtual CPU cores. They are Coretx-A15 cores. Used because it works.
Premade files
The following ZIP includes all files setup in their proper location. In addition its EFI partition folder has a UEFI shell in it. To run it either execute the run.sh file or enter the command described in Run qemu.
References
Links where the above compiling information is from:
Last updated
Was this helpful?