-
Notifications
You must be signed in to change notification settings - Fork 7
/
README.uefi
90 lines (65 loc) · 3.31 KB
/
README.uefi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
This README pertains to the use of ntfs-3g as a UEFI driver
COMPILATION
===========
General options
---------------
The default UEFI driver provides read-write access to an NTFS volume.
If you would rather compile a read-only version of this driver, you should
either define the FORCE_READONLY macro in include/uefi-driver/uefi-driver.h
or pass that macro as a compiler option (through '-D FORCE_READONLY=TRUE' if
using EDK2).
Linux (EDK2)
------------
This assumes that you have gcc (5.0 or later) and the EDK2 installed.
For this example, we assume that EDK2 is located in /usr/src/edk2.
Open a command prompt at the top of this repository and issue:
export WORKSPACE=$PWD
export EDK2_PATH=/usr/src/edk2
export PACKAGES_PATH=$WORKSPACE:$EDK2_PATH
source $EDK2_PATH/edksetup.sh --reconfig
build -a X64 -b RELEASE -t GCC5 -p uefi-driver.dsc
You may also use IA32, ARM or AARCH64 for the -a parameter to build a driver
for these architectures noting however that you need to have the relevant
toolchain and GCC prefix set.
For instance, to compile for ARM64, you would need to also issue:
export GCC5_AARCH64_PREFIX=aarch64-linux-gnu-
Windows (gnu-efi)
-----------------
This assumes that you have Visual Studio 2019 installed and a recent version of
the gnu-efi source from git://git.code.sf.net/p/gnu-efi/code in a 'gnu-efi'
directory at the top of this project. If you used git to clone this project and
it came with the gnu-efi submodule, you can just use the standard git submodule
init commands to initialize it. If not, you need to install gnu-efi manually.
With gnu-efi properly set up, you can simply open the VS2019 solution file and
build using the IDE.
If you have QEMU installed under C:\Program Files\qemu\ you should also be
able to test the driver for any of the supported architectures (IA32, X64, ARM
and ARM64). Of course building and testing for the latter requires that you
selected the relevant C++ components during Visual Studio installation.
Windows (EDK2)
--------------
This assumes that you have Visual Studio 2019 and the EDK2 installed.
For this examples, we assume that EDK2 is installed in D:\EDK2.
Open a command prompt at the top of the ntfs-3g source directory and issue:
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
set WORKSPACE=%cd%
set EDK2_PATH=D:\EDK2
set PACKAGES_PATH=%WORKSPACE%;%EDK2_PATH%
%EDK2_PATH%\edksetup.bat reconfig
build -a X64 -b RELEASE -t VS2019 -p uefi-driver.dsc
You may also use IA32, ARM or AARCH64 for the -a parameter to build a driver
for these architectures noting however that for ARM or ARM64 compilation, you
must have selected the relevant C++ components during Visual Studio install.
USAGE
=====
Simply load the driver from a UEFI Shell using the 'load' command and then
issue 'map -r' to remap volumes. This should grant access to any NTFS volume
that is accessible from UEFI.
Note that NTFS volumes are unmounted, fully, as soon as the last open file
handle to that volume is closed. This should make the driver safe for surprise
removal/shutdown as long as you don't perform these operations in the middle
of a Shell command or during the execution of a UEFI application.
COMPLIANCE
==========
This UEFI NTFS driver should comply with the UEFI specifications, and
especially with sections 13.4 and 13.5 from version 2.8 Errata A of the specs.