Git Product home page Git Product logo

ffs's Introduction

FFS

FFS, which stands for: 'For F@%k's Sake, IT'S CALLED A MODULE!!' is a convenient repackaging of the EDK2's GenSec and GenFfs utilities, with the aim of easing up the generation of what intel/EDK calls FFS's (whatever that abbreviation means) which are MODULES, that can be integrated into a regular UEFI firmware.

This can be useful if, for instance, you have UEFI driver executables, which you want to make available in your UEFI "BIOS".

License

BSD 2-Clause, as per the EDK2.

Sources

The sources included in this project are all unmodified versions of the same files from the BaseTools/Source/C/ repository of the EDK2.

The only elements added are the Visual Studio 2015 project files (much more convenient than whatever the EDK2 wants you to set up for recompilation) and some useful scripts.

Requirements

Compilation

  • Open the solution file in Visual Studio and select 'Build Solution'

A brief breakdown of UEFI firmware MODULES

An UEFI firmware driver module (FFS) should be composed of the following:

  • An FFS header
  • A PE32 section containing the driver EFI executable
  • A Driver Name ("User Interface") section
  • A driver Version section

In practice, this could appear as follows:

Address Size  Designation
------- ----  -----------

EFI_FFS_FILE_HEADER:
0x0000  16    Name (EFI_GUID)
0x0010  1     IntegrityCheck.Header (Header Checksum)
0x0011  1     IntegrityCheck.File -> set to 0xAA (FFS_FIXED_CHECKSUM) and clear bit 0x40 of Attributes
0x0012  1     FileType -> 0x07 = EFI_FV_FILETYPE_DRIVER
0x0013  1     Attributes -> 0x00
0x0014  3     Size, including header and all other sections
0x0017  1     State (unused) -> 0X00

EFI_COMMON_SECTION_HEADER:
0x0000  3     Size, including this header
0x0003  1     Type -> 0x10 (EFI_SECTION_PE32)
0x0004  ####  <PE data>

EFI_COMMON_SECTION_HEADER:
0x0000  3     Size, including this header
0x0003  1     Type -> 0x15 (EFI_SECTION_USER_INTERFACE)
0x0004  ####  NUL terminated UTF-16 string (eg "FAT\0")

EFI_COMMON_SECTION_HEADER:
0x0000  3     Size, including this header
0x0003  1     Type -> 0x14 (EFI_SECTION_VERSION)
0x0004  ####  NUL terminated UTF-16 string (eg "1.0\0")

Creating a driver UEFI firmware MODULE

From what was exposed above, and starting with an ntfs_x64.efi driver executable, the generation of the relevant UEFI driver firmware MODULE can be accomplished as follows (NB: you'll need to replace the 1234... GUID with your own):

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 -d 1 -g "12341234-1234-1234-1234-123412341234" -o ntfs.ffs -i pe32.sec -i name.sec -i ver.sec -t EFI_FV_FILETYPE_DRIVER

Or you can also use the GenMod batch file under Scripts, which takes the driver executable and an optional GUID as parameters.

For a detailed guide on how you may use FFS to insert an NTFS EFI driver into a VMWare firmware image, please have a look here.

ffs's People

Contributors

pbatard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ffs's Issues

What FFS stands for

easing up the generation of what intel/EDK calls FFS's (whatever that abbreviation means)

If this was meant to be tongue in cheek, then feel free to ignore.

FFS stands for "Firmware File System" as per the specification. GenFfs creates files to be added to a firmware file system.

Missing Dependency section

I know this is old but, I went to use it today and I noticed while it did work, it is missing the Dependency section in the readme tutorial, which is EFI_SECTION_DXE_DEPEX with no example how to add that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.