Problems Testing UEFI APIs Using QEMU OVMF and GNU-EFI

In this blog I discuss problems testing UEFI APIs using QEMU and the UEFI OVMF. In particular I discuss non volatile variables, the QueryVariableInfo runtime service and the changes I have to make to the existing GNU-EFI header files in order to compile a simple application using this runtime service.

Makefile to Create UEFI SecureBoot Keys

If you are unfamilar with signing executables for UEFI SecureBoot see How to Sign UEFI Drivers & Applications from the TianoCore EDK2 website. Here is a simple Makefile which can be used to create the necessary keys: # # Make all keys for UEFI SecureBoot # TOPDIR := $(shell pwd)/ .SUFFIXES: .crt all: PK.crt PK.key KEK.crt KEK.key DB.crt DB.key PK.crt KEK.crt DB.crt: openssl req -new -x509 -newkey rsa:2048 -subj “/CN=$*/” -keyout $*.key -out $@ -days 3650 -nodes .KEEP: PK.crt PK.key KEK.crt KEK.key DB.crt DB.key %.cer: %.crt openssl x509 -in $< -out $@ -outform DER %-subkey.csr: openssl req -new -newkey rsa:2048