├── .gitattributes ├── .gitignore ├── .gitmodules ├── .vs └── msvc │ ├── DRIPSEnabler.vcxproj │ ├── DRIPSEnabler.vcxproj.filters │ ├── gnu-efi.vcxproj │ └── gnu-efi.vcxproj.filters ├── DRIPSEnabler.sln ├── LICENSE ├── Makefile ├── README.md ├── debug.vbs ├── main.c └── tables ├── LPIT └── Intel_Haswell_Skylake │ └── LPIT.bin └── SSDT └── Apple ├── MacBookPro_A1502_ME866LL └── IntelPEP.dsl └── MacBook_A1534_MLHA2LL └── IntelPEP.dsl /.gitattributes: -------------------------------------------------------------------------------- 1 | *.sh eol=lf 2 | Makefile eol=lf 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.efi 3 | *.vhd 4 | *.sdf 5 | *.suo 6 | *.opensdf 7 | *.opendb 8 | *.fd 9 | *.db* 10 | image 11 | build 12 | 13 | # Intel iasl 14 | *.aml 15 | *.hex 16 | 17 | # Created by https://www.gitignore.io/api/visualstudio 18 | # Edit at https://www.gitignore.io/?templates=visualstudio 19 | 20 | ### VisualStudio ### 21 | ## Ignore Visual Studio temporary files, build results, and 22 | ## files generated by popular Visual Studio add-ons. 23 | ## 24 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 25 | 26 | # User-specific files 27 | *.rsuser 28 | *.suo 29 | *.user 30 | *.userosscache 31 | *.sln.docstates 32 | 33 | # User-specific files (MonoDevelop/Xamarin Studio) 34 | *.userprefs 35 | 36 | # Mono auto generated files 37 | mono_crash.* 38 | 39 | # Build results 40 | [Dd]ebug/ 41 | [Dd]ebugPublic/ 42 | [Rr]elease/ 43 | [Rr]eleases/ 44 | x64/ 45 | x86/ 46 | [Aa][Rr][Mm]/ 47 | [Aa][Rr][Mm]64/ 48 | bld/ 49 | [Bb]in/ 50 | [Oo]bj/ 51 | [Ll]og/ 52 | 53 | # Visual Studio 2015/2017 cache/options directory 54 | #.vs/ 55 | # Uncomment if you have tasks that create the project's static files in wwwroot 56 | #wwwroot/ 57 | 58 | # Visual Studio 2017 auto generated files 59 | Generated\ Files/ 60 | 61 | # MSTest test Results 62 | [Tt]est[Rr]esult*/ 63 | [Bb]uild[Ll]og.* 64 | 65 | # NUnit 66 | *.VisualState.xml 67 | TestResult.xml 68 | nunit-*.xml 69 | 70 | # Build Results of an ATL Project 71 | [Dd]ebugPS/ 72 | [Rr]eleasePS/ 73 | dlldata.c 74 | 75 | # Benchmark Results 76 | BenchmarkDotNet.Artifacts/ 77 | 78 | # .NET Core 79 | project.lock.json 80 | project.fragment.lock.json 81 | artifacts/ 82 | 83 | # StyleCop 84 | StyleCopReport.xml 85 | 86 | # Files built by Visual Studio 87 | *_i.c 88 | *_p.c 89 | *_h.h 90 | *.ilk 91 | *.obj 92 | *.iobj 93 | *.pch 94 | *.pdb 95 | *.ipdb 96 | *.pgc 97 | *.pgd 98 | *.rsp 99 | *.sbr 100 | *.tlb 101 | *.tli 102 | *.tlh 103 | *.tmp 104 | *.tmp_proj 105 | *_wpftmp.csproj 106 | *.log 107 | *.vspscc 108 | *.vssscc 109 | .builds 110 | *.pidb 111 | *.svclog 112 | *.scc 113 | 114 | # Chutzpah Test files 115 | _Chutzpah* 116 | 117 | # Visual C++ cache files 118 | ipch/ 119 | *.aps 120 | *.ncb 121 | *.opendb 122 | *.opensdf 123 | *.sdf 124 | *.cachefile 125 | *.VC.db 126 | *.VC.VC.opendb 127 | 128 | # Visual Studio profiler 129 | *.psess 130 | *.vsp 131 | *.vspx 132 | *.sap 133 | 134 | # Visual Studio Trace Files 135 | *.e2e 136 | 137 | # TFS 2012 Local Workspace 138 | $tf/ 139 | 140 | # Guidance Automation Toolkit 141 | *.gpState 142 | 143 | # ReSharper is a .NET coding add-in 144 | _ReSharper*/ 145 | *.[Rr]e[Ss]harper 146 | *.DotSettings.user 147 | 148 | # JustCode is a .NET coding add-in 149 | .JustCode 150 | 151 | # TeamCity is a build add-in 152 | _TeamCity* 153 | 154 | # DotCover is a Code Coverage Tool 155 | *.dotCover 156 | 157 | # AxoCover is a Code Coverage Tool 158 | .axoCover/* 159 | !.axoCover/settings.json 160 | 161 | # Visual Studio code coverage results 162 | *.coverage 163 | *.coveragexml 164 | 165 | # NCrunch 166 | _NCrunch_* 167 | .*crunch*.local.xml 168 | nCrunchTemp_* 169 | 170 | # MightyMoose 171 | *.mm.* 172 | AutoTest.Net/ 173 | 174 | # Web workbench (sass) 175 | .sass-cache/ 176 | 177 | # Installshield output folder 178 | [Ee]xpress/ 179 | 180 | # DocProject is a documentation generator add-in 181 | DocProject/buildhelp/ 182 | DocProject/Help/*.HxT 183 | DocProject/Help/*.HxC 184 | DocProject/Help/*.hhc 185 | DocProject/Help/*.hhk 186 | DocProject/Help/*.hhp 187 | DocProject/Help/Html2 188 | DocProject/Help/html 189 | 190 | # Click-Once directory 191 | publish/ 192 | 193 | # Publish Web Output 194 | *.[Pp]ublish.xml 195 | *.azurePubxml 196 | # Note: Comment the next line if you want to checkin your web deploy settings, 197 | # but database connection strings (with potential passwords) will be unencrypted 198 | *.pubxml 199 | *.publishproj 200 | 201 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 202 | # checkin your Azure Web App publish settings, but sensitive information contained 203 | # in these scripts will be unencrypted 204 | PublishScripts/ 205 | 206 | # NuGet Packages 207 | *.nupkg 208 | # NuGet Symbol Packages 209 | *.snupkg 210 | # The packages folder can be ignored because of Package Restore 211 | **/[Pp]ackages/* 212 | # except build/, which is used as an MSBuild target. 213 | !**/[Pp]ackages/build/ 214 | # Uncomment if necessary however generally it will be regenerated when needed 215 | #!**/[Pp]ackages/repositories.config 216 | # NuGet v3's project.json files produces more ignorable files 217 | *.nuget.props 218 | *.nuget.targets 219 | 220 | # Microsoft Azure Build Output 221 | csx/ 222 | *.build.csdef 223 | 224 | # Microsoft Azure Emulator 225 | ecf/ 226 | rcf/ 227 | 228 | # Windows Store app package directories and files 229 | AppPackages/ 230 | BundleArtifacts/ 231 | Package.StoreAssociation.xml 232 | _pkginfo.txt 233 | *.appx 234 | *.appxbundle 235 | *.appxupload 236 | 237 | # Visual Studio cache files 238 | # files ending in .cache can be ignored 239 | *.[Cc]ache 240 | # but keep track of directories ending in .cache 241 | !?*.[Cc]ache/ 242 | 243 | # Others 244 | ClientBin/ 245 | ~$* 246 | *~ 247 | *.dbmdl 248 | *.dbproj.schemaview 249 | *.jfm 250 | *.pfx 251 | *.publishsettings 252 | orleans.codegen.cs 253 | 254 | # Including strong name files can present a security risk 255 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 256 | #*.snk 257 | 258 | # Since there are multiple workflows, uncomment next line to ignore bower_components 259 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 260 | #bower_components/ 261 | 262 | # RIA/Silverlight projects 263 | Generated_Code/ 264 | 265 | # Backup & report files from converting an old project file 266 | # to a newer Visual Studio version. Backup files are not needed, 267 | # because we have git ;-) 268 | _UpgradeReport_Files/ 269 | Backup*/ 270 | UpgradeLog*.XML 271 | UpgradeLog*.htm 272 | ServiceFabricBackup/ 273 | *.rptproj.bak 274 | 275 | # SQL Server files 276 | *.mdf 277 | *.ldf 278 | *.ndf 279 | 280 | # Business Intelligence projects 281 | *.rdl.data 282 | *.bim.layout 283 | *.bim_*.settings 284 | *.rptproj.rsuser 285 | *- [Bb]ackup.rdl 286 | *- [Bb]ackup ([0-9]).rdl 287 | *- [Bb]ackup ([0-9][0-9]).rdl 288 | 289 | # Microsoft Fakes 290 | FakesAssemblies/ 291 | 292 | # GhostDoc plugin setting file 293 | *.GhostDoc.xml 294 | 295 | # Node.js Tools for Visual Studio 296 | .ntvs_analysis.dat 297 | node_modules/ 298 | 299 | # Visual Studio 6 build log 300 | *.plg 301 | 302 | # Visual Studio 6 workspace options file 303 | *.opt 304 | 305 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 306 | *.vbw 307 | 308 | # Visual Studio LightSwitch build output 309 | **/*.HTMLClient/GeneratedArtifacts 310 | **/*.DesktopClient/GeneratedArtifacts 311 | **/*.DesktopClient/ModelManifest.xml 312 | **/*.Server/GeneratedArtifacts 313 | **/*.Server/ModelManifest.xml 314 | _Pvt_Extensions 315 | 316 | # Paket dependency manager 317 | .paket/paket.exe 318 | paket-files/ 319 | 320 | # FAKE - F# Make 321 | .fake/ 322 | 323 | # CodeRush personal settings 324 | .cr/personal 325 | 326 | # Python Tools for Visual Studio (PTVS) 327 | __pycache__/ 328 | *.pyc 329 | 330 | # Cake - Uncomment if you are using it 331 | # tools/** 332 | # !tools/packages.config 333 | 334 | # Tabs Studio 335 | *.tss 336 | 337 | # Telerik's JustMock configuration file 338 | *.jmconfig 339 | 340 | # BizTalk build output 341 | *.btp.cs 342 | *.btm.cs 343 | *.odx.cs 344 | *.xsd.cs 345 | 346 | # OpenCover UI analysis results 347 | OpenCover/ 348 | 349 | # Azure Stream Analytics local run output 350 | ASALocalRun/ 351 | 352 | # MSBuild Binary and Structured Log 353 | *.binlog 354 | 355 | # NVidia Nsight GPU debugger configuration file 356 | *.nvuser 357 | 358 | # MFractors (Xamarin productivity tool) working folder 359 | .mfractor/ 360 | 361 | # Local History for Visual Studio 362 | .localhistory/ 363 | 364 | # BeatPulse healthcheck temp database 365 | healthchecksdb 366 | 367 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 368 | MigrationBackup/ 369 | 370 | # End of https://www.gitignore.io/api/visualstudio 371 | 372 | .vs/* 373 | !.vs/msvc -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "gnu-efi"] 2 | path = gnu-efi 3 | url = https://git.code.sf.net/p/gnu-efi/code 4 | 5 | [submodule "effy"] 6 | path = effy 7 | url = https://github.com/Jamesits/Effy 8 | -------------------------------------------------------------------------------- /.vs/msvc/DRIPSEnabler.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | ARM 7 | 8 | 9 | Debug 10 | ARM64 11 | 12 | 13 | Debug 14 | Win32 15 | 16 | 17 | Debug 18 | x64 19 | 20 | 21 | Release 22 | ARM 23 | 24 | 25 | Release 26 | ARM64 27 | 28 | 29 | Release 30 | Win32 31 | 32 | 33 | Release 34 | x64 35 | 36 | 37 | 38 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE} 39 | DRIPSEnabler 40 | 10.0 41 | 42 | 43 | 44 | x64 45 | 46 | 47 | Application 48 | true 49 | v142 50 | Unicode 51 | 52 | 53 | Application 54 | true 55 | v142 56 | Unicode 57 | 58 | 59 | Application 60 | true 61 | v142 62 | Unicode 63 | true 64 | 65 | 66 | Application 67 | true 68 | v142 69 | Unicode 70 | true 71 | 72 | 73 | Application 74 | false 75 | v142 76 | Unicode 77 | 78 | 79 | Application 80 | false 81 | v142 82 | Unicode 83 | 84 | 85 | Application 86 | false 87 | v142 88 | Unicode 89 | true 90 | 91 | 92 | Application 93 | false 94 | v142 95 | Unicode 96 | true 97 | 98 | 99 | 100 | .efi 101 | false 102 | false 103 | $(SolutionDir)build\x64\$(Configuration)\ 104 | $(OutDir)$(ProjectName)\ 105 | edk2/MdePkg/Include;$(IncludePath) 106 | 107 | 108 | .efi 109 | false 110 | false 111 | $(SolutionDir)build\ia32\$(Configuration)\ 112 | $(OutDir)$(ProjectName)\ 113 | 114 | 115 | .efi 116 | false 117 | false 118 | $(SolutionDir)build\arm\$(Configuration)\ 119 | $(OutDir)$(ProjectName)\ 120 | 121 | 122 | .efi 123 | false 124 | false 125 | $(SolutionDir)build\aa64\$(Configuration)\ 126 | $(OutDir)$(ProjectName)\ 127 | 128 | 129 | .efi 130 | false 131 | false 132 | $(SolutionDir)build\x64\$(Configuration)\ 133 | $(OutDir)$(ProjectName)\ 134 | 135 | 136 | .efi 137 | false 138 | false 139 | $(SolutionDir)build\ia32\$(Configuration)\ 140 | $(OutDir)$(ProjectName)\ 141 | 142 | 143 | .efi 144 | false 145 | false 146 | $(SolutionDir)build\arm\$(Configuration)\ 147 | $(OutDir)$(ProjectName)\ 148 | 149 | 150 | .efi 151 | false 152 | false 153 | $(SolutionDir)build\aa64\$(Configuration)\ 154 | $(OutDir)$(ProjectName)\ 155 | 156 | 157 | 158 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\x86_64 159 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions) 160 | false 161 | CompileAsC 162 | Level3 163 | 4091 164 | ProgramDatabase 165 | Default 166 | false 167 | /Oi- %(AdditionalOptions) 168 | 169 | 170 | EFI Application 171 | 172 | 173 | true 174 | 175 | 176 | gnu-efi.lib;libcmtd.lib;%(AdditionalDependencies) 177 | false 178 | true 179 | efi_main 180 | EFI Application 181 | $(OutDir);%(AdditionalLibraryDirectories) 182 | true 183 | 184 | 185 | 186 | 187 | 188 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\ia32 189 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions) 190 | false 191 | CompileAsC 192 | Level3 193 | ProgramDatabase 194 | 4091 195 | Default 196 | false 197 | /Oi- %(AdditionalOptions) 198 | 199 | 200 | EFI Application 201 | 202 | 203 | true 204 | 205 | 206 | gnu-efi.lib;libcmtd.lib;%(AdditionalDependencies) 207 | false 208 | true 209 | efi_main 210 | EFI Application 211 | $(OutDir);%(AdditionalLibraryDirectories) 212 | true 213 | MachineX86 214 | 215 | 216 | 217 | 218 | 219 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\arm 220 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions) 221 | false 222 | CompileAsC 223 | Level3 224 | ProgramDatabase 225 | 4091 226 | Default 227 | false 228 | /Oi- %(AdditionalOptions) 229 | 230 | 231 | EFI Application 232 | 233 | 234 | true 235 | 236 | 237 | gnu-efi.lib;libcmtd.lib;%(AdditionalDependencies) 238 | false 239 | true 240 | efi_main 241 | EFI Application 242 | $(OutDir);%(AdditionalLibraryDirectories) 243 | true 244 | 245 | 246 | 247 | 248 | 249 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\aarch64 250 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions) 251 | false 252 | CompileAsC 253 | Level3 254 | ProgramDatabase 255 | 4091 256 | Default 257 | false 258 | /Oi- %(AdditionalOptions) 259 | 260 | 261 | EFI Application 262 | 263 | 264 | true 265 | 266 | 267 | gnu-efi.lib;libcmtd.lib;%(AdditionalDependencies) 268 | false 269 | true 270 | efi_main 271 | EFI Application 272 | $(OutDir);%(AdditionalLibraryDirectories) 273 | true 274 | 275 | 276 | 277 | 278 | 279 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\x86_64 280 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions) 281 | false 282 | CompileAsC 283 | Level3 284 | 4091 285 | false 286 | /Oi- %(AdditionalOptions) 287 | 288 | 289 | EFI Application 290 | 291 | 292 | true 293 | 294 | 295 | false 296 | true 297 | efi_main 298 | EFI Application 299 | gnu-efi.lib;libcmt.lib;%(AdditionalDependencies) 300 | $(OutDir);%(AdditionalLibraryDirectories) 301 | true 302 | 303 | 304 | 305 | 306 | 307 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\ia32 308 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions) 309 | false 310 | CompileAsC 311 | Level3 312 | 4091 313 | false 314 | /Oi- %(AdditionalOptions) 315 | 316 | 317 | EFI Application 318 | 319 | 320 | true 321 | 322 | 323 | false 324 | true 325 | efi_main 326 | EFI Application 327 | gnu-efi.lib;libcmt.lib;%(AdditionalDependencies) 328 | $(OutDir);%(AdditionalLibraryDirectories) 329 | true 330 | 331 | 332 | 333 | 334 | 335 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\arm 336 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions) 337 | false 338 | CompileAsC 339 | Level3 340 | 4091 341 | false 342 | /Oi- %(AdditionalOptions) 343 | 344 | 345 | EFI Application 346 | 347 | 348 | true 349 | 350 | 351 | false 352 | true 353 | efi_main 354 | EFI Application 355 | gnu-efi.lib;libcmt.lib;%(AdditionalDependencies) 356 | $(OutDir);%(AdditionalLibraryDirectories) 357 | true 358 | 359 | 360 | 361 | 362 | 363 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\aarch64 364 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions) 365 | false 366 | CompileAsC 367 | Level3 368 | 4091 369 | false 370 | /Oi- %(AdditionalOptions) 371 | 372 | 373 | EFI Application 374 | 375 | 376 | true 377 | 378 | 379 | false 380 | true 381 | efi_main 382 | EFI Application 383 | gnu-efi.lib;libcmt.lib;%(AdditionalDependencies) 384 | $(OutDir);%(AdditionalLibraryDirectories) 385 | true 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | -------------------------------------------------------------------------------- /.vs/msvc/DRIPSEnabler.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {b1c3b304-e868-4b07-988c-36ad7bc57300} 14 | 15 | 16 | 17 | 18 | Resource Files 19 | 20 | 21 | 22 | 23 | Source Files 24 | 25 | 26 | Source Files 27 | 28 | 29 | Source Files 30 | 31 | 32 | Source Files 33 | 34 | 35 | Source Files 36 | 37 | 38 | Source Files 39 | 40 | 41 | Source Files 42 | 43 | 44 | Source Files 45 | 46 | 47 | 48 | 49 | Source Files 50 | 51 | 52 | Source Files 53 | 54 | 55 | Source Files 56 | 57 | 58 | Source Files 59 | 60 | 61 | Source Files 62 | 63 | 64 | Source Files 65 | 66 | 67 | Source Files 68 | 69 | 70 | Source Files 71 | 72 | 73 | Source Files 74 | 75 | 76 | Source Files 77 | 78 | 79 | -------------------------------------------------------------------------------- /.vs/msvc/gnu-efi.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | ARM 7 | 8 | 9 | Debug 10 | ARM64 11 | 12 | 13 | Debug 14 | Win32 15 | 16 | 17 | Debug 18 | x64 19 | 20 | 21 | Release 22 | ARM 23 | 24 | 25 | Release 26 | ARM64 27 | 28 | 29 | Release 30 | Win32 31 | 32 | 33 | Release 34 | x64 35 | 36 | 37 | 38 | {3135D563-9596-4584-9ED6-616ADEC52974} 39 | gnuefi 40 | 10.0 41 | 42 | 43 | 44 | x64 45 | 46 | 47 | StaticLibrary 48 | true 49 | v142 50 | Unicode 51 | 52 | 53 | StaticLibrary 54 | true 55 | v142 56 | Unicode 57 | 58 | 59 | StaticLibrary 60 | true 61 | v142 62 | Unicode 63 | true 64 | 65 | 66 | StaticLibrary 67 | true 68 | v142 69 | Unicode 70 | true 71 | 72 | 73 | StaticLibrary 74 | false 75 | v142 76 | true 77 | Unicode 78 | 79 | 80 | StaticLibrary 81 | false 82 | v142 83 | true 84 | Unicode 85 | 86 | 87 | StaticLibrary 88 | false 89 | v142 90 | true 91 | Unicode 92 | true 93 | 94 | 95 | StaticLibrary 96 | false 97 | v142 98 | true 99 | Unicode 100 | true 101 | 102 | 103 | 104 | $(SolutionDir)build\x64\$(Configuration)\ 105 | $(OutDir)$(ProjectName)\ 106 | 107 | 108 | $(SolutionDir)build\ia32\$(Configuration)\ 109 | $(OutDir)$(ProjectName)\ 110 | 111 | 112 | $(SolutionDir)build\arm\$(Configuration)\ 113 | $(OutDir)$(ProjectName)\ 114 | 115 | 116 | $(SolutionDir)build\aa64\$(Configuration)\ 117 | $(OutDir)$(ProjectName)\ 118 | 119 | 120 | $(SolutionDir)build\x64\$(Configuration)\ 121 | $(OutDir)$(ProjectName)\ 122 | 123 | 124 | $(SolutionDir)build\ia32\$(Configuration)\ 125 | $(OutDir)$(ProjectName)\ 126 | 127 | 128 | $(SolutionDir)build\arm\$(Configuration)\ 129 | $(OutDir)$(ProjectName)\ 130 | 131 | 132 | $(SolutionDir)build\aa64\$(Configuration)\ 133 | $(OutDir)$(ProjectName)\ 134 | 135 | 136 | 137 | Level3 138 | Disabled 139 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\x86_64;$(SolutionDir)\gnu-efi\inc\protocol;$(SolutionDir)\gnu-efi\lib 140 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions) 141 | false 142 | CompileAsC 143 | MultiThreadedDebug 144 | 4312 145 | ProgramDatabase 146 | Default 147 | false 148 | /Oi- 149 | 150 | 151 | true 152 | 153 | 154 | EFI Application 155 | true 156 | 157 | 158 | 159 | 160 | Level3 161 | Disabled 162 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\ia32;$(SolutionDir)\gnu-efi\inc\protocol;$(SolutionDir)\gnu-efi\lib 163 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions) 164 | false 165 | CompileAsC 166 | MultiThreadedDebug 167 | ProgramDatabase 168 | 4312 169 | Default 170 | false 171 | /Oi- 172 | 173 | 174 | true 175 | 176 | 177 | EFI Application 178 | true 179 | 180 | 181 | 182 | 183 | Level3 184 | Disabled 185 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\arm;$(SolutionDir)\gnu-efi\inc\protocol;$(SolutionDir)\gnu-efi\lib 186 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions) 187 | false 188 | CompileAsC 189 | MultiThreadedDebug 190 | ProgramDatabase 191 | 4312 192 | Default 193 | false 194 | /Oi- 195 | 196 | 197 | true 198 | 199 | 200 | EFI Application 201 | true 202 | 203 | 204 | 205 | 206 | Level3 207 | Disabled 208 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\aarch64;$(SolutionDir)\gnu-efi\inc\protocol;$(SolutionDir)\gnu-efi\lib 209 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;__SIZE_TYPE__=uint64_t;%(PreprocessorDefinitions) 210 | false 211 | CompileAsC 212 | MultiThreadedDebug 213 | ProgramDatabase 214 | 4312 215 | Default 216 | false 217 | /Oi- 218 | 219 | 220 | true 221 | 222 | 223 | EFI Application 224 | true 225 | 226 | 227 | 228 | 229 | Level3 230 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\x86_64;$(SolutionDir)\gnu-efi\inc\protocol;$(SolutionDir)\gnu-efi\lib 231 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions) 232 | false 233 | CompileAsC 234 | MultiThreaded 235 | 4312 236 | false 237 | false 238 | /Oi- 239 | 240 | 241 | true 242 | true 243 | true 244 | 245 | 246 | EFI Application 247 | true 248 | 249 | 250 | 251 | 252 | Level3 253 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\ia32;$(SolutionDir)\gnu-efi\inc\protocol;$(SolutionDir)\gnu-efi\lib 254 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions) 255 | false 256 | CompileAsC 257 | MultiThreaded 258 | 4312 259 | false 260 | false 261 | /Oi- 262 | 263 | 264 | true 265 | true 266 | true 267 | 268 | 269 | EFI Application 270 | true 271 | 272 | 273 | 274 | 275 | Level3 276 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\arm;$(SolutionDir)\gnu-efi\inc\protocol;$(SolutionDir)\gnu-efi\lib 277 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;%(PreprocessorDefinitions) 278 | false 279 | CompileAsC 280 | MultiThreaded 281 | 4312 282 | false 283 | false 284 | /Oi- 285 | 286 | 287 | true 288 | true 289 | true 290 | 291 | 292 | EFI Application 293 | true 294 | 295 | 296 | 297 | 298 | Level3 299 | $(SolutionDir)\gnu-efi\inc;$(SolutionDir)\gnu-efi\inc\aarch64;$(SolutionDir)\gnu-efi\inc\protocol;$(SolutionDir)\gnu-efi\lib 300 | _UNICODE;UNICODE;HAVE_USE_MS_ABI;GNU_EFI_USE_EXTERNAL_STDARG;__SIZE_TYPE__=uint64_t;%(PreprocessorDefinitions) 301 | false 302 | CompileAsC 303 | MultiThreaded 304 | 4312 305 | false 306 | false 307 | /Oi- 308 | 309 | 310 | true 311 | true 312 | true 313 | 314 | 315 | EFI Application 316 | true 317 | 318 | 319 | 320 | 321 | true 322 | true 323 | false 324 | false 325 | true 326 | true 327 | true 328 | true 329 | 330 | 331 | true 332 | true 333 | false 334 | false 335 | true 336 | true 337 | true 338 | true 339 | 340 | 341 | false 342 | false 343 | true 344 | true 345 | true 346 | true 347 | true 348 | true 349 | 350 | 351 | false 352 | false 353 | true 354 | true 355 | true 356 | true 357 | true 358 | true 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | true 374 | true 375 | true 376 | true 377 | false 378 | false 379 | true 380 | true 381 | 382 | 383 | true 384 | true 385 | true 386 | true 387 | false 388 | false 389 | true 390 | true 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | true 406 | true 407 | true 408 | true 409 | true 410 | true 411 | false 412 | false 413 | 414 | 415 | true 416 | true 417 | true 418 | true 419 | true 420 | true 421 | false 422 | false 423 | 424 | 425 | 426 | 427 | 428 | -------------------------------------------------------------------------------- /.vs/msvc/gnu-efi.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {20c8e9bd-0fa8-46d3-b825-e3eebd64ab3d} 14 | 15 | 16 | {87122940-e80f-416d-a840-5e32f703f3ff} 17 | 18 | 19 | {e6e3d25a-4fce-4036-bef9-3cfbafc4baaf} 20 | 21 | 22 | {cf7e7031-77e5-4827-9aa6-f996fc4b3d06} 23 | 24 | 25 | 26 | 27 | Source Files 28 | 29 | 30 | Source Files 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | Source Files 40 | 41 | 42 | Source Files 43 | 44 | 45 | Source Files 46 | 47 | 48 | Source Files 49 | 50 | 51 | Source Files 52 | 53 | 54 | Source Files 55 | 56 | 57 | Source Files 58 | 59 | 60 | Source Files 61 | 62 | 63 | Source Files 64 | 65 | 66 | Source Files 67 | 68 | 69 | Source Files 70 | 71 | 72 | Source Files 73 | 74 | 75 | Source Files 76 | 77 | 78 | Source Files 79 | 80 | 81 | Source Files 82 | 83 | 84 | Source Files 85 | 86 | 87 | Source Files 88 | 89 | 90 | Source Files 91 | 92 | 93 | Source Files 94 | 95 | 96 | Source Files 97 | 98 | 99 | Source Files\arm 100 | 101 | 102 | Source Files\x86_64 103 | 104 | 105 | Source Files\ia32 106 | 107 | 108 | Source Files\x86_64 109 | 110 | 111 | Source Files\ia32 112 | 113 | 114 | Source Files\arm 115 | 116 | 117 | Source Files\aarch64 118 | 119 | 120 | Source Files\aarch64 121 | 122 | 123 | -------------------------------------------------------------------------------- /DRIPSEnabler.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27004.2006 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DRIPSEnabler", ".vs\msvc\DRIPSEnabler.vcxproj", "{DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {3135D563-9596-4584-9ED6-616ADEC52974} = {3135D563-9596-4584-9ED6-616ADEC52974} 9 | EndProjectSection 10 | EndProject 11 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gnu-efi", ".vs\msvc\gnu-efi.vcxproj", "{3135D563-9596-4584-9ED6-616ADEC52974}" 12 | EndProject 13 | Global 14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 15 | Debug|arm = Debug|arm 16 | Debug|aa64 = Debug|aa64 17 | Debug|ia32 = Debug|ia32 18 | Debug|x64 = Debug|x64 19 | Release|arm = Release|arm 20 | Release|aa64 = Release|aa64 21 | Release|ia32 = Release|ia32 22 | Release|x64 = Release|x64 23 | EndGlobalSection 24 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 25 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Debug|arm.ActiveCfg = Debug|ARM 26 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Debug|arm.Build.0 = Debug|ARM 27 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Debug|aa64.ActiveCfg = Debug|ARM64 28 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Debug|aa64.Build.0 = Debug|ARM64 29 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Debug|ia32.ActiveCfg = Debug|Win32 30 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Debug|ia32.Build.0 = Debug|Win32 31 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Debug|x64.ActiveCfg = Debug|x64 32 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Debug|x64.Build.0 = Debug|x64 33 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Release|arm.ActiveCfg = Release|ARM 34 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Release|arm.Build.0 = Release|ARM 35 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Release|aa64.ActiveCfg = Release|ARM64 36 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Release|aa64.Build.0 = Release|ARM64 37 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Release|ia32.ActiveCfg = Release|Win32 38 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Release|ia32.Build.0 = Release|Win32 39 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Release|x64.ActiveCfg = Release|x64 40 | {DFA0BA98-D0BA-4176-9A34-B5BA6355B1DE}.Release|x64.Build.0 = Release|x64 41 | {3135D563-9596-4584-9ED6-616ADEC52974}.Debug|arm.ActiveCfg = Debug|ARM 42 | {3135D563-9596-4584-9ED6-616ADEC52974}.Debug|arm.Build.0 = Debug|ARM 43 | {3135D563-9596-4584-9ED6-616ADEC52974}.Debug|aa64.ActiveCfg = Debug|ARM64 44 | {3135D563-9596-4584-9ED6-616ADEC52974}.Debug|aa64.Build.0 = Debug|ARM64 45 | {3135D563-9596-4584-9ED6-616ADEC52974}.Debug|ia32.ActiveCfg = Debug|Win32 46 | {3135D563-9596-4584-9ED6-616ADEC52974}.Debug|ia32.Build.0 = Debug|Win32 47 | {3135D563-9596-4584-9ED6-616ADEC52974}.Debug|x64.ActiveCfg = Debug|x64 48 | {3135D563-9596-4584-9ED6-616ADEC52974}.Debug|x64.Build.0 = Debug|x64 49 | {3135D563-9596-4584-9ED6-616ADEC52974}.Release|arm.ActiveCfg = Release|ARM 50 | {3135D563-9596-4584-9ED6-616ADEC52974}.Release|arm.Build.0 = Release|ARM 51 | {3135D563-9596-4584-9ED6-616ADEC52974}.Release|aa64.ActiveCfg = Release|ARM64 52 | {3135D563-9596-4584-9ED6-616ADEC52974}.Release|aa64.Build.0 = Release|ARM64 53 | {3135D563-9596-4584-9ED6-616ADEC52974}.Release|ia32.ActiveCfg = Release|Win32 54 | {3135D563-9596-4584-9ED6-616ADEC52974}.Release|ia32.Build.0 = Release|Win32 55 | {3135D563-9596-4584-9ED6-616ADEC52974}.Release|x64.ActiveCfg = Release|x64 56 | {3135D563-9596-4584-9ED6-616ADEC52974}.Release|x64.Build.0 = Release|x64 57 | EndGlobalSection 58 | GlobalSection(SolutionProperties) = preSolution 59 | HideSolutionNode = FALSE 60 | EndGlobalSection 61 | GlobalSection(ExtensibilityGlobals) = postSolution 62 | SolutionGuid = {376E6530-5878-4CF4-AFB7-123F799056A2} 63 | EndGlobalSection 64 | EndGlobal 65 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2020 James Swineson 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 7 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | 9 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | ARCH = x64 2 | # You can alter the subsystem according to your EFI binary target: 3 | # 10 = EFI application 4 | # 11 = EFI boot service driver 5 | # 12 = EFI runtime driver 6 | SUBSYSTEM = 10 7 | 8 | # Try to auto-detect the target ARCH 9 | ifeq ($(shell uname -o),Msys) 10 | IS_MINGW32 = $(findstring MINGW32,$(shell uname -s)) 11 | IS_MINGW64 = $(findstring MINGW64,$(shell uname -s)) 12 | ifeq ($(IS_MINGW32),MINGW32) 13 | ARCH = ia32 14 | endif 15 | ifeq ($(IS_MINGW64),MINGW64) 16 | ARCH = x64 17 | endif 18 | else 19 | ifeq ($(shell uname -m),x86_64) 20 | ARCH = x64 21 | else ifeq ($(shell uname -m),arm) 22 | ARCH = arm 23 | CROSS_COMPILE = 24 | else ifeq ($(shell uname -m),aarch64) 25 | ARCH = aa64 26 | CROSS_COMPILE = 27 | else 28 | ARCH = ia32 29 | endif 30 | endif 31 | 32 | # Auto-detect the host arch for MinGW 33 | ifeq ($(shell uname -m),x86_64) 34 | MINGW_HOST = w64 35 | else 36 | MINGW_HOST = w32 37 | endif 38 | 39 | ifeq ($(ARCH),x64) 40 | GNUEFI_ARCH = x86_64 41 | GCC_ARCH = x86_64 42 | QEMU_ARCH = x86_64 43 | FW_BASE = OVMF 44 | CROSS_COMPILE = $(GCC_ARCH)-$(MINGW_HOST)-mingw32- 45 | EP_PREFIX = 46 | CFLAGS = -m64 -mno-red-zone 47 | LDFLAGS = -Wl,-dll -Wl,--subsystem,$(SUBSYSTEM) 48 | else ifeq ($(ARCH),ia32) 49 | GNUEFI_ARCH = ia32 50 | GCC_ARCH = i686 51 | QEMU_ARCH = i386 52 | FW_BASE = OVMF 53 | CROSS_COMPILE = $(GCC_ARCH)-$(MINGW_HOST)-mingw32- 54 | EP_PREFIX = _ 55 | CFLAGS = -m32 -mno-red-zone 56 | LDFLAGS = -Wl,-dll -Wl,--subsystem,$(SUBSYSTEM) 57 | else ifeq ($(ARCH),arm) 58 | GNUEFI_ARCH = arm 59 | GCC_ARCH = arm 60 | QEMU_ARCH = arm 61 | FW_BASE = QEMU_EFI 62 | CROSS_COMPILE = $(GCC_ARCH)-linux-gnueabihf- 63 | EP_PREFIX = 64 | CFLAGS = -marm -fpic -fshort-wchar 65 | LDFLAGS = -Wl,--no-wchar-size-warning -Wl,--defsym=EFI_SUBSYSTEM=$(SUBSYSTEM) 66 | CRT0_LIBS = -lgnuefi 67 | QEMU_OPTS = -M virt -cpu cortex-a15 68 | else ifeq ($(ARCH),aa64) 69 | GNUEFI_ARCH = aarch64 70 | GCC_ARCH = aarch64 71 | QEMU_ARCH = aarch64 72 | FW_BASE = QEMU_EFI 73 | CROSS_COMPILE = $(GCC_ARCH)-linux-gnu- 74 | EP_PREFIX = 75 | CFLAGS = -fpic -fshort-wchar 76 | LDFLAGS = -Wl,--no-wchar-size-warning -Wl,--defsym=EFI_SUBSYSTEM=$(SUBSYSTEM) 77 | CRT0_LIBS = -lgnuefi 78 | QEMU_OPTS = -M virt -cpu cortex-a57 79 | endif 80 | FW_ARCH = $(shell echo $(ARCH) | tr a-z A-Z) 81 | FW_ZIP = $(FW_BASE)-$(FW_ARCH).zip 82 | GNUEFI_DIR = $(CURDIR)/gnu-efi 83 | GNUEFI_LIBS = lib 84 | 85 | # If the compiler produces an elf binary, we need to fiddle with a PE crt0 86 | ifneq ($(CRT0_LIBS),) 87 | CRT0_DIR = $(GNUEFI_DIR)/$(GNUEFI_ARCH)/gnuefi 88 | LDFLAGS += -L$(CRT0_DIR) -T $(GNUEFI_DIR)/gnuefi/elf_$(GNUEFI_ARCH)_efi.lds $(CRT0_DIR)/crt0-efi-$(GNUEFI_ARCH).o 89 | GNUEFI_LIBS += gnuefi 90 | endif 91 | 92 | # SYSTEMROOT is only defined on Windows systems 93 | ifneq ($(SYSTEMROOT),) 94 | QEMU = "/c/Program Files/qemu/qemu-system-$(QEMU_ARCH)w.exe" 95 | # MinGW on Windows doesn't use (tuple)-ar but (tuple)-gcc-ar 96 | # so we remove the cross compiler tuple altogether 97 | CROSS_COMPILE = 98 | else 99 | QEMU = qemu-system-$(QEMU_ARCH) -nographic 100 | endif 101 | 102 | CC := $(CROSS_COMPILE)gcc 103 | OBJCOPY := $(CROSS_COMPILE)objcopy 104 | CFLAGS += -fno-stack-protector -Wshadow -Wall -Wunused -Werror-implicit-function-declaration 105 | CFLAGS += -I$(GNUEFI_DIR)/inc -I$(GNUEFI_DIR)/inc/$(GNUEFI_ARCH) -I$(GNUEFI_DIR)/inc/protocol 106 | CFLAGS += -DCONFIG_$(GNUEFI_ARCH) -D__MAKEWITH_GNUEFI -DGNU_EFI_USE_MS_ABI 107 | LDFLAGS += -L$(GNUEFI_DIR)/$(GNUEFI_ARCH)/lib -e $(EP_PREFIX)efi_main 108 | LDFLAGS += -s -Wl,-Bsymbolic -nostdlib -shared 109 | LIBS = -lefi $(CRT0_LIBS) 110 | 111 | ifeq (, $(shell which $(CC))) 112 | $(error The selected compiler ($(CC)) was not found) 113 | endif 114 | 115 | GCCVERSION := $(shell $(CC) -dumpversion | cut -f1 -d.) 116 | GCCMINOR := $(shell $(CC) -dumpversion | cut -f2 -d.) 117 | GCCMACHINE := $(shell $(CC) -dumpmachine) 118 | GCCNEWENOUGH := $(shell ( [ $(GCCVERSION) -gt "4" ] \ 119 | || ( [ $(GCCVERSION) -eq "4" ] \ 120 | && [ $(GCCMINOR) -ge "7" ] ) ) \ 121 | && echo 1) 122 | ifneq ($(GCCNEWENOUGH),1) 123 | $(error You need GCC 4.7 or later) 124 | endif 125 | 126 | ifneq ($(GCC_ARCH),$(findstring $(GCC_ARCH), $(GCCMACHINE))) 127 | $(error The selected compiler ($(CC)) is not set for $(ARCH)) 128 | endif 129 | 130 | .PHONY: all clean superclean 131 | all: $(GNUEFI_DIR)/$(GNUEFI_ARCH)/lib/libefi.a main.efi 132 | 133 | $(GNUEFI_DIR)/$(GNUEFI_ARCH)/lib/libefi.a: 134 | $(MAKE) -C$(GNUEFI_DIR) CROSS_COMPILE=$(CROSS_COMPILE) ARCH=$(GNUEFI_ARCH) $(GNUEFI_LIBS) 135 | 136 | %.efi: %.o 137 | @echo [LD] $(notdir $@) 138 | ifeq ($(CRT0_LIBS),) 139 | @$(CC) $(LDFLAGS) $< -o $@ $(LIBS) 140 | else 141 | @$(CC) $(LDFLAGS) $< -o $*.elf $(LIBS) 142 | @$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel* \ 143 | -j .rela* -j .reloc -j .eh_frame -O binary $*.elf $@ 144 | @rm -f $*.elf 145 | endif 146 | 147 | %.o: %.c 148 | @echo [CC] $(notdir $@) 149 | @$(CC) $(CFLAGS) -ffreestanding -c $< 150 | 151 | qemu: CFLAGS += -D_DEBUG 152 | qemu: all $(FW_BASE)_$(FW_ARCH).fd image/efi/boot/boot$(ARCH).efi 153 | $(QEMU) $(QEMU_OPTS) -bios ./$(FW_BASE)_$(FW_ARCH).fd -net none -hda fat:rw:image 154 | 155 | image/efi/boot/boot$(ARCH).efi: main.efi 156 | mkdir -p image/efi/boot 157 | cp -f $< $@ 158 | 159 | $(FW_BASE)_$(FW_ARCH).fd: 160 | wget https://efi.akeo.ie/$(FW_BASE)/$(FW_ZIP) 161 | unzip $(FW_ZIP) $(FW_BASE).fd 162 | mv $(FW_BASE).fd $(FW_BASE)_$(FW_ARCH).fd 163 | rm $(FW_ZIP) 164 | 165 | clean: 166 | rm -f main.efi *.o 167 | rm -rf image 168 | 169 | superclean: clean 170 | $(MAKE) -C$(GNUEFI_DIR) ARCH=$(GNUEFI_ARCH) clean 171 | rm -f *.fd 172 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DRIPSEnabler 2 | 3 | This UEFI program enables Intel [PEP (Power Engine Plug-in)](https://docs.microsoft.com/en-us/windows-hardware/design/device-experiences/prepare-hardware-for-modern-standby#powering-down-the-soc) and adds support for DRIPS if your firmware didn't support it natively. DRIPS allows more devices being shut down during S0ix, thus saving more energy. 4 | 5 | > 这个好像不是所有大学生都能写出来的玩意了——[Ben Wang](https://github.com/imbushuo),2020-02-12 6 | 7 | ## WARNING 8 | 9 | This is not an end-user product. This is pure experimental. 10 | 11 | S0ix might not be fully supported by your hardware, firmware or operating system. Enabling S0ix might overheat your device and cause fire in extreme environments. The developer is not responsible for anything that happen to you or your computer. 12 | 13 | Loading incorrect ACPI tables might cause harm to your hardware, render your OS unable to boot, and cause data damage. Loading untrusted ACPI table might harm your data security. 14 | 15 | ## Usage 16 | 17 | ### Requirements 18 | 19 | * UEFI-enabled firmware 20 | * Windows 10 1903 (19H1) or later (earlier versions of Windows doesn't support IntelPEP if it is not available during OS installation, but your mileage may vary) 21 | * S0ix is enabled (natively or use [S0ixEnabler](https://github.com/Jamesits/S0ixEnabler)) 22 | 23 | ### Preparation 24 | 25 | * [Find](tables/LPIT) or [write](https://github.com/Jamesits/DRIPSEnabler/wiki/LPIT-Table) a LPIT table that fits your hardware 26 | * [Find](tables/SSDT) or [write](https://github.com/Jamesits/DRIPSEnabler/wiki/SSDT-Table) a SSDT table that fits your hardware 27 | 28 | LPIT table should already be binary, name it `LPIT.bin`. SSDT is usually written in [ACPI Source Language](https://acpica.org/sites/acpica/files/asl_tutorial_v20190625.pdf), now compile it using [Intel iasl](https://github.com/acpica/acpica) or equivalent: 29 | 30 | ```shell 31 | # assume under Debian-based Linux distro 32 | sudo apt-get install acpica-tools 33 | iasl -tc IntelPEP.dsl 34 | ``` 35 | 36 | and name the generated binary table file `IntelPEP.aml`. 37 | 38 | ### Installation 39 | 40 | Put `DRIPSEnabler.efi` to a location where it will be executed before Windows starts. If you are using rEFInd, put it under `ESP:\EFI\refind\drivers_x64`. You can also load it using UEFI shell's `startup.nsh`. 41 | 42 | Create a directory on the root of the same volume where you put `DRIPSEnabler.efi`, name it `DRIPSEnabler`. Put `LPIT.bin` and `IntelPEP.dsl` into that directory. 43 | 44 | Now reboot. 45 | 46 | ### Verification 47 | 48 | See [SSDT Debugging / Verification](https://github.com/Jamesits/DRIPSEnabler/wiki/SSDT-Table#debugging--verification). -------------------------------------------------------------------------------- /debug.vbs: -------------------------------------------------------------------------------- 1 | ' Visual Studio QEMU debugging script. 2 | ' 3 | ' I like invoking vbs as much as anyone else, but we need to download and unzip our 4 | ' firmware file, as well as launch QEMU, and neither Powershell or a standard batch 5 | ' can do that without having an extra console appearing. 6 | ' 7 | ' Note: You may get a prompt from the firewall when trying to download the BIOS file 8 | 9 | ' Modify these variables as needed 10 | QEMU_PATH = "C:\Program Files\qemu\" 11 | ' You can add something like "-S -gdb tcp:127.0.0.1:1234" if you plan to use gdb to debug 12 | QEMU_OPTS = "-net none -monitor none -parallel none" 13 | ' Set to True if you need to download a file that might be cached locally 14 | NO_CACHE = False 15 | 16 | ' You shouldn't have to modify anything below this 17 | TARGET = WScript.Arguments(1) 18 | 19 | If (TARGET = "x86") Then 20 | UEFI_EXT = "ia32" 21 | QEMU_ARCH = "i386" 22 | FW_BASE = "OVMF" 23 | ElseIf (TARGET = "x64") Then 24 | UEFI_EXT = "x64" 25 | QEMU_ARCH = "x86_64" 26 | FW_BASE = "OVMF" 27 | ElseIf (TARGET = "ARM") Then 28 | UEFI_EXT = "arm" 29 | QEMU_ARCH = "arm" 30 | FW_BASE = "QEMU_EFI" 31 | ' You can also add '-device VGA' to the options below, to get graphics output. 32 | ' But if you do, be mindful that the keyboard input may not work... :( 33 | QEMU_OPTS = "-M virt -cpu cortex-a15 " & QEMU_OPTS 34 | ElseIf (TARGET = "ARM64") Then 35 | UEFI_EXT = "aa64" 36 | QEMU_ARCH = "aarch64" 37 | FW_BASE = "QEMU_EFI" 38 | QEMU_OPTS = "-M virt -cpu cortex-a57 " & QEMU_OPTS 39 | Else 40 | MsgBox("Unsupported debug target: " & TARGET) 41 | Call WScript.Quit(1) 42 | End If 43 | BOOT_NAME = "boot" & UEFI_EXT & ".efi" 44 | QEMU_EXE = "qemu-system-" & QEMU_ARCH & "w.exe" 45 | 46 | FW_ARCH = UCase(UEFI_EXT) 47 | FW_DIR = "https://efi.akeo.ie/" & FW_BASE & "/" 48 | FW_ZIP = FW_BASE & "-" & FW_ARCH & ".zip" 49 | FW_FILE = FW_BASE & "_" & FW_ARCH & ".fd" 50 | FW_URL = FW_DIR & FW_ZIP 51 | 52 | ' Globals 53 | Set fso = CreateObject("Scripting.FileSystemObject") 54 | Set shell = CreateObject("WScript.Shell") 55 | 56 | ' Download a file from FTP 57 | Sub DownloadFtp(Server, Path) 58 | Set file = fso.CreateTextFile("ftp.txt", True) 59 | Call file.Write("open " & Server & vbCrLf &_ 60 | "anonymous" & vbCrLf & "user" & vbCrLf & "bin" & vbCrLf &_ 61 | "get " & Path & vbCrLf & "bye" & vbCrLf) 62 | Call file.Close() 63 | Call shell.Run("%comspec% /c ftp -s:ftp.txt > NUL", 0, True) 64 | Call fso.DeleteFile("ftp.txt") 65 | End Sub 66 | 67 | ' Download a file from HTTP 68 | Sub DownloadHttp(Url, File) 69 | Const BINARY = 1 70 | Const OVERWRITE = 2 71 | Set xHttp = createobject("Microsoft.XMLHTTP") 72 | Set bStrm = createobject("Adodb.Stream") 73 | Call xHttp.Open("GET", Url, False) 74 | If NO_CACHE = True Then 75 | Call xHttp.SetRequestHeader("If-None-Match", "some-random-string") 76 | Call xHttp.SetRequestHeader("Cache-Control", "no-cache,max-age=0") 77 | Call xHttp.SetRequestHeader("Pragma", "no-cache") 78 | End If 79 | Call xHttp.Send() 80 | If Not xHttp.Status = 200 Then 81 | Call WScript.Echo("Unable to access file - Error " & xHttp.Status) 82 | Call WScript.Quit(1) 83 | End If 84 | With bStrm 85 | .type = BINARY 86 | .open 87 | .write xHttp.responseBody 88 | .savetofile File, OVERWRITE 89 | End With 90 | End Sub 91 | 92 | ' Unzip a specific file from an archive 93 | Sub Unzip(Archive, File) 94 | Const NOCONFIRMATION = &H10& 95 | Const NOERRORUI = &H400& 96 | Const SIMPLEPROGRESS = &H100& 97 | unzipFlags = NOCONFIRMATION + NOERRORUI + SIMPLEPROGRESS 98 | Set objShell = CreateObject("Shell.Application") 99 | Set objSource = objShell.NameSpace(fso.GetAbsolutePathName(Archive)).Items() 100 | Set objTarget = objShell.NameSpace(fso.GetAbsolutePathName(".")) 101 | ' Only extract the file we are interested in 102 | For i = 0 To objSource.Count - 1 103 | If objSource.Item(i).Name = File Then 104 | Call objTarget.CopyHere(objSource.Item(i), unzipFlags) 105 | End If 106 | Next 107 | End Sub 108 | 109 | 110 | ' Check that QEMU is available 111 | If Not fso.FileExists(QEMU_PATH & QEMU_EXE) Then 112 | Call WScript.Echo("'" & QEMU_PATH & QEMU_EXE & "' was not found." & vbCrLf &_ 113 | "Please make sure QEMU is installed or edit the path in '.msvc\debug.vbs'.") 114 | Call WScript.Quit(1) 115 | End If 116 | 117 | ' Fetch the UEFI firmware and unzip it 118 | If Not fso.FileExists(FW_FILE) Then 119 | Call WScript.Echo("The UEFI firmware file, needed for QEMU, " &_ 120 | "will be downloaded from: " & FW_URL & vbCrLf & vbCrLf &_ 121 | "Note: Unless you delete the file, this should only happen once.") 122 | Call DownloadHttp(FW_URL, FW_ZIP) 123 | End If 124 | If Not fso.FileExists(FW_ZIP) And Not fso.FileExists(FW_FILE) Then 125 | Call WScript.Echo("There was a problem downloading the QEMU UEFI firmware.") 126 | Call WScript.Quit(1) 127 | End If 128 | If fso.FileExists(FW_ZIP) Then 129 | Call Unzip(FW_ZIP, FW_BASE & ".fd") 130 | Call fso.MoveFile(FW_BASE & ".fd", FW_FILE) 131 | Call fso.DeleteFile(FW_ZIP) 132 | End If 133 | If Not fso.FileExists(FW_FILE) Then 134 | Call WScript.Echo("There was a problem unzipping the QEMU UEFI firmware.") 135 | Call WScript.Quit(1) 136 | End If 137 | 138 | ' Copy the app file as boot application and run it in QEMU 139 | Call shell.Run("%COMSPEC% /c mkdir ""image\efi\boot""", 0, True) 140 | Call fso.CopyFile(WScript.Arguments(0), "image\efi\boot\" & BOOT_NAME, True) 141 | Call shell.Run("""" & QEMU_PATH & QEMU_EXE & """ " & QEMU_OPTS & " -L . -bios " & FW_FILE & " -hda fat:rw:image", 1, True) 142 | -------------------------------------------------------------------------------- /main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "effy/src/acpi_dump.h" 5 | #include "effy/src/acpi_checksum.h" 6 | #include "effy/src/nstdlib.h" 7 | #include "effy/src/xsdt.h" 8 | #include "effy/src/dirtool.h" 9 | 10 | #define INTEL_PEP_AML_PATH L"DRIPSEnabler\\IntelPEP.aml" 11 | #define LPIT_BIN_PATH L"DRIPSEnabler\\LPIT.bin" 12 | 13 | // Search this drive for a file, load it into the memory and return the buffer. 14 | CHAR8* load_file(CHAR16* path, EFI_HANDLE ImageHandle) 15 | { 16 | CHAR8* buf = NULL; 17 | DIRTOOL_STATE DirToolState; 18 | DirToolState.initialized = 0; 19 | EFI_STATUS status = dirtool_init(&DirToolState, ImageHandle); 20 | if (EFI_ERROR(status)) { 21 | return NULL; 22 | } 23 | 24 | DIRTOOL_DRIVE* drive = dirtool_get_current_drive(&DirToolState, 0); 25 | dirtool_open_drive(&DirToolState, drive); 26 | DIRTOOL_FILE* pwd = dirtool_cd_multi(&(drive->RootFile), path); 27 | if (pwd) 28 | { 29 | buf = dirtool_read_file(pwd); 30 | Print(L"%HFile %s found, file_size=%u%N\n", path, pwd->FileInfo->FileSize); 31 | } 32 | #if defined(_DEBUG) 33 | pause(); 34 | #endif 35 | dirtool_close_drive(&DirToolState, drive); 36 | dirtool_deinit(&DirToolState); 37 | 38 | return buf; 39 | } 40 | 41 | // Application entrypoint (must be set to 'efi_main' for gnu-efi crt0 compatibility) 42 | EFI_STATUS efi_main(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE* SystemTable) 43 | { 44 | #if defined(_GNU_EFI) 45 | InitializeLib(ImageHandle, SystemTable); 46 | #endif 47 | 48 | Print(L"\n%HDRIPSEnabler%N\n"); 49 | Print(L"%Hhttps://github.com/Jamesits/DRIPSEnabler%N\n"); 50 | Print(L"Firmware %s Rev %d\n\n", SystemTable->FirmwareVendor, SystemTable->FirmwareRevision); 51 | 52 | // load file 53 | UINT8 tmp_chksum = 0; 54 | Print(L"%HLoading LPIT from disk, please wait...%N\n"); 55 | EFI_ACPI_DESCRIPTION_HEADER* new_lpit_table_buf = load_file(LPIT_BIN_PATH, ImageHandle); 56 | if (new_lpit_table_buf == NULL) { 57 | Print(L"%EFile not found%N\n"); 58 | return EFI_UNSUPPORTED; 59 | } 60 | tmp_chksum = AcpiChecksum(new_lpit_table_buf, new_lpit_table_buf->Length); 61 | if (tmp_chksum) 62 | { 63 | Print(L"%EChecksum error 0x%x%N\n", tmp_chksum); 64 | return EFI_UNSUPPORTED; 65 | } 66 | Print(L"%HLPIT loaded%N\n"); 67 | 68 | Print(L"%HLoading SSDT from disk, please wait...%N\n"); 69 | EFI_ACPI_DESCRIPTION_HEADER* new_ssdt_table_buf = load_file(INTEL_PEP_AML_PATH, ImageHandle); 70 | if (new_ssdt_table_buf == NULL) { 71 | Print(L"%EFile not found%N\n"); 72 | return EFI_UNSUPPORTED; 73 | } 74 | tmp_chksum = AcpiChecksum(new_ssdt_table_buf, new_ssdt_table_buf->Length); 75 | if (tmp_chksum) 76 | { 77 | Print(L"%EChecksum error 0x%x%N\n", tmp_chksum); 78 | return EFI_UNSUPPORTED; 79 | } 80 | Print(L"%HSSDT loaded%N\n"); 81 | 82 | #if defined(_DEBUG) 83 | pause(); 84 | #endif 85 | 86 | // craft a new LPIT table 87 | EFI_ACPI_DESCRIPTION_HEADER* new_lpit_table = malloc_acpi(new_lpit_table_buf->Length); 88 | if (new_lpit_table == NULL) 89 | { 90 | Print(L"%ELPIT table memory allocation failed%N\n"); 91 | return EFI_OUT_OF_RESOURCES; 92 | } 93 | memcpy8(new_lpit_table, new_lpit_table_buf, new_lpit_table_buf->Length); 94 | memcpy8(new_lpit_table->OemId, (CHAR8*)"YJSNPI", 6); 95 | new_lpit_table->Checksum -= AcpiChecksum(new_lpit_table, new_lpit_table->Length); 96 | Print(L"%ELPIT table: length=%u%N\n", new_lpit_table->Length); 97 | 98 | // craft a new SSDT table 99 | EFI_ACPI_DESCRIPTION_HEADER* new_ssdt_table = malloc_acpi(new_ssdt_table_buf->Length); 100 | if (new_ssdt_table == NULL) 101 | { 102 | Print(L"%ESSDT table memory allocation failed%N\n"); 103 | return EFI_OUT_OF_RESOURCES; 104 | } 105 | memcpy8(new_ssdt_table, new_ssdt_table_buf, new_ssdt_table_buf->Length); 106 | memcpy8(new_ssdt_table->OemId, (CHAR8*)"YJSNPI", 6); 107 | new_ssdt_table->Checksum -= AcpiChecksum(new_ssdt_table, new_ssdt_table->Length); 108 | Print(L"%ESSDT table: length=%u%N\n", new_ssdt_table->Length); 109 | 110 | Print(L"%HTable is crafted%N\n"); 111 | 112 | #if defined(_DEBUG) 113 | pause(); 114 | #endif 115 | 116 | EFI_CONFIGURATION_TABLE* ect = SystemTable->ConfigurationTable; 117 | EFI_GUID AcpiTableGuid = ACPI_TABLE_GUID; 118 | EFI_GUID Acpi2TableGuid = ACPI_20_TABLE_GUID; 119 | EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER* rsdp = NULL; 120 | EFI_ACPI_SDT_HEADER* Xsdt = NULL; 121 | 122 | UINT64 ret = EFI_SUCCESS; 123 | 124 | // locate RSDP (Root System Description Pointer) 125 | for (UINTN SystemTableIndex = 0; SystemTableIndex < SystemTable->NumberOfTableEntries; SystemTableIndex++) 126 | { 127 | Print(L"Table #%d/%d: ", SystemTableIndex + 1, SystemTable->NumberOfTableEntries); 128 | 129 | if (!CompareGuid(&SystemTable->ConfigurationTable[SystemTableIndex].VendorGuid, &AcpiTableGuid) && !CompareGuid( 130 | &SystemTable->ConfigurationTable[SystemTableIndex].VendorGuid, &Acpi2TableGuid)) 131 | { 132 | Print(L"Not ACPI\n"); 133 | goto next_table; 134 | } 135 | 136 | if (strncmp8((unsigned char*)"RSD PTR ", (CHAR8*)ect->VendorTable, 8)) 137 | { 138 | Print(L"Not RSDP\n"); 139 | goto next_table; 140 | } 141 | 142 | rsdp = (EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER*)ect->VendorTable; 143 | Print(L"RSDP Rev %u @0x%x | ", rsdp->Revision, rsdp); 144 | 145 | // check if we have XSDT 146 | if (rsdp->Revision < EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER_REVISION) 147 | { 148 | Print(L"%ENo XSDT\n"); 149 | rsdp = NULL; 150 | goto next_table; 151 | } 152 | 153 | // validate XSDT signature 154 | Xsdt = (EFI_ACPI_SDT_HEADER*)(rsdp->XsdtAddress); 155 | if (strncmp8((CHAR8*)"XSDT", Xsdt->Signature, 4)) 156 | { 157 | Print(L"%EInvalid XSDT\n"); 158 | Xsdt = NULL; 159 | goto next_table; 160 | } 161 | 162 | // yeah we got XSDT! 163 | CHAR16 OemStr[20]; 164 | Ascii2UnicodeStr((CHAR8*)(Xsdt->OemId), OemStr, 6); 165 | UINT32 EntryCount = (Xsdt->Length - sizeof(EFI_ACPI_SDT_HEADER)) / sizeof(UINT64); 166 | Print(L"%HXSDT OEM ID: %s Tables: %d%N\n", OemStr, EntryCount); 167 | 168 | // break if we found the XSDT but there is no BGRT 169 | break; 170 | 171 | next_table: 172 | ect++; 173 | } 174 | 175 | #define NEW_TABLE_COUNT 2 176 | 177 | if (rsdp && Xsdt) // things found, load 2 tables 178 | { 179 | // create new XSDT with 2 more entries 180 | XSDT* newXsdt = malloc_acpi(Xsdt->Length + NEW_TABLE_COUNT * sizeof(UINT64)); 181 | if (newXsdt == NULL) 182 | { 183 | Print(L"%EXSDT table memory allocation failed%N\n"); 184 | return EFI_OUT_OF_RESOURCES; 185 | } 186 | 187 | // copy over old entries 188 | memcpy8((CHAR8*)newXsdt, (CHAR8*)Xsdt, Xsdt->Length); 189 | 190 | // insert entry 191 | newXsdt->Header.Length += NEW_TABLE_COUNT * sizeof(UINT64); 192 | UINT32 EntryCount = (newXsdt->Header.Length - sizeof(EFI_ACPI_SDT_HEADER)) / sizeof(UINT64); 193 | newXsdt->Entry[EntryCount - 2] = (UINT64)new_lpit_table; 194 | newXsdt->Entry[EntryCount - 1] = (UINT64)new_ssdt_table; 195 | 196 | // debug mark; use rweverything (http://rweverything.com/) to look for it under Windows 197 | memcpy8((CHAR8*)&(newXsdt->Header.CreatorId), (CHAR8*)"YJSNPI", 6); 198 | 199 | // re-calculate XSDT checksum 200 | const CHAR8 new_xsdt_checksum_diff = AcpiChecksum((UINT8*)newXsdt, newXsdt->Header.Length); 201 | newXsdt->Header.Checksum -= new_xsdt_checksum_diff; 202 | 203 | // invalidate old XSDT table signature and checksum 204 | memcpy8((CHAR8*)Xsdt, (CHAR8*)"FUCK", 4); 205 | 206 | // replace old XSDT 207 | rsdp->XsdtAddress = (UINT64)newXsdt; 208 | 209 | // re-calculate RSDP extended checksum 210 | const CHAR8 new_rsdt_checksum_diff = AcpiChecksum((UINT8*)rsdp, rsdp->Length); 211 | rsdp->ExtendedChecksum -= new_rsdt_checksum_diff; 212 | 213 | Print(L"%HNew tables inserted%N\n"); 214 | } 215 | else if (rsdp == NULL) 216 | { 217 | Print(L"%EERROR: RSDP is not found%N\n"); 218 | ret = EFI_UNSUPPORTED; 219 | } 220 | else if (Xsdt == NULL) 221 | { 222 | Print(L"%EERROR: XSDT is not found%N\n"); 223 | ret = EFI_UNSUPPORTED; 224 | } 225 | else 226 | { 227 | Print(L"%EError: Something happened%N\n"); 228 | ret = EFI_UNSUPPORTED; 229 | } 230 | 231 | #if defined(_DEBUG) 232 | Print(L"%EDRIPSEnabler done, press any key to continue.%N\n\n"); 233 | 234 | pause(); 235 | 236 | // If running in debug mode, use the EFI shut down call to close QEMU 237 | /*Print(L"%EResetting system%N\n\n"); 238 | SystemTable->RuntimeServices->ResetSystem(EfiResetShutdown, EFI_SUCCESS, 0, NULL);*/ 239 | #else 240 | // if we are running as an EFI driver, then just quit and let other things load 241 | Print(L"%EDRIPSEnabler done%N\n\n"); 242 | #endif 243 | 244 | return ret; 245 | } 246 | 247 | -------------------------------------------------------------------------------- /tables/LPIT/Intel_Haswell_Skylake/LPIT.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jamesits/DRIPSEnabler/74e206b5a92dcb0954bf20466f8a8a8524ef5067/tables/LPIT/Intel_Haswell_Skylake/LPIT.bin -------------------------------------------------------------------------------- /tables/SSDT/Apple/MacBookPro_A1502_ME866LL/IntelPEP.dsl: -------------------------------------------------------------------------------- 1 | DefinitionBlock ("", "SSDT", 1, "APPLE ", "IntelPEP", 0x00001000) 2 | { 3 | Scope (_SB) 4 | { 5 | Device (PEPD) 6 | { 7 | // Intel Power Engine 8 | Name (_HID, "INT33A1" ) 9 | Name (_CID, EisaId ("PNP0D80")) 10 | Name (_UID, 1) 11 | 12 | // Device dependency for uPEP 13 | Name(DEVY, Package() 14 | { 15 | // CPUs (only non-HT cores needed) 16 | Package() {"\\_PR.CPU0", 0x1, Package() {Package() {0xFF, 0}}}, 17 | Package() {"\\_PR.CPU1", 0x1, Package() {Package() {0xFF, 0}}}, 18 | Package() {"\\_PR.CPU2", 0x1, Package() {Package() {0xFF, 0}}}, 19 | Package() {"\\_PR.CPU3", 0x1, Package() {Package() {0xFF, 0}}}, 20 | // iGPU 21 | Package() {"\\_SB.PCI0.IGPU", 0x1, Package() {Package() {0xFF,3}}}, 22 | // XHCI 23 | // Package() {"\\_SB.PCI0.XHC1", 0x1, Package() {Package() {0xFF,3}}}, 24 | // SSD 25 | Package() {"\\_SB.PCI0.RP06", 0x1, Package (0x02) {0x0, Package (0x03) { 0xFF, 0x00, 0x81 }}}, 26 | // BATT, etc. 27 | Package() {"\\_SB.PCI0.RP05", 0x1, Package (0x02) {0x0, Package (0x03) { 0xFF, 0x00, 0x81 }}}, 28 | // Wi-Fi 29 | Package() {"\\_SB.PCI0.RP03", 0x1, Package (0x02) {0x0, Package (0x03) { 0xFF, 0x00, 0x81 }}}, 30 | // Camera 31 | Package() {"\\_SB.PCI0.RP02", 0x0, Package (0x02) {0x0, Package (0x03) { 0xFF, 0x00, 0x81 }}}, 32 | }) 33 | 34 | // BCCD crashdump information 35 | Name (BCCD, Package () 36 | { 37 | Package () 38 | { 39 | "\\_SB.PCI0.RP06", // match your HDD 40 | Package () 41 | { 42 | Package () 43 | { 44 | Package () 45 | { 46 | 0x01, 47 | 0x08, 48 | 0x00, 49 | 0x01, 50 | 0xB2 51 | }, 52 | 53 | Package (0x03) 54 | { 55 | 0x00, 56 | 0xCD, 57 | 0x01 58 | }, 59 | 60 | 0x000186A0 61 | } 62 | } 63 | } 64 | }) 65 | 66 | // Status: we ignore OSI 67 | Method (_STA, 0, NotSerialized) 68 | { 69 | Return (0xf) 70 | } 71 | 72 | // DSM: S0ix information (doesn't need any changes) 73 | Method(_DSM, 0x4, Serialized) 74 | { 75 | If ((Arg0 == ToUUID ("c4eb40a0-6cd2-11e2-bcfd-0800200c9a66"))) 76 | { 77 | // Index 78 | If ((Arg2 == Zero)) 79 | { 80 | Return (Buffer () 81 | { 82 | 0x7F 83 | }) 84 | } 85 | // Device constraints 86 | If ((Arg2 == 0x01)) 87 | { 88 | Return (DEVY) 89 | } 90 | // Crashdump 91 | If ((Arg2 == 0x02)) 92 | { 93 | Return (BCCD) 94 | } 95 | // Display on 96 | If ((Arg2 == 0x03)) {} 97 | // Display off 98 | If ((Arg2 == 0x04)) {} 99 | // Enter S0ix 100 | If ((Arg2 == 0x05)) {} 101 | // Exit S0ix 102 | If ((Arg2 == 0x06)) {} 103 | } 104 | 105 | Return (Buffer (One) 106 | { 107 | 0x00 108 | }) 109 | } 110 | } 111 | } 112 | } -------------------------------------------------------------------------------- /tables/SSDT/Apple/MacBook_A1534_MLHA2LL/IntelPEP.dsl: -------------------------------------------------------------------------------- 1 | DefinitionBlock ("", "SSDT", 1, "APPLE ", "IntelPEP", 0x00001000) 2 | { 3 | Scope (_SB) 4 | { 5 | Device (PEPD) 6 | { 7 | // Intel Power Engine 8 | Name (_HID, "INT33A1" ) 9 | Name (_CID, EisaId ("PNP0D80")) 10 | Name (_UID, 1) 11 | 12 | // Device dependency for uPEP 13 | Name(DEVY, Package() 14 | { 15 | // CPUs 16 | Package() {"\\_PR.CPU0", 0x1, Package() {Package() {0xFF, 0}}}, 17 | Package() {"\\_PR.CPU1", 0x1, Package() {Package() {0xFF, 0}}}, 18 | Package() {"\\_PR.CPU2", 0x1, Package() {Package() {0xFF, 0}}}, 19 | Package() {"\\_PR.CPU3", 0x1, Package() {Package() {0xFF, 0}}}, 20 | // iGPU 21 | Package() {"\\_SB.PCI0.PEG0.GFX0", 0x1, Package() {Package() {0xFF,3}}}, 22 | Package() {"\\_SB.PCI0.IGPU", 0x1, Package() {Package() {0xFF,3}}}, 23 | // UART 24 | Package() {"\\_SB.URT0", 0x1, Package() {Package() {0xFF,3}}}, 25 | Package() {"\\_SB.URT2", 0x1, Package() {Package() {0xFF,3}}}, 26 | // SPI 27 | Package() {"\\_SB.SPI0", 0x1, Package() {Package() {0xFF,3}}}, 28 | Package() {"\\_SB.SPI1", 0x1, Package() {Package() {0xFF,3}}}, 29 | // I2C 30 | Package() {"\\_SB.I2C2", 0x1, Package() {Package() {0xFF,3}}}, 31 | // XHCI 32 | Package() {"\\_SB.PCI0.XHC1", 0x1, Package() {Package() {0xFF,3}}}, 33 | // PCIe Root Bridges 34 | // RP01 is NVMe 35 | Package() 36 | { 37 | "\\_SB.PCI0.RP01", 38 | 0x1, 39 | Package (0x02) 40 | { 41 | 0x0, 42 | Package (0x03) 43 | { 44 | 0xFF, 45 | 0x00, 46 | 0x81 47 | } 48 | } 49 | }, 50 | // RP09 is Wi-Fi 51 | Package() 52 | { 53 | "\\_SB.PCI0.RP09", 54 | 0x1, 55 | Package (0x02) 56 | { 57 | 0x0, 58 | Package (0x03) 59 | { 60 | 0xFF, 61 | 0x00, 62 | 0x81 63 | } 64 | } 65 | }, 66 | // RP10 is Camera 67 | Package() 68 | { 69 | "\\_SB.PCI0.RP10", 70 | 0x0, 71 | Package (0x02) 72 | { 73 | 0x0, 74 | Package (0x03) 75 | { 76 | 0xFF, 77 | 0x00, 78 | 0x81 79 | } 80 | } 81 | }, 82 | }) 83 | 84 | // BCCD crashdump information 85 | Name (BCCD, Package () 86 | { 87 | Package () 88 | { 89 | "\\_SB.PCI0.RP01", 90 | Package () 91 | { 92 | Package () 93 | { 94 | Package () 95 | { 96 | 0x01, 97 | 0x08, 98 | 0x00, 99 | 0x01, 100 | 0xB2 101 | }, 102 | 103 | Package (0x03) 104 | { 105 | 0x00, 106 | 0xCD, 107 | 0x01 108 | }, 109 | 110 | 0x000186A0 111 | } 112 | } 113 | } 114 | }) 115 | 116 | // Status: we ignore OSI 117 | Method (_STA, 0, NotSerialized) 118 | { 119 | Return (0xf) 120 | } 121 | 122 | // DSM: S0ix information 123 | Method(_DSM, 0x4, Serialized) 124 | { 125 | If ((Arg0 == ToUUID ("c4eb40a0-6cd2-11e2-bcfd-0800200c9a66"))) 126 | { 127 | // Index 128 | If ((Arg2 == Zero)) 129 | { 130 | Return (Buffer () 131 | { 132 | 0x7F 133 | }) 134 | } 135 | // Device constraints 136 | If ((Arg2 == 0x01)) 137 | { 138 | Return (DEVY) 139 | } 140 | // Crashdump 141 | If ((Arg2 == 0x02)) 142 | { 143 | Return (BCCD) 144 | } 145 | // Display on 146 | If ((Arg2 == 0x03)) {} 147 | // Display off 148 | If ((Arg2 == 0x04)) {} 149 | // Enter S0ix 150 | If ((Arg2 == 0x05)) {} 151 | // Exit S0ix 152 | If ((Arg2 == 0x06)) {} 153 | } 154 | 155 | Return (Buffer (One) 156 | { 157 | 0x00 158 | }) 159 | } 160 | } 161 | } 162 | } --------------------------------------------------------------------------------