2016-05-18

Adding a new driver to an existing UEFI firmware

Following up on efifs and VMWare firmware extraction, you might be interested to find out how, for instance, you should proceed to add an NTFS EFI driver to an existing UEFI firmware, so that you can access/boot NTFS volumes from UEFI.
Reading NTFS volumes natively from UEFI

If that's the case, then look no further than this guide.

It provides a step by step breakdown, using VMWare, of how you can generate an UEFI firmware module from an EFI driver executable (through FFS, which is a convenient repackaging of the EDK2's GenSec and GenFfs), and insert it into an existing UEFI firmware to make the driver natively available:
A VMWare UEFI firmware with a native NTFS driver

6 comments:

  1. Thank you for everything you post! Very informative.

    ReplyDelete
  2. Pete,
    Would this work with intel raid drivers? The reason I ask is because I'm using Duet to boot a Usb key with Nvme driver on non supported x58 platform. This works and I can boot off the Nvme drive but the Shell cant see the other raid array and it would be cool if the shell could see the Intel raid array.

    Thanks

    ReplyDelete
    Replies
    1. UEFI firmwares are designed to be modular, so you should be able to add any driver you want. Be mindful however that your motherboard manufacturer may have added authentication to only accept firmwares that they issued, so your modified firmware might be rejected for flashing if that is the case. Also, the behaviour of loading a driver from the shell and loading a driver from the firmware should be the same. Are you sure you issued a 'map -r' after loading your driver in the shell. This is necessary if you installed new storage or file system drivers...

      Delete
    2. Sorry to get back to you late but seeing Intel (software) Raid volumes from shell I found not possible. Having a new issue now maybe you know the answer. Trying to add ffs files to an OVMF Qemu FD image without success. Both MMTool and UEFITool have issues. Any ideas Pete?

      Thanks

      Delete
  3. Awesome! I wish I had found this a while ago! I am now wanting to write my own UEFI BIOS and move forward with learning this.

    Just looked at the UEFI specs and wow.... Ok I have a lot to read!

    ReplyDelete
  4. Thanks for the useful piece of software :-)
    I've used it to add (insert) a Realtek UEFI-mode UNDI driver into my UEFI BIOS, that already contains some generic support (driver) for UEFI PXE booting. I used FFS to turn the downloaded .efi file into an .ffs which I then inserted into the BIOS image using mmtool. This results in some read-only "info" entries from the driver appearing in the "Advanced" menu, but the NIC devices never get proposed in the configurable BIOS boot sequence... ahh well.

    ReplyDelete