Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
btwise
OpenCorePKG_MOD
提交
3cd9ace6
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,发现更多精彩内容 >>
提交
3cd9ace6
编写于
4月 20, 2020
作者:
V
vit9696
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ResetSystem: Initial version
closes acidanthera/bugtracker#861
上级
19cae804
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
193 addition
and
3 deletion
+193
-3
Application/ResetSystem/ResetSystem.c
Application/ResetSystem/ResetSystem.c
+101
-0
Application/ResetSystem/ResetSystem.inf
Application/ResetSystem/ResetSystem.inf
+52
-0
Application/RtcRw/RtcRw.c
Application/RtcRw/RtcRw.c
+1
-1
Changelog.md
Changelog.md
+1
-0
Docs/Configuration.pdf
Docs/Configuration.pdf
+0
-0
Docs/Configuration.tex
Docs/Configuration.tex
+3
-0
Docs/Differences/Differences.pdf
Docs/Differences/Differences.pdf
+0
-0
Docs/Differences/Differences.tex
Docs/Differences/Differences.tex
+5
-2
Docs/Sample.plist
Docs/Sample.plist
+14
-0
Docs/SampleFull.plist
Docs/SampleFull.plist
+14
-0
OpenCorePkg.dsc
OpenCorePkg.dsc
+1
-0
macbuild.tool
macbuild.tool
+1
-0
未找到文件。
Application/ResetSystem/ResetSystem.c
0 → 100644
浏览文件 @
3cd9ace6
/** @file
Play beep.
Copyright (c) 2020, vit9696. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include <Uefi.h>
#include <Library/BaseMemoryLib.h>
#include <Library/OcDebugLogLib.h>
#include <Library/OcMiscLib.h>
#include <Library/UefiApplicationEntryPoint.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/UefiLib.h>
#include <Protocol/DevicePath.h>
#include <Protocol/ShellParameters.h>
STATIC
EFI_STATUS
GetArguments
(
OUT
UINTN
*
Argc
,
OUT
CHAR16
***
Argv
)
{
EFI_STATUS
Status
;
EFI_SHELL_PARAMETERS_PROTOCOL
*
ShellParameters
;
Status
=
gBS
->
HandleProtocol
(
gImageHandle
,
&
gEfiShellParametersProtocolGuid
,
(
VOID
**
)
&
ShellParameters
);
if
(
EFI_ERROR
(
Status
))
{
return
Status
;
}
*
Argc
=
ShellParameters
->
Argc
;
*
Argv
=
ShellParameters
->
Argv
;
return
EFI_SUCCESS
;
}
EFI_STATUS
EFIAPI
UefiMain
(
IN
EFI_HANDLE
ImageHandle
,
IN
EFI_SYSTEM_TABLE
*
SystemTable
)
{
EFI_STATUS
Status
;
UINTN
Argc
;
CHAR16
**
Argv
;
CHAR16
*
Mode
;
EFI_RESET_TYPE
ResetMode
;
Status
=
GetArguments
(
&
Argc
,
&
Argv
);
if
(
!
EFI_ERROR
(
Status
)
&&
Argc
>=
2
)
{
Mode
=
Argv
[
1
];
}
else
{
DEBUG
((
DEBUG_INFO
,
"OCRST: Assuming default to be ResetCold...
\n
"
));
Mode
=
L"ResetCold"
;
}
if
(
StrCmp
(
Mode
,
L"ColdReset"
)
==
0
)
{
DEBUG
((
DEBUG_INFO
,
"OCRST: Perform cold reset...
\n
"
));
ResetMode
=
EfiResetCold
;
}
else
if
(
StrCmp
(
Mode
,
L"WarmReset"
)
==
0
)
{
DEBUG
((
DEBUG_INFO
,
"OCRST: Perform warm reset...
\n
"
));
ResetMode
=
EfiResetWarm
;
}
else
if
(
StrCmp
(
Mode
,
L"Shutdown"
)
==
0
)
{
DEBUG
((
DEBUG_INFO
,
"OCRST: Perform shutdown...
\n
"
));
ResetMode
=
EfiResetShutdown
;
}
else
{
DEBUG
((
DEBUG_INFO
,
"OCRST: Unknown argument %s, defaulting to cold reset...
\n
"
,
Mode
));
ResetMode
=
EfiResetCold
;
}
gRT
->
ResetSystem
(
ResetMode
,
EFI_SUCCESS
,
0
,
NULL
);
DEBUG
((
DEBUG_INFO
,
"OCRST: Failed to reset, trying direct
\n
"
));
DirectRestCold
();
DEBUG
((
DEBUG_INFO
,
"OCRST: Failed to reset directly, entering dead loop
\n
"
));
CpuDeadLoop
();
return
EFI_SUCCESS
;
//< Unreachable
}
Application/ResetSystem/ResetSystem.inf
0 → 100644
浏览文件 @
3cd9ace6
## @file
# Reset system in some way.
#
# Copyright (c) 2020, vit9696. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
##
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = ResetSystem
FILE_GUID = E0CAD01B-51A1-4591-87FF-EA9216D431BD
MODULE_TYPE = UEFI_APPLICATION
VERSION_STRING = 1.0
ENTRY_POINT = UefiMain
#
# This flag specifies whether HII resource section is generated into PE image.
#
UEFI_HII_RESOURCE_SECTION = TRUE
#
# The following information is for reference only and not required by the build tools.
#
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
#
[Sources]
ResetSystem.c
[Protocols]
gEfiShellParametersProtocolGuid
[Packages]
EfiPkg/EfiPkg.dec
MdePkg/MdePkg.dec
OpenCorePkg/OpenCorePkg.dec
[LibraryClasses]
BaseLib
DebugLib
OcMiscLib
UefiApplicationEntryPoint
UefiBootServicesTableLib
UefiRuntimeServicesTableLib
UefiLib
Application/RtcRw/RtcRw.c
浏览文件 @
3cd9ace6
/** @file
Play beep
.
RTC memory read/write
.
Copyright (c) 2020, vit9696. All rights reserved.<BR>
This program and the accompanying materials
...
...
Changelog.md
浏览文件 @
3cd9ace6
...
...
@@ -16,6 +16,7 @@ OpenCore Changelog
-
Added
`PatchAppleRtcChecksum`
kernel quirk
-
Added
`AppleRtcRam`
protocol implementation
-
Renamed
`Protocols`
to
`ProtocolOverrides`
for clarity
-
Added ResetSystem tool to allow shutdown/reset actions in the menu
#### v0.5.7
-
Added TimeMachine detection to picker
...
...
Docs/Configuration.pdf
浏览文件 @
3cd9ace6
无法预览此类型文件
Docs/Configuration.tex
浏览文件 @
3cd9ace6
...
...
@@ -4044,6 +4044,9 @@ Some of the known tools are listed below (builtin tools are marked with \textbf{
with a broad range of firmwares.
\\
\href
{
https:
//
github.com
/
acidanthera
/
OpenCorePkg
}{
\texttt
{
PavpProvision
}}
&
Perform EPID provisioning
(
requires certificate data configuration
)
.
\\
\href
{
https:
//
github.com
/
acidanthera
/
OpenCorePkg
}{
\texttt
{
ResetSystem
}}
\textbf
{
*
}
&
Utility to perform system reset. Takes reset type as an argument:
\texttt
{
ColdReset
}
,
\texttt
{
WarmReset
}
,
\texttt
{
Shutdown
}
. Defaults to
\texttt
{
ColdReset
}
.
\\
\href
{
https:
//
github.com
/
acidanthera
/
OpenCorePkg
}{
\texttt
{
RtcRw
}}
\textbf
{
*
}
&
Utility to read and write RTC
(
CMOS
)
memory.
\\
\href
{
https:
//
github.com
/
acidanthera
/
OpenCorePkg
}{
\texttt
{
VerifyMsrE
2
}}
\textbf
{
*
}
...
...
Docs/Differences/Differences.pdf
浏览文件 @
3cd9ace6
无法预览此类型文件
Docs/Differences/Differences.tex
浏览文件 @
3cd9ace6
\documentclass
[]
{
article
}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL PreviousConfiguration.tex Tue Apr 7 19:32:13 2020
%DIF ADD ../Configuration.tex Mon Apr 20
09:29:28
2020
%DIF ADD ../Configuration.tex Mon Apr 20
13:11:07
2020
\usepackage
{
lmodern
}
\usepackage
{
amssymb,amsmath
}
...
...
@@ -4116,7 +4116,10 @@ Some of the known tools are listed below (builtin tools are marked with \textbf{
with a broad range of firmwares.
\\
\href
{
https:
//
github.com
/
acidanthera
/
OpenCorePkg
}{
\texttt
{
PavpProvision
}}
&
Perform EPID provisioning
(
requires certificate data configuration
)
.
\\
\DIFaddbegin
\href
{
https:
//
github.com
/
acidanthera
/
OpenCorePkg
}{
\texttt
{
RtcRw
}}
\textbf
{
\DIFadd
{
*
}}
\DIFaddbegin
\href
{
https:
//
github.com
/
acidanthera
/
OpenCorePkg
}{
\texttt
{
ResetSystem
}}
\textbf
{
\DIFadd
{
*
}}
&
\DIFadd
{
Utility to perform system reset. Takes reset type as an argument:
}
\texttt
{
\DIFadd
{
ColdReset
}}
\DIFadd
{
,
}
\texttt
{
\DIFadd
{
WarmReset
}}
\DIFadd
{
,
}
\texttt
{
\DIFadd
{
Shutdown
}}
\DIFadd
{
. Defaults to
}
\texttt
{
\DIFadd
{
ColdReset
}}
\DIFadd
{
.
}
\\
\href
{
https:
//
github.com
/
acidanthera
/
OpenCorePkg
}{
\texttt
{
RtcRw
}}
\textbf
{
\DIFadd
{
*
}}
&
\DIFadd
{
Utility to read and write RTC
(
CMOS
)
memory.
}
\\
\DIFaddend
\href
{
https:
//
github.com
/
acidanthera
/
OpenCorePkg
}{
\texttt
{
VerifyMsrE
2
}}
\textbf
{
*
}
&
Check
\texttt
{
CFG Lock
}
(
MSR
\texttt
{
0
xE
2
}
write protection
)
consistency across all cores.
...
...
Docs/Sample.plist
浏览文件 @
3cd9ace6
...
...
@@ -649,6 +649,20 @@
<key>
Path
</key>
<string>
memcheck/memcheck.efi
</string>
</dict>
<dict>
<key>
Arguments
</key>
<string>
Shutdown
</string>
<key>
Auxiliary
</key>
<true/>
<key>
Comment
</key>
<string>
Perform shutdown
</string>
<key>
Enabled
</key>
<false/>
<key>
Name
</key>
<string>
Shutdown
</string>
<key>
Path
</key>
<string>
ResetSystem.efi
</string>
</dict>
</array>
</dict>
<key>
NVRAM
</key>
...
...
Docs/SampleFull.plist
浏览文件 @
3cd9ace6
...
...
@@ -649,6 +649,20 @@
<key>
Path
</key>
<string>
memcheck/memcheck.efi
</string>
</dict>
<dict>
<key>
Arguments
</key>
<string>
Shutdown
</string>
<key>
Auxiliary
</key>
<true/>
<key>
Comment
</key>
<string>
Perform shutdown
</string>
<key>
Enabled
</key>
<false/>
<key>
Name
</key>
<string>
Shutdown
</string>
<key>
Path
</key>
<string>
ResetSystem.efi
</string>
</dict>
</array>
</dict>
<key>
NVRAM
</key>
...
...
OpenCorePkg.dsc
浏览文件 @
3cd9ace6
...
...
@@ -151,6 +151,7 @@
OpenCorePkg/Application/MmapDump/MmapDump.inf
OpenCorePkg/Application/OpenControl/OpenControl.inf
OpenCorePkg/Application/PavpProvision/PavpProvision.inf
OpenCorePkg/Application/ResetSystem/ResetSystem.inf
OpenCorePkg/Application/RtcRw/RtcRw.inf
OpenCorePkg/Application/VerifyMsrE2/VerifyMsrE2.inf
OpenCorePkg/Debug/GdbSyms/GdbSyms.inf
...
...
macbuild.tool
浏览文件 @
3cd9ace6
...
...
@@ -36,6 +36,7 @@ package() {
cp
HiiDatabase.efi tmp/EFI/OC/Drivers/
||
exit
1
cp
KeyTester.efi tmp/EFI/OC/Tools/
||
exit
1
cp
MmapDump.efi tmp/EFI/OC/Tools/
||
exit
1
cp
ResetSystem.efi tmp/EFI/OC/Tools
||
exit
1
cp
RtcRw.efi tmp/EFI/OC/Tools
||
exit
1
cp
NvmExpressDxe.efi tmp/EFI/OC/Drivers/
||
exit
1
cp
OpenCanopy.efi tmp/EFI/OC/Drivers/
||
exit
1
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录