Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
d8c59684
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,发现更多精彩内容 >>
未验证
提交
d8c59684
编写于
6月 19, 2020
作者:
Z
zhen-zen
提交者:
GitHub
6月 20, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OcAfterBootCompatLib: Allow specification of max slide for unavailable range (#76)
上级
5d4567c7
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
44 addition
and
2 deletion
+44
-2
Docs/Configuration.tex
Docs/Configuration.tex
+20
-0
Include/Acidanthera/Library/OcAfterBootCompatLib.h
Include/Acidanthera/Library/OcAfterBootCompatLib.h
+4
-0
Include/Acidanthera/Library/OcConfigurationLib.h
Include/Acidanthera/Library/OcConfigurationLib.h
+1
-0
Library/OcAfterBootCompatLib/BootCompatInternal.h
Library/OcAfterBootCompatLib/BootCompatInternal.h
+4
-0
Library/OcAfterBootCompatLib/CustomSlide.c
Library/OcAfterBootCompatLib/CustomSlide.c
+11
-1
Library/OcAfterBootCompatLib/OcAfterBootCompatLib.c
Library/OcAfterBootCompatLib/OcAfterBootCompatLib.c
+2
-1
Library/OcConfigurationLib/OcConfigurationLib.c
Library/OcConfigurationLib/OcConfigurationLib.c
+1
-0
Platform/OpenCore/OpenCoreUefi.c
Platform/OpenCore/OpenCoreUefi.c
+1
-0
未找到文件。
Docs/Configuration.tex
浏览文件 @
d8c59684
...
...
@@ -1459,6 +1459,26 @@ 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,
this option is to be enabled.
\item
\texttt
{
ProvideMaxSlide
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
integer
}
\\
\textbf
{
Failsafe
}
:
\texttt
{
0
}
\\
\textbf
{
Description
}
: Provide maximum KASLR slide when higher ones are unavailable.
This option overrides the maximum slide instead of
\texttt
{
TOTAL
\_
SLIDE
\_
NUM
}
(256) when
\texttt
{
ProvideCustomSlide
}
is enabled. It is believed that modern
firmwares allocate pool memory from top to bottom, effectively resulting in
free memory at the time of slide scanning being later used as temporary
memory during kernel loading. In case those memory are unavailable, this
option can stop evaluating higher slides.
\emph
{
Note
}
: The necessity of this quirk is determined by random boot failure
when
\texttt
{
ProvideCustomSlide
}
is enabled and the randomized slide fall
into the unavailable range. When
\texttt
{
AppleDebug
}
is enabled, usually the
debug log may contain messages like
\texttt
{
AAPL: [EB|`LD:LKC]
\}
Err(0x9)
}
.
To find the optimal value, manually append
\texttt
{
slide=X
}
to
\texttt
{
boot-args
}
and log the largest one that won't cause boot failure.
\item
\texttt
{
RebuildAppleMemoryMap
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
...
...
Include/Acidanthera/Library/OcAfterBootCompatLib.h
浏览文件 @
d8c59684
...
...
@@ -36,6 +36,10 @@ typedef struct OC_ABC_SETTINGS_ {
///
BOOLEAN
ProvideCustomSlide
;
///
/// Provide max KASLR slide for firmwares with polluted higher memory ranges.
///
UINT8
ProvideMaxSlide
;
///
/// Remove runtime flag from MMIO areas and prevent virtual address assignment for known
/// MMIO regions. This may improve the amount of slides available, but may not work on
/// unknown configurations.
...
...
Include/Acidanthera/Library/OcConfigurationLib.h
浏览文件 @
d8c59684
...
...
@@ -124,6 +124,7 @@
_(BOOLEAN , ProtectSecureBoot , , FALSE , ()) \
_(BOOLEAN , ProtectUefiServices , , FALSE , ()) \
_(BOOLEAN , ProvideCustomSlide , , FALSE , ()) \
_(UINT8 , ProvideMaxSlide , , 0 , ()) \
_(BOOLEAN , RebuildAppleMemoryMap , , FALSE , ()) \
_(BOOLEAN , SetupVirtualMap , , FALSE , ()) \
_(BOOLEAN , SignalAppleOS , , FALSE , ()) \
...
...
Library/OcAfterBootCompatLib/BootCompatInternal.h
浏览文件 @
d8c59684
...
...
@@ -300,6 +300,10 @@ typedef struct SLIDE_SUPPORT_STATE_ {
///
UINT32
CsrActiveConfig
;
///
/// Max slide value provided.
///
UINT8
ProvideMaxSlide
;
///
/// Valid slides to choose from when using custom slide.
///
UINT8
ValidSlides
[
TOTAL_SLIDE_NUM
];
...
...
Library/OcAfterBootCompatLib/CustomSlide.c
浏览文件 @
d8c59684
...
...
@@ -91,7 +91,7 @@ GenerateSlideValue (
do
{
DivU64x32Remainder
(
GetPseudoRandomNumber64
(),
SlideSupport
->
ValidSlideCount
,
&
Slide
);
}
while
(
Slide
==
0
);
}
while
(
Slide
Support
->
ValidSlides
[
Slide
]
==
0
);
return
SlideSupport
->
ValidSlides
[
Slide
];
}
...
...
@@ -362,6 +362,14 @@ ShouldUseCustomSlideOffset (
FallbackSlide
=
(
UINT8
)
Slide
;
}
//
// Stop evalutating slides after exceeding ProvideMaxSlide, may break when
// no slides are available.
//
if
(
SlideSupport
->
ProvideMaxSlide
>
0
&&
Slide
>
SlideSupport
->
ProvideMaxSlide
)
{
break
;
}
if
((
StartAddr
+
AvailableSize
)
!=
EndAddr
)
{
//
// The slide region is not continuous.
...
...
@@ -736,6 +744,8 @@ AppleSlideGetVariable (
OUT
VOID
*
Data
)
{
BootCompat
->
SlideSupport
.
ProvideMaxSlide
=
BootCompat
->
Settings
.
ProvideMaxSlide
;
if
(
VariableName
!=
NULL
&&
VendorGuid
!=
NULL
&&
DataSize
!=
NULL
&&
CompareGuid
(
VendorGuid
,
&
gAppleBootVariableGuid
))
{
...
...
Library/OcAfterBootCompatLib/OcAfterBootCompatLib.c
浏览文件 @
d8c59684
...
...
@@ -124,10 +124,11 @@ OcAbcInitialize (
DEBUG
((
DEBUG_INFO
,
"OCABC: FEXITBS %d PRMRG %d CSLIDE %d PRSRV %d RBMAP %d VMAP %d APPLOS %d RTPERMS %d
\n
"
,
"OCABC: FEXITBS %d PRMRG %d CSLIDE %d
MSLIDE %d
PRSRV %d RBMAP %d VMAP %d APPLOS %d RTPERMS %d
\n
"
,
Settings
->
ForceExitBootServices
,
Settings
->
ProtectMemoryRegions
,
Settings
->
ProvideCustomSlide
,
Settings
->
ProvideMaxSlide
,
Settings
->
ProtectUefiServices
,
Settings
->
RebuildAppleMemoryMap
,
Settings
->
SetupVirtualMap
,
...
...
Library/OcConfigurationLib/OcConfigurationLib.c
浏览文件 @
d8c59684
...
...
@@ -179,6 +179,7 @@ mBooterQuirksSchema[] = {
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
(
"ProvideCustomSlide"
,
OC_GLOBAL_CONFIG
,
Booter
.
Quirks
.
ProvideCustomSlide
),
OC_SCHEMA_INTEGER_IN
(
"ProvideMaxSlide"
,
OC_GLOBAL_CONFIG
,
Booter
.
Quirks
.
ProvideMaxSlide
),
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
(
"SignalAppleOS"
,
OC_GLOBAL_CONFIG
,
Booter
.
Quirks
.
SignalAppleOS
),
...
...
Platform/OpenCore/OpenCoreUefi.c
浏览文件 @
d8c59684
...
...
@@ -373,6 +373,7 @@ OcLoadBooterUefiSupport (
AbcSettings
.
ForceExitBootServices
=
Config
->
Booter
.
Quirks
.
ForceExitBootServices
;
AbcSettings
.
ProtectMemoryRegions
=
Config
->
Booter
.
Quirks
.
ProtectMemoryRegions
;
AbcSettings
.
ProvideCustomSlide
=
Config
->
Booter
.
Quirks
.
ProvideCustomSlide
;
AbcSettings
.
ProvideMaxSlide
=
Config
->
Booter
.
Quirks
.
ProvideMaxSlide
;
AbcSettings
.
ProtectUefiServices
=
Config
->
Booter
.
Quirks
.
ProtectUefiServices
;
AbcSettings
.
RebuildAppleMemoryMap
=
Config
->
Booter
.
Quirks
.
RebuildAppleMemoryMap
;
AbcSettings
.
SetupVirtualMap
=
Config
->
Booter
.
Quirks
.
SetupVirtualMap
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录