File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ Lilu Changelog
22==============
33#### v1.6.2
44- Fixed KC segment name, which also fixed kernel panic on macOS 13 b3
5+ - Disable EFI64 runtime APIs when ` -legacy ` is used on 32-bit kernels
56
67#### v1.6.1
78- Allow loading on macOS 13 without ` -lilubetaall `
Original file line number Diff line number Diff line change @@ -139,11 +139,18 @@ void EfiRuntimeServices::activate() {
139139 if (efi) {
140140 auto abi = OSDynamicCast (OSData, efi->getProperty (" firmware-abi" ));
141141 if (abi && abi->isEqualTo (" EFI64" , sizeof (" EFI64" ))) {
142- services = new EfiRuntimeServices;
143- services->is32BitEFI = false ;
144- services->setRuntimeServices ();
145-
146142#if defined(__i386__)
143+ // If kernel is forced to pure 32-bit mode, do not load EFI64 services.
144+ if (!checkKernelArgument (" -legacy" )) {
145+ #endif
146+ services = new EfiRuntimeServices;
147+ services->is32BitEFI = false ;
148+ services->setRuntimeServices ();
149+ #if defined(__i386__)
150+ } else {
151+ SYSLOG (" efi" , " EFI64 not supported due to -legacy" );
152+ }
153+
147154 } else if (abi && abi->isEqualTo (" EFI32" , sizeof (" EFI32" ))) {
148155 services = new EfiRuntimeServices;
149156 services->is32BitEFI = true ;
You can’t perform that action at this time.
0 commit comments