Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
e2fbb2e1
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,发现更多精彩内容 >>
提交
e2fbb2e1
编写于
4月 18, 2020
作者:
V
vit9696
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
OpenCoreUefi: Added memory region reservation support
上级
34b34db8
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
195 addition
and
13 deletion
+195
-13
Changelog.md
Changelog.md
+1
-0
Docs/Configuration.pdf
Docs/Configuration.pdf
+0
-0
Docs/Configuration.tex
Docs/Configuration.tex
+45
-0
Docs/Differences/Differences.pdf
Docs/Differences/Differences.pdf
+0
-0
Docs/Differences/Differences.tex
Docs/Differences/Differences.tex
+54
-3
Docs/Sample.plist
Docs/Sample.plist
+13
-0
Docs/SampleFull.plist
Docs/SampleFull.plist
+13
-0
Include/Library/OcConfigurationLib.h
Include/Library/OcConfigurationLib.h
+16
-1
Library/OcConfigurationLib/OcConfigurationLib.c
Library/OcConfigurationLib/OcConfigurationLib.c
+17
-1
Platform/OpenCore/OpenCoreUefi.c
Platform/OpenCore/OpenCoreUefi.c
+36
-8
未找到文件。
Changelog.md
浏览文件 @
e2fbb2e1
...
...
@@ -11,6 +11,7 @@ OpenCore Changelog
-
Added AppleEvent mouse support in OpenCanopy
-
Fixed AppleEvent and OpenCanopy compatibility with OVMF TPL restrictions
-
Added mouse drivers to the package as OVMF needs one
-
Added memory region reservation support
#### v0.5.7
-
Added TimeMachine detection to picker
...
...
Docs/Configuration.pdf
浏览文件 @
e2fbb2e1
无法预览此类型文件
Docs/Configuration.tex
浏览文件 @
e2fbb2e1
...
...
@@ -4222,6 +4222,15 @@ functioning. Feature highlights:
\textbf
{
Description
}
: Apply individual firmware quirks described in
\hyperref
[
uefiquirkprops
]
{
Quirks Properties
}
section below.
\item
\texttt
{
ReservedMemory
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
array
}
\\
\textbf
{
Description
}
: Designed to be filled with
\texttt
{
plist
\
dict
}
values,
describing memory areas exquisite to particular firmware and hardware functioning,
which should not be used by the operating system. An example of such memory region
could be second
256
MB corrupted by Intel HD
3000
or an area with faulty RAM.
See
\hyperref
[
uefirsvdprops
]
{
ReservedMemory Properties
}
section below.
\end
{
enumerate
}
\subsection
{
APFS Properties
}
\label
{
uefiapfsprops
}
...
...
@@ -4977,6 +4986,42 @@ functioning. Feature highlights:
\end
{
enumerate
}
\subsection
{
ReservedMemory Properties
}
\label
{
uefirsvdprops
}
\begin
{
enumerate
}
\item
\texttt
{
Address
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
integer
}
\\
\textbf
{
Failsafe
}
:
\texttt
{
0
}
\\
\textbf
{
Description
}
: Start address of the reserved memory region, which should be allocated
as reserved effectively marking the memory of this type inaccessible to the operating system.
The addresses written here must be part of the memory map, have
\texttt
{
EfiConventionalMemory
}
type, and page
-
aligned
(
4
KBs
)
.
\item
\texttt
{
Comment
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
string
}
\\
\textbf
{
Failsafe
}
: Empty string
\\
\textbf
{
Description
}
: Arbitrary ASCII string used to provide human readable
reference for the entry. It is implementation defined whether this value is
used.
\item
\texttt
{
Size
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
integer
}
\\
\textbf
{
Failsafe
}
:
\texttt
{
0
}
\\
\textbf
{
Description
}
: Size of the reserved memory region, must be page
-
aligned
(
4
KBs
)
.
\item
\texttt
{
Enabled
}
\\
\textbf
{
Type
}
:
\texttt
{
plist
\
boolean
}
\\
\textbf
{
Failsafe
}
:
\texttt
{
false
}
\\
\textbf
{
Description
}
: This region will not be reserved unless set to
\texttt
{
true
}
.
\end
{
enumerate
}
\section
{
Troubleshooting
}
\label
{
troubleshooting
}
\subsection
{
Windows support
}
\label
{
troubleshootingwin
}
...
...
Docs/Differences/Differences.pdf
浏览文件 @
e2fbb2e1
无法预览此类型文件
Docs/Differences/Differences.tex
浏览文件 @
e2fbb2e1
\documentclass
[]
{
article
}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL PreviousConfiguration.tex Tue Apr 7 19:32:13 2020
%DIF ADD ../Configuration.tex
Fri Apr 17 09:18:48
2020
%DIF ADD ../Configuration.tex
Sat Apr 18 10:27:00
2020
\usepackage
{
lmodern
}
\usepackage
{
amssymb,amsmath
}
...
...
@@ -4291,7 +4291,17 @@ functioning. Feature highlights:
\textbf
{
Description
}
: Apply individual firmware quirks described in
\hyperref
[
uefiquirkprops
]
{
Quirks Properties
}
section below.
\end
{
enumerate
}
\DIFaddbegin
\item
\texttt
{
\DIFadd
{
ReservedMemory
}}
\\
\textbf
{
\DIFadd
{
Type
}}
\DIFadd
{
:
}
\texttt
{
\DIFadd
{
plist
\
array
}}
\\
\textbf
{
\DIFadd
{
Description
}}
\DIFadd
{
: Designed to be filled with
}
\texttt
{
\DIFadd
{
plist
\
dict
}}
\DIFadd
{
values,
describing memory areas exquisite to particular firmware and hardware functioning,
which should not be used by the operating system. An example of such memory region
could be second
256
MB corrupted by Intel HD
3000
or an area with faulty RAM.
See
}
\hyperref
[
uefirsvdprops
]
{
ReservedMemory Properties
}
\DIFadd
{
section below.
}
\DIFaddend
\end
{
enumerate
}
\DIFaddbegin
\subsection
{
\DIFadd
{
APFS Properties
}}
\label
{
uefiapfsprops
}
...
...
@@ -5056,7 +5066,48 @@ functioning. Feature highlights:
\end
{
enumerate
}
\section
{
Troubleshooting
}
\label
{
troubleshooting
}
\DIFaddbegin
\subsection
{
\DIFadd
{
ReservedMemory Properties
}}
\label
{
uefirsvdprops
}
\begin
{
enumerate
}
\item
\texttt
{
\DIFadd
{
Address
}}
\\
\textbf
{
\DIFadd
{
Type
}}
\DIFadd
{
:
}
\texttt
{
\DIFadd
{
plist
\
integer
}}
\\
\textbf
{
\DIFadd
{
Failsafe
}}
\DIFadd
{
:
}
\texttt
{
\DIFadd
{
0
}}
\\
\textbf
{
\DIFadd
{
Description
}}
\DIFadd
{
: Start address of the reserved memory region, which should be allocated
as reserved effectively marking the memory of this type inaccessible to the operating system.
}
\DIFadd
{
The addresses written here must be part of the memory map, have
}
\texttt
{
\DIFadd
{
EfiConventionalMemory
}}
\DIFadd
{
type, and page
-
aligned
(
4
KBs
)
.
}
\item
\texttt
{
\DIFadd
{
Comment
}}
\\
\textbf
{
\DIFadd
{
Type
}}
\DIFadd
{
:
}
\texttt
{
\DIFadd
{
plist
\
string
}}
\\
\textbf
{
\DIFadd
{
Failsafe
}}
\DIFadd
{
: Empty string
}
\\
\textbf
{
\DIFadd
{
Description
}}
\DIFadd
{
: Arbitrary ASCII string used to provide human readable
reference for the entry. It is implementation defined whether this value is
used.
}
\item
\texttt
{
\DIFadd
{
Size
}}
\\
\textbf
{
\DIFadd
{
Type
}}
\DIFadd
{
:
}
\texttt
{
\DIFadd
{
plist
\
integer
}}
\\
\textbf
{
\DIFadd
{
Failsafe
}}
\DIFadd
{
:
}
\texttt
{
\DIFadd
{
0
}}
\\
\textbf
{
\DIFadd
{
Description
}}
\DIFadd
{
: Size of the reserved memory region, must be page
-
aligned
(
4
KBs
)
.
}
\item
\texttt
{
\DIFadd
{
Enabled
}}
\\
\textbf
{
\DIFadd
{
Type
}}
\DIFadd
{
:
}
\texttt
{
\DIFadd
{
plist
\
boolean
}}
\\
\textbf
{
\DIFadd
{
Failsafe
}}
\DIFadd
{
:
}
\texttt
{
\DIFadd
{
false
}}
\\
\textbf
{
\DIFadd
{
Description
}}
\DIFadd
{
: This region will not be reserved unless set to
}
\texttt
{
\DIFadd
{
true
}}
\DIFadd
{
.
}
\end
{
enumerate
}
\DIFaddend
\section
{
Troubleshooting
}
\label
{
troubleshooting
}
\subsection
{
Windows support
}
\label
{
troubleshootingwin
}
...
...
Docs/Sample.plist
浏览文件 @
e2fbb2e1
...
...
@@ -922,6 +922,19 @@
<key>
UnblockFsConnect
</key>
<false/>
</dict>
<key>
ReservedMemory
</key>
<array>
<dict>
<key>
Address
</key>
<integer>
268435456
</integer>
<key>
Size
</key>
<integer>
268435456
</integer>
<key>
Comment
</key>
<string>
HD3000: IGPU memory corruption errata
</string>
<key>
Enabled
</key>
<false/>
</dict>
</array>
</dict>
</dict>
</plist>
Docs/SampleFull.plist
浏览文件 @
e2fbb2e1
...
...
@@ -1025,6 +1025,19 @@
<key>
UnblockFsConnect
</key>
<false/>
</dict>
<key>
ReservedMemory
</key>
<array>
<dict>
<key>
Address
</key>
<integer>
268435456
</integer>
<key>
Size
</key>
<integer>
268435456
</integer>
<key>
Comment
</key>
<string>
HD3000: IGPU memory corruption errata
</string>
<key>
Enabled
</key>
<false/>
</dict>
</array>
</dict>
</dict>
</plist>
Include/Library/OcConfigurationLib.h
浏览文件 @
e2fbb2e1
...
...
@@ -556,6 +556,20 @@ typedef enum {
_(BOOLEAN , UnblockFsConnect , , FALSE , ())
OC_DECLARE
(
OC_UEFI_QUIRKS
)
///
/// Reserved memory entries adds.
///
#define OC_UEFI_RSVD_ENTRY_FIELDS(_, __) \
_(UINT64 , Address , , 0 , () ) \
_(UINT64 , Size , , 0 , () ) \
_(BOOLEAN , Enabled , , FALSE , () ) \
_(OC_STRING , Comment , , OC_STRING_CONSTR ("", _, __), OC_DESTR (OC_STRING) )
OC_DECLARE
(
OC_UEFI_RSVD_ENTRY
)
#define OC_UEFI_RSVD_ARRAY_FIELDS(_, __) \
OC_ARRAY (OC_UEFI_RSVD_ENTRY, _, __)
OC_DECLARE
(
OC_UEFI_RSVD_ARRAY
)
///
/// Uefi contains firmware tweaks and extra drivers.
///
...
...
@@ -567,7 +581,8 @@ typedef enum {
_(OC_UEFI_INPUT , Input , , OC_CONSTR2 (OC_UEFI_INPUT, _, __) , OC_DESTR (OC_UEFI_INPUT)) \
_(OC_UEFI_OUTPUT , Output , , OC_CONSTR2 (OC_UEFI_OUTPUT, _, __) , OC_DESTR (OC_UEFI_OUTPUT)) \
_(OC_UEFI_PROTOCOLS , Protocols , , OC_CONSTR2 (OC_UEFI_PROTOCOLS, _, __) , OC_DESTR (OC_UEFI_PROTOCOLS)) \
_(OC_UEFI_QUIRKS , Quirks , , OC_CONSTR2 (OC_UEFI_QUIRKS, _, __) , OC_DESTR (OC_UEFI_QUIRKS))
_(OC_UEFI_QUIRKS , Quirks , , OC_CONSTR2 (OC_UEFI_QUIRKS, _, __) , OC_DESTR (OC_UEFI_QUIRKS)) \
_(OC_UEFI_RSVD_ARRAY , ReservedMemory , , OC_CONSTR2 (OC_UEFI_RSVD_ARRAY, _, __) , OC_DESTR (OC_UEFI_RSVD_ARRAY))
OC_DECLARE
(
OC_UEFI_CONFIG
)
/**
...
...
Library/OcConfigurationLib/OcConfigurationLib.c
浏览文件 @
e2fbb2e1
...
...
@@ -70,6 +70,8 @@ OC_STRUCTORS (OC_UEFI_AUDIO, ())
OC_STRUCTORS
(
OC_UEFI_INPUT
,
())
OC_STRUCTORS
(
OC_UEFI_OUTPUT
,
())
OC_STRUCTORS
(
OC_UEFI_PROTOCOLS
,
())
OC_STRUCTORS
(
OC_UEFI_RSVD_ENTRY
,
())
OC_ARRAY_STRUCTORS
(
OC_UEFI_RSVD_ARRAY
)
OC_STRUCTORS
(
OC_UEFI_QUIRKS
,
())
OC_STRUCTORS
(
OC_UEFI_CONFIG
,
())
...
...
@@ -606,6 +608,19 @@ mUefiOutputSchema[] = {
OC_SCHEMA_STRING_IN
(
"TextRenderer"
,
OC_GLOBAL_CONFIG
,
Uefi
.
Output
.
TextRenderer
),
};
STATIC
OC_SCHEMA
mUefiReservedMemoryEntrySchema
[]
=
{
OC_SCHEMA_INTEGER_IN
(
"Address"
,
OC_UEFI_RSVD_ENTRY
,
Address
),
OC_SCHEMA_STRING_IN
(
"Comment"
,
OC_UEFI_RSVD_ENTRY
,
Comment
),
OC_SCHEMA_BOOLEAN_IN
(
"Enabled"
,
OC_UEFI_RSVD_ENTRY
,
Enabled
),
OC_SCHEMA_INTEGER_IN
(
"Size"
,
OC_UEFI_RSVD_ENTRY
,
Address
),
};
STATIC
OC_SCHEMA
mUefiReservedMemorySchema
=
OC_SCHEMA_DICT
(
NULL
,
mUefiReservedMemoryEntrySchema
);
STATIC
OC_SCHEMA
mUefiConfigurationSchema
[]
=
{
...
...
@@ -616,7 +631,8 @@ mUefiConfigurationSchema[] = {
OC_SCHEMA_DICT
(
"Input"
,
mUefiInputSchema
),
OC_SCHEMA_DICT
(
"Output"
,
mUefiOutputSchema
),
OC_SCHEMA_DICT
(
"Protocols"
,
mUefiProtocolsSchema
),
OC_SCHEMA_DICT
(
"Quirks"
,
mUefiQuirksSchema
)
OC_SCHEMA_DICT
(
"Quirks"
,
mUefiQuirksSchema
),
OC_SCHEMA_ARRAY_IN
(
"ReservedMemory"
,
OC_GLOBAL_CONFIG
,
Uefi
.
ReservedMemory
,
&
mUefiReservedMemorySchema
),
};
//
...
...
Platform/OpenCore/OpenCoreUefi.c
浏览文件 @
e2fbb2e1
...
...
@@ -405,14 +405,15 @@ OcLoadUefiSupport (
IN
OC_CPU_INFO
*
CpuInfo
)
{
EFI_STATUS
Status
;
EFI_HANDLE
*
DriversToConnect
;
UINTN
Index
;
UINTN
Index2
;
UINT16
*
BootOrder
;
UINTN
BootOrderSize
;
BOOLEAN
BootOrderChanged
;
EFI_EVENT
Event
;
EFI_STATUS
Status
;
EFI_HANDLE
*
DriversToConnect
;
UINTN
Index
;
UINTN
Index2
;
UINT16
*
BootOrder
;
UINTN
BootOrderSize
;
BOOLEAN
BootOrderChanged
;
EFI_EVENT
Event
;
EFI_PHYSICAL_ADDRESS
ReservedAddress
;
OcReinstallProtocols
(
Config
);
...
...
@@ -498,6 +499,33 @@ OcLoadUefiSupport (
OcMiscUefiQuirksLoaded
(
Config
);
for
(
Index
=
0
;
Index
<
Config
->
Uefi
.
ReservedMemory
.
Count
;
++
Index
)
{
if
(
!
Config
->
Uefi
.
ReservedMemory
.
Values
[
Index
]
->
Enabled
)
{
continue
;
}
if
((
Config
->
Uefi
.
ReservedMemory
.
Values
[
Index
]
->
Address
&
(
BASE_4KB
-
1
))
!=
0
||
(
Config
->
Uefi
.
ReservedMemory
.
Values
[
Index
]
->
Size
&
(
BASE_4KB
-
1
))
!=
0
)
{
Status
=
EFI_INVALID_PARAMETER
;
}
else
{
ReservedAddress
=
Config
->
Uefi
.
ReservedMemory
.
Values
[
Index
]
->
Address
;
Status
=
gBS
->
AllocatePages
(
AllocateAddress
,
EfiReservedMemoryType
,
EFI_SIZE_TO_PAGES
(
Config
->
Uefi
.
ReservedMemory
.
Values
[
Index
]
->
Size
),
&
ReservedAddress
);
}
DEBUG
((
DEBUG_INFO
,
"OC: Reserving region %Lx of %Lx size - %r
\n
"
,
Config
->
Uefi
.
ReservedMemory
.
Values
[
Index
]
->
Address
,
Config
->
Uefi
.
ReservedMemory
.
Values
[
Index
]
->
Size
,
Status
));
}
if
(
Config
->
Uefi
.
ConnectDrivers
)
{
OcLoadDrivers
(
Storage
,
Config
,
&
DriversToConnect
);
DEBUG
((
DEBUG_INFO
,
"OC: Connecting drivers...
\n
"
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录