DEV Community

MachineHunter
MachineHunter

Posted on

How to add DXE Driver to BIOS image

In my previous post, I showed you how to make DXE Driver which stores current time in UEFI variable, and convert that into FFS file. To execute this DXE Driver, I'll show you how to add this FFS file into extracted BIOS image from UP2 Pro Board. I will be using followings in this post.

Download UEFITool

UEFITool is an opensource tool to parse and edit UEFI image. I will be using this tool to add FFS file into UEFI image. Don't use the version with "NE" in the name because this version has some restricted functionality.

Extract UEFI image by SF100

First you need to extract UEFI image from UP2 board. You can do this by using SF100, and I explained how to do this in my previous post.

Insert FFS file by UEFITool

Open UEFITool and Drag&Drop UEFI image file extracted by SF100. Then, locate DXE Volume which is a volume that DXE Drivers are stored by searching the string "DXE" by Ctrl-F and double-clicking one of the results.
Image description
Go to the last DXE Driver in the volume and right click that.
Image description
You will see "Insert after..." if you have downloaded the right version of UEFITool so click on that and select the ffs file generated in the previous post. If successfully added, you will see the result like below.
Image description
Press Ctrl-S and save this BIOS image somewhere.

Flashing the UEFI with SF100

Again using SF100, flash the modified UEFI image to the UP2 board. This is also explained in my previous post.

Checking MyDxeStatus Variable to see if DXE Driver executed successfully

Power on the board and see if it boots successfully first. If display won't show up, then there might be some errors in DXE Driver. You can debug DXE Driver by using Intel DCI and I also explained this method in my previous post.

If diplay does show up, it's time to check the UEFI variable. You can execute dmpstore <UEFI variable name> to check UEFI variable values from UEFI Shell.
Image description

Top comments (0)