Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

EFI FileSystem drivers

License

NotificationsYou must be signed in to change notification settings

pbatard/EfiFs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build statusBuild statusBuild statusBuild statusGithub stats
ReleaseLicence

This is a GPLv3+ implementation of standalone EFI File System drivers, based ontheGRUB 2.0read-only drivers.

For additional info as well as precompiled drivers, seehttps://efi.akeo.ie

Requirements

  • Visual Studio 2022 (Windows),MinGW (Windows), gcc (Linux) orEDK2.
  • A git client able to initialize/update submodules
  • QEMUv2.7 or later if debugging with Visual Studio(NB: You can find QEMU Windows binarieshere)

Compilation

Common

  • Fetch the git submodules withgit submodule init andgit submodule update.
    NOTE This only works if you cloned the directory usinggit.
  • Apply0001-GRUB-fixes.patch to thegrub\ subdirectory. This applies thechanges that are required for successful compilation of GRUB.

Visual Studio (non EDK2)

  • Open the solution file and hitF5 to compile and debug the default driver.

gcc (non EDK2)

  • Runmake in the top directory. If needed you can also issue something likemake ARCH=<arch> CROSS_COMPILE=<tuple> where<arch> is one ofia32,x64,arm,aa64,riscv64 orloongarch64 (theofficial UEFIabbreviations for an arch, as used in/efi/boot/boot[ARCH].efi) and<tuple>is the one for your cross-compiler, such asarm-linux-gnueabi- oraarch64-linux-gnu-.e.g.make ARCH=aa64 CROSS_COMPILE=aarch64-linux-gnu-

EDK2

  • Open an elevated command prompt and create a symbolic link calledEfiFsPkg,inside your EDK2 directory, to the EfiFs source. On Windows, from an elevatedprompt, you could run something likemklink /D EfiFsPkg C:\efifs, and onLinuxln -s ../efifs EfiFsPkg.
  • From a command prompt, set Grub to target the platform you are compiling forby invoking:
    • (Windows)set_grub_cpu.cmd <arch>
    • (Linux)./set_grub_cpu.sh <arch>
      Where<arch> is one ofia32,x64,arm,aarch64,riscv64 orloongarch64.Note that youMUST invoke theset_grub_cpu scriptevery time youswitch target.
  • After having invokededksetup.bat (Windows) oredksetup.sh (Linux) runsomething like:
    build -a X64 -b RELEASE -t <toolchain> -p EfiFsPkg/EfiFsPkg.dsc
    where<toolchain> is something likeVS2022 (Windows) orGCC5 (Linux).
    NB: To build an individual driver, such as NTFS, you can also use somethinglike:
    build -a X64 -b RELEASE -t <toolchain> -p EfiFsPkg/EfiFsPkg.dsc -m EfiFsPkg/EfiFsPkg/Ntfs.inf
  • A Windows script to build the drivers, using EDK2 with VS2022 is also providedasedk2_build_drivers.cmd.

Testing

If QEMU is installed, the Visual Studio solution will set up and test thedrivers using QEMU (by also downloading a sample image for each target filesystem). Note however that VS debugging expects a 64-bit version of QEMU to beinstalled inC:\Program Files\qemu\ (which you can downloadhere).If that is not the case, you should edit.msvc\debug.vbs accordingly.

For testing outside of Visual Studio, make sure you have at least one disk witha target partition using the target filesystem, that is not being handled byother EFI filesystem drivers.Then boot into the EFI shell and run the following:

  • load fs0:\<fs_name>_<arch>.efi or wherever your driver was copied
  • map -r this should make a newfs# available, egfs2:
  • You should now be able to navigate and access content (in read-only mode)
  • For logging output, set theFS_LOGGING shell variable to 1 or more
  • To unload use thedrivers command, thenunload with the driver ID

Visual Studio 2022 and ARM/ARM64 support

Please be mindful that, to enable ARM/ARM64 compilation support in VisualStudio 2022, youMUST go to theIndividual components screen in the setupapplication and select the ARM compilers and libraries there, as they doNOTappear in the defaultWorkloads screen:

VS2022 Individual Components

Additional Notes

This is a pure GPLv3+ implementation of EFI drivers. Great care was taken not touse any code from non GPLv3 compatible sources, such as rEFInd'sfsw_efi(GPLv2 only) or Intel's FAT driver (requires an extra copyright notice).

Note however that some files (the nongrub_#### sources under./src/) arelicensed under GPLv2+ rather than GPLv3+ and that, just like the GPLv3+ sources,we took great care of ensuring that we are fully compliant with any licensingor relicensing matters, so that they can legally be reused into GPLv2+ works.

Bonus: Commands to compile EfiFs using EDK2 on a vanilla Debian GNU/Linux 10.x

sudo apt install nasm uuid-dev gcc-multilib gcc-aarch64-linux-gnu gcc-arm-linux-gnueabi gcc-riscv64-linux-gnugit clone --recurse-submodules https://github.com/tianocore/edk2.gitcd edk2make -C BaseToolsgit clone --recurse-submodules https://github.com/pbatard/EfiFs.git EfiFsPkgcd EfiFsPkg/grubgit apply ../0001-GRUB-fixes.patchcd -export GCC5_ARM_PREFIX=arm-linux-gnueabi-export GCC5_AARCH64_PREFIX=aarch64-linux-gnu-export GCC5_RISCV64_PREFIX=riscv64-linux-gnu-source edksetup.sh --reconfig./EfiFsPkg/set_grub_cpu.sh X64build -a X64 -b RELEASE -t GCC5 -p EfiFsPkg/EfiFsPkg.dsc./EfiFsPkg/set_grub_cpu.sh IA32build -a IA32 -b RELEASE -t GCC5 -p EfiFsPkg/EfiFsPkg.dsc./EfiFsPkg/set_grub_cpu.sh AARCH64build -a AARCH64 -b RELEASE -t GCC5 -p EfiFsPkg/EfiFsPkg.dsc./EfiFsPkg/set_grub_cpu.sh ARMbuild -a ARM -b RELEASE -t GCC5 -p EfiFsPkg/EfiFsPkg.dsc./EfiFsPkg/set_grub_cpu.sh RISCV64build -a RISCV64 -b RELEASE -t GCC5 -p EfiFsPkg/EfiFsPkg.dsc

[8]ページ先頭

©2009-2025 Movatter.jp