Skip to content

Instantly share code, notes, and snippets.

@tqh
Last active October 2, 2022 09:36
Show Gist options
  • Save tqh/dd2c63f0751586d015d5844356cd8ce1 to your computer and use it in GitHub Desktop.
Save tqh/dd2c63f0751586d015d5844356cd8ce1 to your computer and use it in GitHub Desktop.
#2022-10-02
#https://github.com/tianocore/tianocore.github.io/wiki/Common-instructions
#Debian Packages needed: build-essential git uuid-dev iasl git nasm python-is-python3 unzip
#Install tools
git clone https://github.com/tianocore/edk2
cd edk2/
git submodule update --init
make -C BaseTools
source edksetup.sh
export EDK_TOOLS_PATH=$(pwd)/BaseTools
#https://github.com/tianocore/tianocore.github.io/wiki/Common-instructions#modify-conf-files
#https://github.com/tianocore/tianocore.github.io/wiki/How-to-build-OVMF
---
Change Conf/target.txt
ACTIVE_PLATFORM = OvmfPkg/OvmfPkgX64.dsc
TARGET_ARCH = X64
TOOL_CHAIN_TAG = GCC5
TARGET = RELEASE
---
# GCC5 means host gcc
#Run build
build
Result in (I use code and efi vars seperated):
./Build/OvmfX64/RELEASE_GCC5/FV/OVMF_CODE.fd
./Build/OvmfX64/RELEASE_GCC5/FV/OVMF_VARS.fd
How I use it:
qemu-system-x86_64 -cpu host -machine q35 -monitor stdio \
-m 4G -enable-kvm -nodefaults -smp 1,cores=1 \
-vga virtio -display gtk,grab-on-hover=on,zoom-to-fit=off \
-nic user,model=virtio-net-pci -usb -device usb-kbd -device usb-tablet \
-serial file:debug.log -global isa-debugcon.iobase=0x402 \
-drive if=pflash,format=raw,unit=0,readonly,file=OVMF_CODE.fd \
-drive if=pflash,format=raw,unit=1,file=OVMF_VARS.fd \
-drive file=haiku-minimum-anyboot.iso,media=cdrom #\
# -drive file=hd.2GB,if=virtio,format=raw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment