Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
f545a348
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,发现更多精彩内容 >>
提交
f545a348
编写于
8月 19, 2020
作者:
G
Goldfish64
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OpenCoreKernel: Block cache types via ForceKernelCache option
上级
5ea680a0
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
77 addition
and
2 deletion
+77
-2
Include/Acidanthera/Library/OcAppleKernelLib.h
Include/Acidanthera/Library/OcAppleKernelLib.h
+34
-1
Include/Acidanthera/Library/OcConfigurationLib.h
Include/Acidanthera/Library/OcConfigurationLib.h
+2
-1
Library/OcConfigurationLib/OcConfigurationLib.c
Library/OcConfigurationLib/OcConfigurationLib.c
+1
-0
Platform/OpenCore/OpenCoreKernel.c
Platform/OpenCore/OpenCoreKernel.c
+40
-0
未找到文件。
Include/Acidanthera/Library/OcAppleKernelLib.h
浏览文件 @
f545a348
...
...
@@ -87,10 +87,43 @@
#define PLIST_EXPANSION_SIZE 512
//
// Make integral kernel version.
// Make integral kernel version
(major, minor, revision)
.
//
#define KERNEL_VERSION(A, B, C) ((A) * 10000 + (B) * 100 + (C))
//
// Minimum kernel versions for each release.
//
#define KERNEL_VERSION_TIGER_MIN KERNEL_VERSION (8, 0, 0)
#define KERNEL_VERSION_LEOPARD_MIN KERNEL_VERSION (9, 0, 0)
#define KERNEL_VERSION_SNOW_LEOPARD_MIN KERNEL_VERSION (10, 0, 0)
#define KERNEL_VERSION_LION_MIN KERNEL_VERSION (11, 0, 0)
#define KERNEL_VERSION_MOUNTAIN_LION_MIN KERNEL_VERSION (12, 0, 0)
#define KERNEL_VERSION_MAVERICKS_MIN KERNEL_VERSION (13, 0, 0)
#define KERNEL_VERSION_YOSEMITE_MIN KERNEL_VERSION (14, 0, 0)
#define KERNEL_VERSION_EL_CAPITAN_MIN KERNEL_VERSION (15, 0, 0)
#define KERNEL_VERSION_SIERRA_MIN KERNEL_VERSION (16, 0, 0)
#define KERNEL_VERSION_HIGH_SIERRA_MIN KERNEL_VERSION (17, 0, 0)
#define KERNEL_VERSION_MOJAVE_MIN KERNEL_VERSION (18, 0, 0)
#define KERNEL_VERSION_CATALINA_MIN KERNEL_VERSION (19, 0, 0)
#define KERNEL_VERSION_BIG_SUR_MIN KERNEL_VERSION (20, 0, 0)
//
// Maximum kernel versions for each release.
//
#define KERNEL_VERSION_TIGER_MAX (KERNEL_VERSION_LEOPARD_MIN - 1)
#define KERNEL_VERSION_LEOPARD_MAX (KERNEL_VERSION_SNOW_LEOPARD_MIN - 1)
#define KERNEL_VERSION_SNOW_LEOPARD_MAX (KERNEL_VERSION_LION_MIN - 1)
#define KERNEL_VERSION_LION_MAX (KERNEL_VERSION_MOUNTAIN_LION_MIN - 1)
#define KERNEL_VERSION_MOUNTAIN_LION_MAX (KERNEL_VERSION_MAVERICKS_MIN - 1)
#define KERNEL_VERSION_MAVERICKS_MAX (KERNEL_VERSION_YOSEMITE_MIN - 1)
#define KERNEL_VERSION_YOSEMITE_MAX (KERNEL_VERSION_EL_CAPITAN_MIN - 1)
#define KERNEL_VERSION_EL_CAPITAN_MAX (KERNEL_VERSION_SIERRA_MIN - 1)
#define KERNEL_VERSION_SIERRA_MAX (KERNEL_VERSION_HIGH_SIERRA_MIN - 1)
#define KERNEL_VERSION_HIGH_SIERRA_MAX (KERNEL_VERSION_MOJAVE_MIN - 1)
#define KERNEL_VERSION_MOJAVE_MAX (KERNEL_VERSION_CATALINA_MIN - 1)
#define KERNEL_VERSION_CATALINA_MAX (KERNEL_VERSION_BIG_SUR_MIN - 1)
//
// Prelinked context used for kernel modification.
//
...
...
Include/Acidanthera/Library/OcConfigurationLib.h
浏览文件 @
f545a348
...
...
@@ -247,6 +247,7 @@
_(BOOLEAN , DisableRtcChecksum , , FALSE , ()) \
_(BOOLEAN , DummyPowerManagement , , FALSE , ()) \
_(BOOLEAN , ExternalDiskIcons , , FALSE , ()) \
_(OC_STRING , ForceKernelCache , , OC_STRING_CONSTR ("", _, __), OC_DESTR (OC_STRING) ) \
_(BOOLEAN , IncreasePciBarSize , , FALSE , ()) \
_(BOOLEAN , LapicKernelPanic , , FALSE , ()) \
_(BOOLEAN , PanicNoKextDump , , FALSE , ()) \
...
...
Library/OcConfigurationLib/OcConfigurationLib.c
浏览文件 @
f545a348
...
...
@@ -297,6 +297,7 @@ mKernelQuirksSchema[] = {
OC_SCHEMA_BOOLEAN_IN
(
"DisableRtcChecksum"
,
OC_GLOBAL_CONFIG
,
Kernel
.
Quirks
.
DisableRtcChecksum
),
OC_SCHEMA_BOOLEAN_IN
(
"DummyPowerManagement"
,
OC_GLOBAL_CONFIG
,
Kernel
.
Quirks
.
DummyPowerManagement
),
OC_SCHEMA_BOOLEAN_IN
(
"ExternalDiskIcons"
,
OC_GLOBAL_CONFIG
,
Kernel
.
Quirks
.
ExternalDiskIcons
),
OC_SCHEMA_STRING_IN
(
"ForceKernelCache"
,
OC_GLOBAL_CONFIG
,
Kernel
.
Quirks
.
ForceKernelCache
),
OC_SCHEMA_BOOLEAN_IN
(
"IncreasePciBarSize"
,
OC_GLOBAL_CONFIG
,
Kernel
.
Quirks
.
IncreasePciBarSize
),
OC_SCHEMA_BOOLEAN_IN
(
"LapicKernelPanic"
,
OC_GLOBAL_CONFIG
,
Kernel
.
Quirks
.
LapicKernelPanic
),
OC_SCHEMA_BOOLEAN_IN
(
"PanicNoKextDump"
,
OC_GLOBAL_CONFIG
,
Kernel
.
Quirks
.
PanicNoKextDump
),
...
...
Platform/OpenCore/OpenCoreKernel.c
浏览文件 @
f545a348
...
...
@@ -819,6 +819,8 @@ OcKernelFileOpen (
)
{
EFI_STATUS
Status
;
CONST
CHAR8
*
ForceCacheType
;
KERNEL_CACHE_TYPE
MaxCacheTypeAllowed
;
BOOLEAN
Result
;
UINT8
*
Kernel
;
UINT32
KernelSize
;
...
...
@@ -833,6 +835,18 @@ OcKernelFileOpen (
UINT32
LinkedExpansion
;
UINT32
ReservedFullSize
;
//
// Prevent access to cache files depending on maximum cache type allowed.
//
ForceCacheType
=
OC_BLOB_GET
(
&
mOcConfiguration
->
Kernel
.
Quirks
.
ForceKernelCache
);
if
(
AsciiStrCmp
(
ForceCacheType
,
"Cacheless"
)
==
0
)
{
MaxCacheTypeAllowed
=
CacheTypeCacheless
;
}
else
if
(
AsciiStrCmp
(
ForceCacheType
,
"Mkext"
)
==
0
)
{
MaxCacheTypeAllowed
=
CacheTypeMkext
;
}
else
{
MaxCacheTypeAllowed
=
CacheTypePrelinked
;
}
//
// Hook injected OcXXXXXXXX.kext reads from /S/L/E.
//
...
...
@@ -925,6 +939,21 @@ OcKernelFileOpen (
mOcDarwinVersion
=
OcKernelReadDarwinVersion
(
Kernel
,
KernelSize
);
OcKernelApplyPatches
(
mOcConfiguration
,
mOcDarwinVersion
,
0
,
NULL
,
Kernel
,
KernelSize
);
//
// Disable prelinked if forcing mkext or cacheless, but only on appropriate versions.
//
if
((
OcStriStr
(
FileName
,
L"kernelcache"
)
!=
NULL
||
OcStriStr
(
FileName
,
L"prelinkedkernel"
)
!=
NULL
)
&&
((
MaxCacheTypeAllowed
==
CacheTypeMkext
&&
mOcDarwinVersion
<=
KERNEL_VERSION_SNOW_LEOPARD_MAX
)
||
(
MaxCacheTypeAllowed
==
CacheTypeCacheless
&&
mOcDarwinVersion
<=
KERNEL_VERSION_MAVERICKS_MAX
)))
{
DEBUG
((
DEBUG_INFO
,
"OC: Blocking prelinked due to ForceKernelCache=%s: %a
\n
"
,
FileName
,
ForceCacheType
));
FreePool
(
Kernel
);
(
*
NewHandle
)
->
Close
(
*
NewHandle
);
*
NewHandle
=
NULL
;
return
EFI_NOT_FOUND
;
}
PrelinkedStatus
=
OcKernelProcessPrelinked
(
mOcConfiguration
,
mOcDarwinVersion
,
...
...
@@ -975,6 +1004,17 @@ OcKernelFileOpen (
if
(
OpenMode
==
EFI_FILE_MODE_READ
&&
OcStriStr
(
FileName
,
L"Extensions.mkext"
)
!=
NULL
)
{
//
// Disable mkext booting if forcing cacheless.
//
if
(
MaxCacheTypeAllowed
==
CacheTypeCacheless
)
{
DEBUG
((
DEBUG_INFO
,
"OC: Blocking mkext due to ForceKernelCache=%s: %a
\n
"
,
FileName
,
ForceCacheType
));
(
*
NewHandle
)
->
Close
(
*
NewHandle
);
*
NewHandle
=
NULL
;
return
EFI_NOT_FOUND
;
}
OcKernelLoadKextsAndReserve
(
mOcStorage
,
mOcConfiguration
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录