Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
0bb426d3
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,发现更多精彩内容 >>
提交
0bb426d3
编写于
4月 18, 2020
作者:
V
vit9696
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OcAppleKernelLib: Added `PatchAppleRtcChecksum` kernel quirk
上级
4ec0e4e1
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
127 addition
and
58 deletion
+127
-58
Changelog.md
Changelog.md
+1
-0
Docs/Configuration.pdf
Docs/Configuration.pdf
+0
-0
Docs/Configuration.tex
Docs/Configuration.tex
+15
-0
Docs/Differences/Differences.pdf
Docs/Differences/Differences.pdf
+0
-0
Docs/Differences/Differences.tex
Docs/Differences/Differences.tex
+20
-2
Docs/Sample.plist
Docs/Sample.plist
+2
-28
Docs/SampleFull.plist
Docs/SampleFull.plist
+2
-28
Include/Library/OcAppleKernelLib.h
Include/Library/OcAppleKernelLib.h
+12
-0
Include/Library/OcConfigurationLib.h
Include/Library/OcConfigurationLib.h
+1
-0
Library/OcAppleKernelLib/CommonPatches.c
Library/OcAppleKernelLib/CommonPatches.c
+69
-0
Library/OcConfigurationLib/OcConfigurationLib.c
Library/OcConfigurationLib/OcConfigurationLib.c
+1
-0
Platform/OpenCore/OpenCoreKernel.c
Platform/OpenCore/OpenCoreKernel.c
+4
-0
未找到文件。
Changelog.md
浏览文件 @
0bb426d3
...
...
@@ -13,6 +13,7 @@ OpenCore Changelog
-
Added mouse drivers to the package as OVMF needs one
-
Added memory region reservation support
-
Added RtcRw tool to manipulate RTC memory
-
Added
`PatchAppleRtcChecksum`
kernel quirk
#### v0.5.7
-
Added TimeMachine detection to picker
...
...
Docs/Configuration.pdf
浏览文件 @
0bb426d3
无法预览此类型文件
Docs/Configuration.tex
浏览文件 @
0bb426d3
...
...
@@ -1975,6 +1975,21 @@ blocking.
ACPI table and disabling VT-d in firmware preferences, which does not break
VT-d support in other systems in case they need it.
\item
\texttt
{
DisableRtcChecksum
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
\textbf
{
Failsafe
}
:
\texttt
{
false
}
\\
\textbf
{
Description
}
: Disables primary checksum (
\texttt
{
0x58
}
-
\texttt
{
0x59
}
)
writing in AppleRTC.
\emph
{
Note 1
}
: This option will not protect other areas from being overwritten,
see
\href
{
https://github.com/acidanthera/RTCMemoryFixup
}{
RTCMemoryFixup
}
kernel extension if this is desired.
\emph
{
Note 2
}
: This option will not protect areas from being overwritten
at firmware stage (e.g. macOS bootloader), see
\texttt
{
RTC
}
(FIXME) section
if this is desired.
\item
\texttt
{
DummyPowerManagement
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
...
...
Docs/Differences/Differences.pdf
浏览文件 @
0bb426d3
无法预览此类型文件
Docs/Differences/Differences.tex
浏览文件 @
0bb426d3
\documentclass
[]
{
article
}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL PreviousConfiguration.tex Tue Apr 7 19:32:13 2020
%DIF ADD ../Configuration.tex Sat Apr 18 1
3:12:30
2020
%DIF ADD ../Configuration.tex Sat Apr 18 1
5:39:07
2020
\usepackage
{
lmodern
}
\usepackage
{
amssymb,amsmath
}
...
...
@@ -2037,7 +2037,25 @@ blocking.
VT-d support in other systems in case they need it.
\item
\texttt
{
DummyPowerManagement
}
\\
\DIFaddbegin
\texttt
{
\DIFadd
{
DisableRtcChecksum
}}
\\
\textbf
{
\DIFadd
{
Type
}}
\DIFadd
{
:
}
\texttt
{
\DIFadd
{
plist
\
boolean
}}
\\
\textbf
{
\DIFadd
{
Failsafe
}}
\DIFadd
{
:
}
\texttt
{
\DIFadd
{
false
}}
\\
\textbf
{
\DIFadd
{
Description
}}
\DIFadd
{
: Disables primary checksum (
}
\texttt
{
\DIFadd
{
0x58
}}
\DIFadd
{
-
}
\texttt
{
\DIFadd
{
0x59
}}
\DIFadd
{
)
writing in AppleRTC.
}
\emph
{
\DIFadd
{
Note 1
}}
\DIFadd
{
: This option will not protect other areas from being overwritten,
see
}
\href
{
https://github.com/acidanthera/RTCMemoryFixup
}{
RTCMemoryFixup
}
\DIFadd
{
kernel extension if this is desired.
}
\emph
{
\DIFadd
{
Note 2
}}
\DIFadd
{
: This option will not protect areas from being overwritten
at firmware stage (e.g. macOS bootloader), see
}
\texttt
{
\DIFadd
{
RTC
}}
\DIFadd
{
(FIXME) section
if this is desired.
}
\item
\DIFaddend
\texttt
{
DummyPowerManagement
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
\textbf
{
Failsafe
}
:
\texttt
{
false
}
\\
\textbf
{
Description
}
: Disables
\texttt
{
AppleIntelCpuPowerManagement
}
.
...
...
Docs/Sample.plist
浏览文件 @
0bb426d3
...
...
@@ -462,34 +462,6 @@
<key>
Skip
</key>
<integer>
0
</integer>
</dict>
<dict>
<key>
Base
</key>
<string>
__ZN8AppleRTC14updateChecksumEv
</string>
<key>
Comment
</key>
<string>
Disable RTC checksum update on poweroff
</string>
<key>
Count
</key>
<integer>
1
</integer>
<key>
Enabled
</key>
<false/>
<key>
Find
</key>
<data></data>
<key>
Identifier
</key>
<string>
com.apple.driver.AppleRTC
</string>
<key>
Limit
</key>
<integer>
0
</integer>
<key>
Mask
</key>
<data></data>
<key>
MaxKernel
</key>
<string></string>
<key>
MinKernel
</key>
<string></string>
<key>
Replace
</key>
<data>
ww==
</data>
<key>
ReplaceMask
</key>
<data></data>
<key>
Skip
</key>
<integer>
0
</integer>
</dict>
<dict>
<key>
Base
</key>
<string>
_AcpiOsVprintf
</string>
...
...
@@ -561,6 +533,8 @@
<false/>
<key>
DisableIoMapper
</key>
<false/>
<key>
DisableRtcChecksum
</key>
<false/>
<key>
DummyPowerManagement
</key>
<false/>
<key>
ExternalDiskIcons
</key>
...
...
Docs/SampleFull.plist
浏览文件 @
0bb426d3
...
...
@@ -462,34 +462,6 @@
<key>
Skip
</key>
<integer>
0
</integer>
</dict>
<dict>
<key>
Base
</key>
<string>
__ZN8AppleRTC14updateChecksumEv
</string>
<key>
Comment
</key>
<string>
Disable RTC checksum update on poweroff
</string>
<key>
Count
</key>
<integer>
1
</integer>
<key>
Enabled
</key>
<false/>
<key>
Find
</key>
<data></data>
<key>
Identifier
</key>
<string>
com.apple.driver.AppleRTC
</string>
<key>
Limit
</key>
<integer>
0
</integer>
<key>
Mask
</key>
<data></data>
<key>
MaxKernel
</key>
<string></string>
<key>
MinKernel
</key>
<string></string>
<key>
Replace
</key>
<data>
ww==
</data>
<key>
ReplaceMask
</key>
<data></data>
<key>
Skip
</key>
<integer>
0
</integer>
</dict>
<dict>
<key>
Base
</key>
<string>
_AcpiOsVprintf
</string>
...
...
@@ -561,6 +533,8 @@
<false/>
<key>
DisableIoMapper
</key>
<false/>
<key>
DisableRtcChecksum
</key>
<false/>
<key>
DummyPowerManagement
</key>
<false/>
<key>
ExternalDiskIcons
</key>
...
...
Include/Library/OcAppleKernelLib.h
浏览文件 @
0bb426d3
...
...
@@ -586,4 +586,16 @@ PatchPowerStateTimeout (
IN
OUT
PATCHER_CONTEXT
*
Patcher
);
/**
Disable AppleRTC checksum writing.
@param Patcher Patcher context.
@return RETURN_SUCCESS on success.
**/
EFI_STATUS
PatchAppleRtcChecksum
(
IN
OUT
PRELINKED_CONTEXT
*
Context
);
#endif // OC_APPLE_KERNEL_LIB_H
Include/Library/OcConfigurationLib.h
浏览文件 @
0bb426d3
...
...
@@ -243,6 +243,7 @@
_(BOOLEAN , AppleXcpmForceBoost , , FALSE , ()) \
_(BOOLEAN , CustomSmbiosGuid , , FALSE , ()) \
_(BOOLEAN , DisableIoMapper , , FALSE , ()) \
_(BOOLEAN , DisableRtcChecksum , , FALSE , ()) \
_(BOOLEAN , DummyPowerManagement , , FALSE , ()) \
_(BOOLEAN , ExternalDiskIcons , , FALSE , ()) \
_(BOOLEAN , IncreasePciBarSize , , FALSE , ()) \
...
...
Library/OcAppleKernelLib/CommonPatches.c
浏览文件 @
0bb426d3
...
...
@@ -1484,3 +1484,72 @@ PatchPowerStateTimeout (
return
Status
;
}
//
// There currently are 2 places main RTC checksum is calculated in AppleRTC.kext
// __ZN8AppleRTC14updateChecksumEv and __ZN8AppleRTC19rtcRecordTracePointEjjj.
// Since we do not want to completely break RTC and/or saving tracepoints to RTC
// we patch-out __ZN8AppleRTC8rtcWriteEjh call arguments (0x58 and 0x59) with
// invalid (out of range) value 0xFFFF in 4 places.
//
STATIC
UINT8
mAppleRtcChecksumPatchFind
[]
=
{
0xBE
,
0x58
,
0x00
,
0x00
,
0x00
};
STATIC
UINT8
mAppleRtcChecksumPatchMask
[]
=
{
0xFF
,
0xFE
,
0xFF
,
0xFF
,
0xFF
};
STATIC
UINT8
mAppleRtcChecksumPatchReplace
[]
=
{
0xBE
,
0xFF
,
0xFF
,
0x00
,
0x00
};
STATIC
PATCHER_GENERIC_PATCH
mAppleRtcChecksumPatch
=
{
.
Comment
=
DEBUG_POINTER
(
"DisableRtcChecksum"
),
.
Base
=
NULL
,
.
Find
=
mAppleRtcChecksumPatchFind
,
.
Mask
=
mAppleRtcChecksumPatchMask
,
.
Replace
=
mAppleRtcChecksumPatchReplace
,
.
ReplaceMask
=
NULL
,
.
Size
=
sizeof
(
mAppleRtcChecksumPatchFind
),
.
Count
=
4
,
.
Skip
=
0
,
.
Limit
=
0
};
EFI_STATUS
PatchAppleRtcChecksum
(
IN
OUT
PRELINKED_CONTEXT
*
Context
)
{
RETURN_STATUS
Status
;
PATCHER_CONTEXT
Patcher
;
Status
=
PatcherInitContextFromPrelinked
(
&
Patcher
,
Context
,
"com.apple.driver.AppleRTC"
);
if
(
!
EFI_ERROR
(
Status
))
{
Status
=
PatcherApplyGenericPatch
(
&
Patcher
,
&
mAppleRtcChecksumPatch
);
if
(
EFI_ERROR
(
Status
))
{
DEBUG
((
DEBUG_INFO
,
"OCAK: Failed to apply patch com.apple.driver.AppleRTC DisableRtcChecksum - %r
\n
"
,
Status
));
}
else
{
DEBUG
((
DEBUG_INFO
,
"OCAK: Patch success com.apple.driver.AppleRTC DisableRtcChecksum
\n
"
));
}
}
else
{
DEBUG
((
DEBUG_INFO
,
"OCAK: Failed to find com.apple.driver.AppleRTC for DisableRtcChecksum - %r
\n
"
,
Status
));
}
return
Status
;
}
Library/OcConfigurationLib/OcConfigurationLib.c
浏览文件 @
0bb426d3
...
...
@@ -293,6 +293,7 @@ mKernelQuirksSchema[] = {
OC_SCHEMA_BOOLEAN_IN
(
"AppleXcpmForceBoost"
,
OC_GLOBAL_CONFIG
,
Kernel
.
Quirks
.
AppleXcpmForceBoost
),
OC_SCHEMA_BOOLEAN_IN
(
"CustomSMBIOSGuid"
,
OC_GLOBAL_CONFIG
,
Kernel
.
Quirks
.
CustomSmbiosGuid
),
OC_SCHEMA_BOOLEAN_IN
(
"DisableIoMapper"
,
OC_GLOBAL_CONFIG
,
Kernel
.
Quirks
.
DisableIoMapper
),
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_BOOLEAN_IN
(
"IncreasePciBarSize"
,
OC_GLOBAL_CONFIG
,
Kernel
.
Quirks
.
IncreasePciBarSize
),
...
...
Platform/OpenCore/OpenCoreKernel.c
浏览文件 @
0bb426d3
...
...
@@ -457,6 +457,10 @@ OcKernelApplyPatches (
PatchAppleIoMapperSupport
(
Context
);
}
if
(
Config
->
Kernel
.
Quirks
.
DisableRtcChecksum
)
{
PatchAppleRtcChecksum
(
Context
);
}
if
(
Config
->
Kernel
.
Quirks
.
IncreasePciBarSize
)
{
PatchIncreasePciBarSize
(
Context
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录