Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Adding a driver to a UEFI firmware
The content of this page describes how you an add a new file system EFI driver, such as the ones produced by EfiFs, to an existing UEFI firmware image.
This can be useful for instance if you want to add native NTFS support to an existing UEFI firmware, so that you can boot from NTFS removable media directly.
For this example, we'll be using the NTFS x64 EFI driver
ntfs_x64.efi along VMWare's x64 UEFI firmware, which we'll then run with VMWare Player in 64-bit mode on Windows.
Note however that, if you are planning to modify an actual desktop UEFI firmware, it is possible that your firmware image is signed by the motherboard manufacturer, in which case you might not be able to reflash it. I also take NO RESPONSIBILITY for any damage resulting from trying to modify and reflash a modified UEFI firmware — USE THIS GUIDE AT YOUR OWN RISK!!
Creating the UEFI firmware module
- Download and extract the latest
.7zrelease of FFS, which is a convenient repackaging of the EDK2's
- In the directory where you extracted the FFS files, also copy the
ntfs_x64.efibinary (a version of which can be downloaded here) and then either.
- Call the
GenModscript provided. This will take care of everything and create a new GUID for you if you don't pass one as parameter:
- Or, if you want to issue the commands manually, and after having generated your own GUID, issue something like:
GenSec -o pe32.sec ntfs_x64.efi -S EFI_SECTION_PE32 GenSec -o name.sec -S EFI_SECTION_USER_INTERFACE -n "Ntfs" GenSec -o ver.sec -S EFI_SECTION_VERSION -n "1.0" GenFfs -g "4319CBBA-0980-4245-B511-D1CEFC1FFBEA" -o ntfs_x64.ffs -i pe32.sec -i name.sec -i ver.sec -t EFI_FV_FILETYPE_DRIVER
Either of these should result in a new
ntfs_x64.ffs module having been created in your directory. This
.ffs is a module that you are now able to import in your UEFI firmware.
Note: If you want to know exactly how an ffs driver module is structure, please have a look at the readme from the FFS project.
Extracting the VMWare UEFI firmware
.rsrc\1042\BINRES you will find two 2MB binary resources, the second of which being the X64 UEFI firmware that is of interest to us:
Simply extract this file somewhere as
Adding the module to the firmware
- Download LongSoft's UEFITool (UEFI BIOS Updater) 0.21.5 from here (or any UEFI BIOS editor you prefer). Be mindful that the more recent "NE" versions of UEFITool do not allow editing of a firmware image (issue #67), so make sure you use version 0.21.5.
- Launch the BIOS editing application and open the
efi64.romfile you previously extracted.
- Locate the
Fatmodule in the firmware. In the case of the current VMWare application, it should be under
Volume Image Section→
8C8CE578-8A3D-4F1C-9935-896185C32DD3, with GUID
4. Select Insert After and select the
ntfs_x64.ffs module we previously created.
- Save the firmware back (File → Save Image File) as
Running the modified firmware in VMWare Player
- Create a new Virtual Machine, or locate an existing one
efi64_ntfs.romin your Virtual Machine directory
- Edit the
.vmxso that it contains the lines:
firmware = "efi" efi64.filename = "efi64_ntfs.rom"
- Run the VM (make sure it's running in 64-bit mode, else an unmodified 32-bit EFI firmware will be used!) and try to launch the embedded EFI Shell (by pressing
Deluntil you get into the BIOS):
If you issue
drivers you should be able to see that the NTFS driver was natively loaded:
And if you issue
map and navigate to a volume, you should find that you can access NTFS content: