Skip to content

Instantly share code, notes, and snippets.

@malbecki
malbecki / Edk2DriverTests.md
Last active February 1, 2023 16:56
Testing EDK2 device drivers on a host machine

Introduction

EDK2 testing framework allows running and testing code that is conventionally only able to run during boot time. This can be used to perform automatic tests on a code without booting target platform and executing tests on the same system that was used for development or from a CI/CD env. For the remainder of this discussion, I will refer to this method of testing/development as running the test on host system as opposed to running tests on target system which is the system which you are developing BIOS for. The goal of the proposition is to extend the host tests coverage to device drivers code or any other code which communicates with device via memory writes.

Benefits of testing(and development) on host system

Before we discuss how to implement host-based tests for device drivers I want to quickly go over why I think host based tests are inherently better than the ones that run on the target. I see following advantages: