Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
bd17802d
O
OpenCorePKG_MOD
项目概览
btwise
/
OpenCorePKG_MOD
通知
26
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
OpenCorePKG_MOD
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bd17802d
编写于
4月 03, 2020
作者:
V
vit9696
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OcAppleBootCompatLib: Implement RebuildAppleMemoryMap
上级
6f0a8a1a
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
161 addition
and
43 deletion
+161
-43
Changelog.md
Changelog.md
+3
-0
Docs/Configuration.pdf
Docs/Configuration.pdf
+0
-0
Docs/Configuration.tex
Docs/Configuration.tex
+43
-16
Docs/Differences/Differences.pdf
Docs/Differences/Differences.pdf
+0
-0
Docs/Differences/Differences.tex
Docs/Differences/Differences.tex
+81
-15
Docs/Sample.plist
Docs/Sample.plist
+2
-2
Docs/SampleFull.plist
Docs/SampleFull.plist
+2
-2
Include/Library/OcAppleBootCompatLib.h
Include/Library/OcAppleBootCompatLib.h
+4
-2
Include/Library/OcConfigurationLib.h
Include/Library/OcConfigurationLib.h
+1
-1
Library/OcAppleBootCompatLib/OcAppleBootCompatLib.c
Library/OcAppleBootCompatLib/OcAppleBootCompatLib.c
+2
-2
Library/OcAppleBootCompatLib/ServiceOverrides.c
Library/OcAppleBootCompatLib/ServiceOverrides.c
+21
-1
Library/OcConfigurationLib/OcConfigurationLib.c
Library/OcConfigurationLib/OcConfigurationLib.c
+1
-1
Platform/OpenCore/OpenCoreUefi.c
Platform/OpenCore/OpenCoreUefi.c
+1
-1
未找到文件。
Changelog.md
浏览文件 @
bd17802d
...
@@ -21,6 +21,9 @@ OpenCore Changelog
...
@@ -21,6 +21,9 @@ OpenCore Changelog
-
Fixed
`PowerTimeoutKernelPanic`
on 10.15.4
-
Fixed
`PowerTimeoutKernelPanic`
on 10.15.4
-
Fixed 4K section alignment in
`OpenRuntime`
to fix Linux booting on SKL
-
Fixed 4K section alignment in
`OpenRuntime`
to fix Linux booting on SKL
-
Introduced
`SyncRuntimePermissions`
to fix Linux booting on CFL+
-
Introduced
`SyncRuntimePermissions`
to fix Linux booting on CFL+
-
Introduced
`RebuildAppleMemoryMap`
to fix macOS booting on Dell 5490
-
Removed
`ShrinkMemoryMap`
in favour of more advanced
`RebuildAppleMemoryMap`
-
Marked
`EnableWriteUnprotector`
as deprecated on new systems (SKL+)
#### v0.5.6
#### v0.5.6
-
Various improvements to builtin text renderer
-
Various improvements to builtin text renderer
...
...
Docs/Configuration.pdf
浏览文件 @
bd17802d
无法预览此类型文件
Docs/Configuration.tex
浏览文件 @
bd17802d
...
@@ -1293,8 +1293,8 @@ To view their current state use \texttt{pmset -g} command in Terminal.
...
@@ -1293,8 +1293,8 @@ To view their current state use \texttt{pmset -g} command in Terminal.
register during their execution. This quirk requires
\texttt
{
OC
\_
FIRMWARE
\_
RUNTIME
}
register during their execution. This quirk requires
\texttt
{
OC
\_
FIRMWARE
\_
RUNTIME
}
protocol implemented in
\texttt
{
OpenRuntime.efi
}
.
protocol implemented in
\texttt
{
OpenRuntime.efi
}
.
\emph
{
Note
}
: Th
e necessity of this quirk is determined by early boot crashes
\emph
{
Note
}
: Th
is quirk may potentially weaken firmware security, please use
of the firmware
.
\texttt
{
RebuildAppleMemoryMap
}
instead unless it fails for you
.
\item
\item
\texttt
{
ForceExitBootServices
}
\\
\texttt
{
ForceExitBootServices
}
\\
...
@@ -1366,6 +1366,35 @@ To view their current state use \texttt{pmset -g} command in Terminal.
...
@@ -1366,6 +1366,35 @@ To view their current state use \texttt{pmset -g} command in Terminal.
slide values are usable!
}
message in the debug log. If the message is present,
slide values are usable!
}
message in the debug log. If the message is present,
this option is to be enabled.
this option is to be enabled.
\item
\texttt
{
RebuildAppleMemoryMap
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
\textbf
{
Failsafe
}
:
\texttt
{
false
}
\\
\textbf
{
Description
}
: Generate Memory Map compatible with macOS.
Apple kernel has several limitations in parsing UEFI memory map:
\begin{itemize}
\tightlist
\item
Memory map size must not exceed 4096 bytes as Apple kernel maps
it as a single 4K page. Since some firmwares have very large memory maps
(approximately over 100 entries) Apple kernel will crash at boot.
\item
Memory attributes table is ignored.
\texttt
{
EfiRuntimeServicesCode
}
memory statically gets
\texttt
{
RX
}
permissions, and all other memory types
get
\texttt
{
RW
}
permissions. Since some firmware drivers may write to global
variables at runtime, Apple kernel will crash at calling UEFI runtime services,
unless driver
\texttt
{
.data
}
section has
\texttt
{
EfiRuntimeServicesData
}
type.
\end{itemize}
To workaround these limitations this quirk applies memory attributes table
permissions to memory map passed to Apple kernel and optionally attempts
to unify contiguous slots of similar types if the resulting memory map exceeds
4 KB.
\emph
{
Note
}
: The necessity of this quirk is determined by early boot failures.
This quirk replaces
\texttt
{
EnableWriteUnprotector
}
on most platforms.
\item
\item
\texttt
{
SetupVirtualMap
}
\\
\texttt
{
SetupVirtualMap
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
...
@@ -1381,20 +1410,6 @@ To view their current state use \texttt{pmset -g} command in Terminal.
...
@@ -1381,20 +1410,6 @@ To view their current state use \texttt{pmset -g} command in Terminal.
new firmwares with memory protection support (like OVMF) do not support this quirk due to
new firmwares with memory protection support (like OVMF) do not support this quirk due to
\href
{
https://github.com/acidanthera/bugtracker/issues/719
}{
acidanthera/bugtracker
\#
719
}
.
\href
{
https://github.com/acidanthera/bugtracker/issues/719
}{
acidanthera/bugtracker
\#
719
}
.
\item
\texttt
{
ShrinkMemoryMap
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
\textbf
{
Failsafe
}
:
\texttt
{
false
}
\\
\textbf
{
Description
}
: Attempt to join similar memory map entries.
Select firmwares have very large memory maps, which do not fit into a single 4 KB
page, which is a requirement for Apple kernel. This quirk attempts to unify
contiguous slots of similar types to prevent boot failures.
\emph
{
Note
}
: The necessity of this quirk is determined by early boot failures.
It is rare to need this quirk on Haswell or newer. Do not use unless you fully
understand the consequences.
\item
\item
\texttt
{
SignalAppleOS
}
\\
\texttt
{
SignalAppleOS
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
...
@@ -1405,6 +1420,18 @@ To view their current state use \texttt{pmset -g} command in Terminal.
...
@@ -1405,6 +1420,18 @@ To view their current state use \texttt{pmset -g} command in Terminal.
For example, it is supposed to enable Intel GPU in Windows and Linux in some
For example, it is supposed to enable Intel GPU in Windows and Linux in some
dual-GPU MacBook models.
dual-GPU MacBook models.
\item
\texttt
{
SyncRuntimePermissions
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
\textbf
{
Failsafe
}
:
\texttt
{
false
}
\\
\textbf
{
Description
}
: Update memory permissions for
\texttt
{
OpenRuntime
}
to function.
Some firmwares may incorrectly mark
\texttt
{
OpenRuntime
}
as not executable, this quirks
updates memory map and memory attributes table to correct this.
\emph
{
Note
}
: The necessity of this quirk is determined by early boot failures either in
macOS or in Linux/Windows. In general only firmwares released in 2018 or later are affected.
\end{enumerate}
\end{enumerate}
\section
{
DeviceProperties
}
\label
{
devprops
}
\section
{
DeviceProperties
}
\label
{
devprops
}
...
...
Docs/Differences/Differences.pdf
浏览文件 @
bd17802d
无法预览此类型文件
Docs/Differences/Differences.tex
浏览文件 @
bd17802d
\documentclass
[]
{
article
}
\documentclass
[]
{
article
}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL PreviousConfiguration.tex Fri Mar 6 09:43:05 2020
%DIF DEL PreviousConfiguration.tex Fri Mar 6 09:43:05 2020
%DIF ADD ../Configuration.tex
Thu Apr 2 21:22:4
6 2020
%DIF ADD ../Configuration.tex
Fri Apr 3 14:10:5
6 2020
\usepackage
{
lmodern
}
\usepackage
{
lmodern
}
\usepackage
{
amssymb,amsmath
}
\usepackage
{
amssymb,amsmath
}
...
@@ -1358,8 +1358,9 @@ To view their current state use \texttt{pmset -g} command in Terminal.
...
@@ -1358,8 +1358,9 @@ To view their current state use \texttt{pmset -g} command in Terminal.
register during their execution. This quirk requires
\texttt
{
OC
\_
FIRMWARE
\_
RUNTIME
}
register during their execution. This quirk requires
\texttt
{
OC
\_
FIRMWARE
\_
RUNTIME
}
protocol implemented in
\texttt
{
\DIFdelbegin
\DIFdel
{
FwRuntimeServices
}
\DIFdelend
\DIFaddbegin
\DIFadd
{
OpenRuntime
}
\DIFaddend
.efi
}
.
protocol implemented in
\texttt
{
\DIFdelbegin
\DIFdel
{
FwRuntimeServices
}
\DIFdelend
\DIFaddbegin
\DIFadd
{
OpenRuntime
}
\DIFaddend
.efi
}
.
\emph
{
Note
}
: The necessity of this quirk is determined by early boot crashes
\emph
{
Note
}
:
\DIFdelbegin
\DIFdel
{
The necessity of this quirk is determined by early boot crashes
of the firmware.
of the firmware
}
\DIFdelend
\DIFaddbegin
\DIFadd
{
This quirk may potentially weaken firmware security, please use
}
\texttt
{
\DIFadd
{
RebuildAppleMemoryMap
}}
\DIFadd
{
instead unless it fails for you
}
\DIFaddend
.
\item
\item
\texttt
{
ForceExitBootServices
}
\\
\texttt
{
ForceExitBootServices
}
\\
...
@@ -1435,7 +1436,40 @@ To view their current state use \texttt{pmset -g} command in Terminal.
...
@@ -1435,7 +1436,40 @@ To view their current state use \texttt{pmset -g} command in Terminal.
this option is to be enabled.
this option is to be enabled.
\item
\item
\texttt
{
SetupVirtualMap
}
\\
\DIFaddbegin
\texttt
{
\DIFadd
{
RebuildAppleMemoryMap
}}
\\
\textbf
{
\DIFadd
{
Type
}}
\DIFadd
{
:
}
\texttt
{
\DIFadd
{
plist
\
boolean
}}
\\
\textbf
{
\DIFadd
{
Failsafe
}}
\DIFadd
{
:
}
\texttt
{
\DIFadd
{
false
}}
\\
\textbf
{
\DIFadd
{
Description
}}
\DIFadd
{
: Generate Memory Map compatible with macOS.
}
\DIFadd
{
Apple kernel has several limitations in parsing UEFI memory map:
}
\begin{itemize}
\tightlist
\item
\DIFadd
{
Memory map size must not exceed 4096 bytes as Apple kernel maps
it as a single 4K page. Since some firmwares have very large memory maps
(approximately over 100 entries) Apple kernel will crash at boot.
}
\item
\DIFadd
{
Memory attributes table is ignored.
}
\texttt
{
\DIFadd
{
EfiRuntimeServicesCode
}}
\DIFadd
{
memory statically gets
}
\texttt
{
\DIFadd
{
RX
}}
\DIFadd
{
permissions, and all other memory types
get
}
\texttt
{
\DIFadd
{
RW
}}
\DIFadd
{
permissions. Since some firmware drivers may write to global
variables at runtime, Apple kernel will crash at calling UEFI runtime services,
unless driver
}
\texttt
{
\DIFadd
{
.data
}}
\DIFadd
{
section has
}
\texttt
{
\DIFadd
{
EfiRuntimeServicesData
}}
\DIFadd
{
type.
}
\end{itemize}
\DIFadd
{
To workaround these limitations this quirk applies memory attributes table
permissions to memory map passed to Apple kernel and optionally attempts
to unify contiguous slots of similar types if the resulting memory map exceeds
4 KB.
}
\emph
{
\DIFadd
{
Note
}}
\DIFadd
{
: The necessity of this quirk is determined by early boot failures.
This quirk replaces
}
\texttt
{
\DIFadd
{
EnableWriteUnprotector
}}
\DIFadd
{
on most platforms.
}
\item
\DIFaddend
\texttt
{
SetupVirtualMap
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
\textbf
{
Failsafe
}
:
\texttt
{
false
}
\\
\textbf
{
Failsafe
}
:
\texttt
{
false
}
\\
\textbf
{
Description
}
: Setup virtual memory at
\texttt
{
SetVirtualAddresses
}
.
\textbf
{
Description
}
: Setup virtual memory at
\texttt
{
SetVirtualAddresses
}
.
...
@@ -1450,22 +1484,39 @@ To view their current state use \texttt{pmset -g} command in Terminal.
...
@@ -1450,22 +1484,39 @@ To view their current state use \texttt{pmset -g} command in Terminal.
\href
{
https://github.com/acidanthera/bugtracker/issues/719
}{
acidanthera/bugtracker
\#
719
}
.
\href
{
https://github.com/acidanthera/bugtracker/issues/719
}{
acidanthera/bugtracker
\#
719
}
.
\item
\item
\texttt
{
ShrinkMemoryMap
}
\\
\DIFdelbegin
\texttt
{
\DIFdel
{
ShrinkMemoryMap
}}
%DIFAUXCMD
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
%DIFDELCMD < \\
\textbf
{
Failsafe
}
:
\texttt
{
false
}
\\
%DIFDELCMD < %%%
\textbf
{
Description
}
: Attempt to join similar memory map entries.
\textbf
{
\DIFdel
{
Type
}}
%DIFAUXCMD
\DIFdel
{
:
}
\texttt
{
\DIFdel
{
plist
\
boolean
}}
%DIFAUXCMD
%DIFDELCMD < \\
%DIFDELCMD < %%%
\textbf
{
\DIFdel
{
Failsafe
}}
%DIFAUXCMD
\DIFdel
{
:
}
\texttt
{
\DIFdel
{
false
}}
%DIFAUXCMD
%DIFDELCMD < \\
%DIFDELCMD < %%%
\textbf
{
\DIFdel
{
Description
}}
%DIFAUXCMD
\DIFdel
{
: Attempt to join similar memory map entries.
}
%DIFDELCMD <
Select firmwares have very large memory maps, which do not fit
\DIFdelbegin
\DIFdel
{
Apple kernel, permitting up to
}
\texttt
{
\DIFdel
{
64
}}
%DIFAUXCMD
%DIFDELCMD < %%%
\DIFdel
{
slots for runtime memory
}
\DIFdelend
\DIFaddbegin
\DIFadd
{
into a single 4 KB
\DIFdel
{
Select firmwares have very large memory maps, which do not fit Apple kernel,
page, which is a requirement for Apple kernel
}
\DIFaddend
. This quirk attempts to unify
permitting up to
}
\texttt
{
\DIFdel
{
64
}}
%DIFAUXCMD
\DIFdel
{
slots for runtime memory. This quirk attempts to unify
contiguous slots of similar types to prevent boot failures.
contiguous slots of similar types to prevent boot failures.
}
%DIFDELCMD <
\emph
{
Note
}
: The necessity of this quirk is determined by early boot failures.
%DIFDELCMD < %%%
\emph
{
\DIFdel
{
Note
}}
%DIFAUXCMD
\DIFdel
{
: The necessity of this quirk is determined by early boot failures.
It is rare to need this quirk on Haswell or newer. Do not use unless you fully
It is rare to need this quirk on Haswell or newer. Do not use unless you fully
understand the consequences.
understand the consequences.
}
%DIFDELCMD <
\item
%DIFDELCMD < \item
\texttt
{
SignalAppleOS
}
\\
\item
%DIFAUXCMD
%DIFDELCMD < %%%
\DIFdelend
\texttt
{
SignalAppleOS
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
\textbf
{
Failsafe
}
:
\texttt
{
false
}
\\
\textbf
{
Failsafe
}
:
\texttt
{
false
}
\\
\textbf
{
Description
}
: Report macOS being loaded through OS Info for any OS.
\textbf
{
Description
}
: Report macOS being loaded through OS Info for any OS.
...
@@ -1474,7 +1525,22 @@ To view their current state use \texttt{pmset -g} command in Terminal.
...
@@ -1474,7 +1525,22 @@ To view their current state use \texttt{pmset -g} command in Terminal.
For example, it is supposed to enable Intel GPU in Windows and Linux in some
For example, it is supposed to enable Intel GPU in Windows and Linux in some
dual-GPU MacBook models.
dual-GPU MacBook models.
\end{enumerate}
\DIFaddbegin
\item
\texttt
{
\DIFadd
{
SyncRuntimePermissions
}}
\\
\textbf
{
\DIFadd
{
Type
}}
\DIFadd
{
:
}
\texttt
{
\DIFadd
{
plist
\
boolean
}}
\\
\textbf
{
\DIFadd
{
Failsafe
}}
\DIFadd
{
:
}
\texttt
{
\DIFadd
{
false
}}
\\
\textbf
{
\DIFadd
{
Description
}}
\DIFadd
{
: Update memory permissions for
}
\texttt
{
\DIFadd
{
OpenRuntime
}}
\DIFadd
{
to function.
}
\DIFadd
{
Some firmwares may incorrectly mark
}
\texttt
{
\DIFadd
{
OpenRuntime
}}
\DIFadd
{
as not executable, this quirks
updates memory map and memory attributes table to correct this.
}
\emph
{
\DIFadd
{
Note
}}
\DIFadd
{
: The necessity of this quirk is determined by early boot failures either in
macOS or in Linux/Windows. In general only firmwares released in 2018 or later are affected.
}
\DIFaddend
\end{enumerate}
\section
{
DeviceProperties
}
\label
{
devprops
}
\section
{
DeviceProperties
}
\label
{
devprops
}
...
...
Docs/Sample.plist
浏览文件 @
bd17802d
...
@@ -260,10 +260,10 @@
...
@@ -260,10 +260,10 @@
<false/>
<false/>
<key>
ProvideCustomSlide
</key>
<key>
ProvideCustomSlide
</key>
<true/>
<true/>
<key>
RebuildAppleMemoryMap
</key>
<false/>
<key>
SetupVirtualMap
</key>
<key>
SetupVirtualMap
</key>
<true/>
<true/>
<key>
ShrinkMemoryMap
</key>
<false/>
<key>
SignalAppleOS
</key>
<key>
SignalAppleOS
</key>
<false/>
<false/>
<key>
SyncRuntimePermissions
</key>
<key>
SyncRuntimePermissions
</key>
...
...
Docs/SampleFull.plist
浏览文件 @
bd17802d
...
@@ -260,10 +260,10 @@
...
@@ -260,10 +260,10 @@
<false/>
<false/>
<key>
ProvideCustomSlide
</key>
<key>
ProvideCustomSlide
</key>
<true/>
<true/>
<key>
RebuildAppleMemoryMap
</key>
<false/>
<key>
SetupVirtualMap
</key>
<key>
SetupVirtualMap
</key>
<true/>
<true/>
<key>
ShrinkMemoryMap
</key>
<false/>
<key>
SignalAppleOS
</key>
<key>
SignalAppleOS
</key>
<false/>
<false/>
<key>
SyncRuntimePermissions
</key>
<key>
SyncRuntimePermissions
</key>
...
...
Include/Library/OcAppleBootCompatLib.h
浏览文件 @
bd17802d
...
@@ -60,9 +60,11 @@ typedef struct OC_ABC_SETTINGS_ {
...
@@ -60,9 +60,11 @@ typedef struct OC_ABC_SETTINGS_ {
///
///
BOOLEAN
ProtectCsmRegion
;
BOOLEAN
ProtectCsmRegion
;
///
///
/// Attempt to reduce memory map entries through grouping to fit into Apple kernel.
/// Rebuild memory map to be compatible with Apple kernel.
/// - Apply memory attributes and split RT entries into code and data.
/// - Reduce memory map entries through grouping to fit into 4KB.
///
///
BOOLEAN
Shrink
MemoryMap
;
BOOLEAN
RebuildApple
MemoryMap
;
///
///
/// Ensure that ExitBootServices call succeeds even with outdated MemoryMap key.
/// Ensure that ExitBootServices call succeeds even with outdated MemoryMap key.
///
///
...
...
Include/Library/OcConfigurationLib.h
浏览文件 @
bd17802d
...
@@ -124,8 +124,8 @@
...
@@ -124,8 +124,8 @@
_(BOOLEAN , ProtectSecureBoot , , FALSE , ()) \
_(BOOLEAN , ProtectSecureBoot , , FALSE , ()) \
_(BOOLEAN , ProtectUefiServices , , FALSE , ()) \
_(BOOLEAN , ProtectUefiServices , , FALSE , ()) \
_(BOOLEAN , ProvideCustomSlide , , FALSE , ()) \
_(BOOLEAN , ProvideCustomSlide , , FALSE , ()) \
_(BOOLEAN , RebuildAppleMemoryMap , , FALSE , ()) \
_(BOOLEAN , SetupVirtualMap , , FALSE , ()) \
_(BOOLEAN , SetupVirtualMap , , FALSE , ()) \
_(BOOLEAN , ShrinkMemoryMap , , FALSE , ()) \
_(BOOLEAN , SignalAppleOS , , FALSE , ()) \
_(BOOLEAN , SignalAppleOS , , FALSE , ()) \
_(BOOLEAN , SyncRuntimePermissions , , FALSE , ())
_(BOOLEAN , SyncRuntimePermissions , , FALSE , ())
OC_DECLARE
(
OC_BOOTER_QUIRKS
)
OC_DECLARE
(
OC_BOOTER_QUIRKS
)
...
...
Library/OcAppleBootCompatLib/OcAppleBootCompatLib.c
浏览文件 @
bd17802d
...
@@ -124,13 +124,13 @@ OcAbcInitialize (
...
@@ -124,13 +124,13 @@ OcAbcInitialize (
DEBUG
((
DEBUG
((
DEBUG_INFO
,
DEBUG_INFO
,
"OCABC: FEXITBS %d PRCSM %d CSLIDE %d PRSRV %d
VMAP %d SHR
MAP %d APPLOS %d RTPERMS %d
\n
"
,
"OCABC: FEXITBS %d PRCSM %d CSLIDE %d PRSRV %d
RBMAP %d V
MAP %d APPLOS %d RTPERMS %d
\n
"
,
Settings
->
ForceExitBootServices
,
Settings
->
ForceExitBootServices
,
Settings
->
ProtectCsmRegion
,
Settings
->
ProtectCsmRegion
,
Settings
->
ProvideCustomSlide
,
Settings
->
ProvideCustomSlide
,
Settings
->
ProtectUefiServices
,
Settings
->
ProtectUefiServices
,
Settings
->
RebuildAppleMemoryMap
,
Settings
->
SetupVirtualMap
,
Settings
->
SetupVirtualMap
,
Settings
->
ShrinkMemoryMap
,
Settings
->
SignalAppleOS
,
Settings
->
SignalAppleOS
,
Settings
->
SyncRuntimePermissions
Settings
->
SyncRuntimePermissions
));
));
...
...
Library/OcAppleBootCompatLib/ServiceOverrides.c
浏览文件 @
bd17802d
...
@@ -362,9 +362,11 @@ OcGetMemoryMap (
...
@@ -362,9 +362,11 @@ OcGetMemoryMap (
BOOT_COMPAT_CONTEXT
*
BootCompat
;
BOOT_COMPAT_CONTEXT
*
BootCompat
;
EFI_PHYSICAL_ADDRESS
Address
;
EFI_PHYSICAL_ADDRESS
Address
;
UINTN
Pages
;
UINTN
Pages
;
UINTN
OriginalSize
;
BootCompat
=
GetBootCompatContext
();
BootCompat
=
GetBootCompatContext
();
OriginalSize
=
MemoryMapSize
!=
0
?
*
MemoryMapSize
:
0
;
Status
=
BootCompat
->
ServicePtrs
.
GetMemoryMap
(
Status
=
BootCompat
->
ServicePtrs
.
GetMemoryMap
(
MemoryMapSize
,
MemoryMapSize
,
MemoryMap
,
MemoryMap
,
...
@@ -373,6 +375,14 @@ OcGetMemoryMap (
...
@@ -373,6 +375,14 @@ OcGetMemoryMap (
DescriptorVersion
DescriptorVersion
);
);
//
// Reserve larger area for the memory map when we need to split it.
//
if
(
BootCompat
->
ServiceState
.
AppleBootNestedCount
>
0
&&
Status
==
EFI_BUFFER_TOO_SMALL
)
{
*
MemoryMapSize
+=
OcCountSplitDescritptors
()
*
*
DescriptorSize
;
return
EFI_BUFFER_TOO_SMALL
;
}
if
(
EFI_ERROR
(
Status
))
{
if
(
EFI_ERROR
(
Status
))
{
return
Status
;
return
Status
;
}
}
...
@@ -411,7 +421,17 @@ OcGetMemoryMap (
...
@@ -411,7 +421,17 @@ OcGetMemoryMap (
);
);
}
}
if
(
BootCompat
->
Settings
.
ShrinkMemoryMap
)
{
if
(
BootCompat
->
Settings
.
RebuildAppleMemoryMap
)
{
Status2
=
OcSplitMemoryMapByAttributes
(
OriginalSize
,
MemoryMapSize
,
MemoryMap
,
*
DescriptorSize
);
if
(
EFI_ERROR
(
Status2
)
&&
Status
!=
EFI_UNSUPPORTED
)
{
DEBUG
((
DEBUG_INFO
,
"OCABC: Cannot rebuild memory map - %r
\n
"
,
Status
));
}
ShrinkMemoryMap
(
ShrinkMemoryMap
(
MemoryMapSize
,
MemoryMapSize
,
MemoryMap
,
MemoryMap
,
...
...
Library/OcConfigurationLib/OcConfigurationLib.c
浏览文件 @
bd17802d
...
@@ -176,8 +176,8 @@ mBooterQuirksSchema[] = {
...
@@ -176,8 +176,8 @@ mBooterQuirksSchema[] = {
OC_SCHEMA_BOOLEAN_IN
(
"ProtectSecureBoot"
,
OC_GLOBAL_CONFIG
,
Booter
.
Quirks
.
ProtectSecureBoot
),
OC_SCHEMA_BOOLEAN_IN
(
"ProtectSecureBoot"
,
OC_GLOBAL_CONFIG
,
Booter
.
Quirks
.
ProtectSecureBoot
),
OC_SCHEMA_BOOLEAN_IN
(
"ProtectUefiServices"
,
OC_GLOBAL_CONFIG
,
Booter
.
Quirks
.
ProtectUefiServices
),
OC_SCHEMA_BOOLEAN_IN
(
"ProtectUefiServices"
,
OC_GLOBAL_CONFIG
,
Booter
.
Quirks
.
ProtectUefiServices
),
OC_SCHEMA_BOOLEAN_IN
(
"ProvideCustomSlide"
,
OC_GLOBAL_CONFIG
,
Booter
.
Quirks
.
ProvideCustomSlide
),
OC_SCHEMA_BOOLEAN_IN
(
"ProvideCustomSlide"
,
OC_GLOBAL_CONFIG
,
Booter
.
Quirks
.
ProvideCustomSlide
),
OC_SCHEMA_BOOLEAN_IN
(
"RebuildAppleMemoryMap"
,
OC_GLOBAL_CONFIG
,
Booter
.
Quirks
.
RebuildAppleMemoryMap
),
OC_SCHEMA_BOOLEAN_IN
(
"SetupVirtualMap"
,
OC_GLOBAL_CONFIG
,
Booter
.
Quirks
.
SetupVirtualMap
),
OC_SCHEMA_BOOLEAN_IN
(
"SetupVirtualMap"
,
OC_GLOBAL_CONFIG
,
Booter
.
Quirks
.
SetupVirtualMap
),
OC_SCHEMA_BOOLEAN_IN
(
"ShrinkMemoryMap"
,
OC_GLOBAL_CONFIG
,
Booter
.
Quirks
.
ShrinkMemoryMap
),
OC_SCHEMA_BOOLEAN_IN
(
"SignalAppleOS"
,
OC_GLOBAL_CONFIG
,
Booter
.
Quirks
.
SignalAppleOS
),
OC_SCHEMA_BOOLEAN_IN
(
"SignalAppleOS"
,
OC_GLOBAL_CONFIG
,
Booter
.
Quirks
.
SignalAppleOS
),
OC_SCHEMA_BOOLEAN_IN
(
"SyncRuntimePermissions"
,
OC_GLOBAL_CONFIG
,
Booter
.
Quirks
.
SyncRuntimePermissions
),
OC_SCHEMA_BOOLEAN_IN
(
"SyncRuntimePermissions"
,
OC_GLOBAL_CONFIG
,
Booter
.
Quirks
.
SyncRuntimePermissions
),
};
};
...
...
Platform/OpenCore/OpenCoreUefi.c
浏览文件 @
bd17802d
...
@@ -363,8 +363,8 @@ OcLoadBooterUefiSupport (
...
@@ -363,8 +363,8 @@ OcLoadBooterUefiSupport (
AbcSettings
.
ProtectCsmRegion
=
Config
->
Booter
.
Quirks
.
ProtectCsmRegion
;
AbcSettings
.
ProtectCsmRegion
=
Config
->
Booter
.
Quirks
.
ProtectCsmRegion
;
AbcSettings
.
ProvideCustomSlide
=
Config
->
Booter
.
Quirks
.
ProvideCustomSlide
;
AbcSettings
.
ProvideCustomSlide
=
Config
->
Booter
.
Quirks
.
ProvideCustomSlide
;
AbcSettings
.
ProtectUefiServices
=
Config
->
Booter
.
Quirks
.
ProtectUefiServices
;
AbcSettings
.
ProtectUefiServices
=
Config
->
Booter
.
Quirks
.
ProtectUefiServices
;
AbcSettings
.
RebuildAppleMemoryMap
=
Config
->
Booter
.
Quirks
.
RebuildAppleMemoryMap
;
AbcSettings
.
SetupVirtualMap
=
Config
->
Booter
.
Quirks
.
SetupVirtualMap
;
AbcSettings
.
SetupVirtualMap
=
Config
->
Booter
.
Quirks
.
SetupVirtualMap
;
AbcSettings
.
ShrinkMemoryMap
=
Config
->
Booter
.
Quirks
.
ShrinkMemoryMap
;
AbcSettings
.
SignalAppleOS
=
Config
->
Booter
.
Quirks
.
SignalAppleOS
;
AbcSettings
.
SignalAppleOS
=
Config
->
Booter
.
Quirks
.
SignalAppleOS
;
AbcSettings
.
SyncRuntimePermissions
=
Config
->
Booter
.
Quirks
.
SyncRuntimePermissions
;
AbcSettings
.
SyncRuntimePermissions
=
Config
->
Booter
.
Quirks
.
SyncRuntimePermissions
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录