Skip to content

Commit

Permalink
Merge branch 'acidanthera:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
CrisHotpatch authored Jan 17, 2023
2 parents 050e852 + 218db2a commit 2e40175
Show file tree
Hide file tree
Showing 20 changed files with 339 additions and 152 deletions.
11 changes: 6 additions & 5 deletions Debug/Scripts/gdb_uefi.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,13 @@ def pe_optional(self, pe):
# Returns the symbol file name for a PE image.
#

def pe_parse_debug(self, pe):
def pe_parse_debug(self, base):
pe = self.pe_headers(base)
opt = self.pe_optional(pe)
debug_dir_entry = opt['DataDirectory'][6]
dep = debug_dir_entry['VirtualAddress'] + opt['ImageBase']
dep = debug_dir_entry['VirtualAddress'] + int(base)
dep = dep.cast(self.ptype('EFI_IMAGE_DEBUG_DIRECTORY_ENTRY'))
cvp = dep.dereference()['RVA'] + opt['ImageBase']
cvp = dep.dereference()['RVA'] + int(base)
cvv = cvp.cast(self.ptype('UINT32')).dereference()
if cvv == self.CV_NB10:
return cvp + self.sizeof('EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY')
Expand Down Expand Up @@ -328,7 +329,7 @@ def parse_image(self, image, syms):
pe = self.pe_headers(base)
opt = self.pe_optional(pe)
file = self.pe_file(pe)
sym_name = self.pe_parse_debug(pe)
sym_name = self.pe_parse_debug(base)
sections = self.pe_sections(opt, file, base)

# For ELF and Mach-O-derived images...
Expand Down Expand Up @@ -362,7 +363,7 @@ def parse_edii(self, edii, count):
entry = entry['NormalImage']
self.parse_image(entry['LoadedImageProtocolInstance'], syms)
else:
print(f"Skipping unknown EFI_DEBUG_IMAGE_INFO(Type 0x{entry['ImageInfoType'].dereference():x})")
print(f"Skipping unknown EFI_DEBUG_IMAGE_INFO(Type {str(entry['ImageInfoType'].dereference())})")
index += 1
gdb.execute('symbol-file')
print('Loading new symbols...')
Expand Down
11 changes: 6 additions & 5 deletions Debug/Scripts/lldb_uefi.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,13 @@ def pe_optional(self, pe):
# Returns the symbol file name for a PE image.
#

def pe_parse_debug(self, pe):
def pe_parse_debug(self, base):
pe = self.pe_headers(base)
opt = self.pe_optional(pe)
debug_dir_entry = opt.GetValueForExpressionPath('.DataDirectory[6]')
dep = self.get_field(debug_dir_entry, 'VirtualAddress') + self.get_field(opt, 'ImageBase')
dep = self.get_field(debug_dir_entry, 'VirtualAddress') + base
dep = self.typed_ptr(self.ptype('EFI_IMAGE_DEBUG_DIRECTORY_ENTRY'), dep)
cvp = self.get_field(dep, 'RVA') + self.get_field(opt, 'ImageBase')
cvp = self.get_field(dep, 'RVA') + base
# FIXME: UINT32 should be used here instead of unsigned, but LLDB+PDB type system is broken.
cvv = self.typed_ptr(self.ptype('unsigned'), cvp).Dereference().GetValueAsUnsigned()
if cvv == self.CV_NB10:
Expand Down Expand Up @@ -310,7 +311,7 @@ def parse_image(self, image, syms):
pe = self.pe_headers(base)
opt = self.pe_optional(pe)
file = self.pe_file(pe)
sym_address = self.pe_parse_debug(pe)
sym_address = self.pe_parse_debug(base)
sections = self.pe_sections(opt, file, base)

if sym_address == 0:
Expand Down Expand Up @@ -373,7 +374,7 @@ def parse_edii(self, edii, count):
entry = entry.GetChildMemberWithName('NormalImage')
self.parse_image(entry.GetChildMemberWithName('LoadedImageProtocolInstance'), syms)
else:
print(f'Skipping unknown EFI_DEBUG_IMAGE_INFO (Type 0x{image_type:x})')
print(f'Skipping unknown EFI_DEBUG_IMAGE_INFO (Type {str(image_type)})')
index = index + 1
print('Loading new symbols...')
for sym in syms:
Expand Down
2 changes: 1 addition & 1 deletion Docs/Configuration.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
38f39473b89b08538cc2b6a049804b51
32a9068c12dd2418920da6e0b992c8d9
Binary file modified Docs/Configuration.pdf
Binary file not shown.
5 changes: 4 additions & 1 deletion Docs/Configuration.tex
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,7 @@ \subsection{Contribution}\label{configuration-comp}
git clone --depth=1 https://github.com/acidanthera/audk UDK
cd UDK
git submodule update --init --recommend-shallow
rm -rf OpenCorePkg
git clone --depth=1 https://github.com/acidanthera/OpenCorePkg
. ./edksetup.sh
make -C BaseTools
Expand Down Expand Up @@ -8720,7 +8721,9 @@ \subsection{Quirks Properties}\label{uefiquirkprops}

\emph{Note 2}: While this quirk can increase GPU PCI BAR sizes, this will not
work on most firmware as is, because the quirk does not relocate BARs in memory,
and they will likely overlap. Contributions to improve this feature are welcome.
and they will likely overlap. In most cases it is best to either update the
firmware to the latest version or customise it with a specialised driver
like \href{https://github.com/xCuri0/ReBarUEFI}{ReBarUEFI}.

\item
\texttt{TscSyncTimeout}\\
Expand Down
Binary file modified Docs/Differences/Differences.pdf
Binary file not shown.
15 changes: 10 additions & 5 deletions Docs/Differences/Differences.tex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
\documentclass[]{article}
%DIF LATEXDIFF DIFFERENCE FILE
%DIF DEL PreviousConfiguration.tex Mon Jan 2 19:56:37 2023
%DIF ADD ../Configuration.tex Mon Jan 2 19:56:37 2023
%DIF DEL PreviousConfiguration.tex Mon Jan 2 20:13:00 2023
%DIF ADD ../Configuration.tex Sun Jan 8 15:18:30 2023

\usepackage{lmodern}
\usepackage{amssymb,amsmath}
Expand Down Expand Up @@ -118,7 +118,7 @@
%DIF HYPERREF PREAMBLE %DIF PREAMBLE
\providecommand{\DIFadd}[1]{\texorpdfstring{\DIFaddtex{#1}}{#1}} %DIF PREAMBLE
\providecommand{\DIFdel}[1]{\texorpdfstring{\DIFdeltex{#1}}{}} %DIF PREAMBLE
%DIF COLORLISTINGS PREAMBLE %DIF PREAMBLE
%DIF LISTINGS PREAMBLE %DIF PREAMBLE
\RequirePackage{listings} %DIF PREAMBLE
\RequirePackage{color} %DIF PREAMBLE
\lstdefinelanguage{DIFcode}{ %DIF PREAMBLE
Expand Down Expand Up @@ -723,15 +723,18 @@ \subsection{Contribution}\label{configuration-comp}
The latest Xcode version is recommended for use despite the toolchain name.
An example command sequence is as follows:

\begin{lstlisting}[caption=Compilation Commands, label=compile, style=ocbash]
\DIFmodbegin
\begin{lstlisting}[caption=Compilation Commands, label=compile, style=ocbash,alsolanguage=DIFcode]
git clone --depth=1 https://github.com/acidanthera/audk UDK
cd UDK
git submodule update --init --recommend-shallow
%DIF > rm -rf OpenCorePkg
git clone --depth=1 https://github.com/acidanthera/OpenCorePkg
. ./edksetup.sh
make -C BaseTools
build -a X64 -b RELEASE -t XCODE5 -p OpenCorePkg/OpenCorePkg.dsc
\end{lstlisting}
\DIFmodend

For IDE usage Xcode projects are available in the root of the repositories. Another
approach could be using \href{https://microsoft.github.io/language-server-protocol}{Language Server Protocols}. For example, \href{https://www.sublimetext.com}{Sublime Text} with
Expand Down Expand Up @@ -8780,7 +8783,9 @@ \subsection{Quirks Properties}\label{uefiquirkprops}

\emph{Note 2}: While this quirk can increase GPU PCI BAR sizes, this will not
work on most firmware as is, because the quirk does not relocate BARs in memory,
and they will likely overlap. Contributions to improve this feature are welcome.
and they will likely overlap. \DIFdelbegin \DIFdel{Contributions to improve this feature are welcome}\DIFdelend \DIFaddbegin \DIFadd{In most cases it is best to either update the
firmware to the latest version or customise it with a specialised driver
like }\href{https://github.com/xCuri0/ReBarUEFI}{\DIFadd{ReBarUEFI}}\DIFaddend .

\item
\texttt{TscSyncTimeout}\\
Expand Down
Binary file modified Docs/Errata/Errata.pdf
Binary file not shown.
19 changes: 19 additions & 0 deletions Docs/Errata/Errata.tex
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,25 @@ \section{Issue list}\label{issuelist}

\end{itemize}

\item
\textbf{Identifier}: \texttt{ERR088-1} \\
\textbf{Published}: 2023-01-07 21:29 MSK \\
\textbf{Updated}: 2023-01-07 21:29 MSK \\
\textbf{Affected versions}: 0.8.8 \\
\textbf{Resolved in}: 0.8.9 (\href{https://github.com/acidanthera/OpenCorePkg/commit/092af5d99c764cbe06372dfed3fa03af719550cc}{092af5d9}) \\
\textbf{Description}:

Loading macOS in OpenDuet may fail. Reference:
\href{https://github.com/acidanthera/bugtracker/issues/2190}{acidanthera/bugtracker\#2190}.

\textbf{Possible workarounds}:
\begin{itemize}
\tightlist

\item Update OpenDuet to master version

\end{itemize}

\end{itemize}

\end{document}
6 changes: 3 additions & 3 deletions Docs/Flavours.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ If providing just one file, name it `Shell.icns` if the theming of the icon is g
- **Shell** - Any shell-style tool
- **UEFIShell:Shell** - EDK II UEFI Shell
- As an example of how flavours work: **UEFIShell:Shell** will try `UEFIShell.icns`, then `Shell.icns` (and then, by OC default behaviour, `Tool.icns`, then `HardDrive.icns`)
- _**NB**: Including **UEFIShell** anywhere in the flavour triggers picker audio-assist for "UEFI Shell"_
- _**Note**: Including **UEFIShell** anywhere in the flavour triggers picker audio-assist for "UEFI Shell"_
- **OpenShell:UEFIShell:Shell** - Themed specifically for OpenCore OpenShell (which is a variant of the EDK II UEFI Shell)
- This is the recommended flavour to use for `OpenShell.efi`, as is done in the sample config files
- Although this is the recommended *flavour*, icon artists are not required to provide this icon file, since this flavour will automatically find and use `Shell.icns` or `UEFIShell.icns` anyway
Expand All @@ -155,11 +155,11 @@ If providing `NVRAMTool.icns`, it should be themed so that it could be applied t
- **ResetNVRAM:NVRAMTool** - Reset NVRAM tool (`ResetNVRAM.icns`)
- This is the recommended flavour, used for the entry created by the `ResetNvramEntry.efi` driver.
- As another example of how flavours work: **ResetNVRAM:NVRAMTool** will look for `ResetNVRAM.icns`, then `NVRAMTool.icns` (and then, by OC default behaviour, `Tool.icns` then `HardDrive.icns`)
- **NB**: Including **ResetNVRAM** anywhere in a user flavour triggers picker audio-assist and builtin label support for "Reset NVRAM"
- **Note**: Including **ResetNVRAM** anywhere in a user flavour triggers picker audio-assist and builtin label support for "Reset NVRAM"
- **ToggleSIP:NVRAMTool** - Icon themed for Toggle SIP tool (`ToggleSIP.icns`)
- **ToggleSIP_Enabled:ToggleSIP:NVRAMTool** - Icon themed for Toggle SIP tool when SIP is enabled (system is protected)
- **ToggleSIP_Disabled:ToggleSIP:NVRAMTool** - Icon themed for Toggle SIP tool when SIP is disabled (system is unprotected)
- **NB**: Including **ToggleSIP_Enabled** or **ToggleSIP_Disabled** anywhere in a user flavour triggers picker audio-assist and builtin label support for the two states of the Toggle SIP menu entry
- **Note**: Including **ToggleSIP_Enabled** or **ToggleSIP_Disabled** anywhere in a user flavour triggers picker audio-assist and builtin label support for the two states of the Toggle SIP menu entry

### Other Tools

Expand Down
4 changes: 2 additions & 2 deletions Include/Acidanthera/Library/OcBootManagementLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -1837,7 +1837,7 @@ OcImageLoaderLoad (
include spaces, and '\' can be used within quoted or unquoted values to escape any
character (including space and '"').
NB Var names and values are left as pointers to within the original raw LoadOptions
Note: Var names and values are left as pointers to within the original raw LoadOptions
string, which may be modified during processing.
@param[in] LoadedImage Loaded image handle.
Expand Down Expand Up @@ -1867,7 +1867,7 @@ OcParseLoadOptions (
character (including space and double quote).
Comments (if any) run from hash symbol to end of same line.
NB Var names and values are left as pointers to within the raw string, which may
Note: Var names and values are left as pointers to within the raw string, which may
be modified during processing.
@param[in] StrVars Raw var string.
Expand Down
2 changes: 1 addition & 1 deletion Include/Acidanthera/Library/OcFileLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ OcEnsureDirectoryFile (
/**
Process directory item.
NB Successful processing must return EFI_SUCCESS or EFI_NOT_FOUND, or further
Note: Successful processing must return EFI_SUCCESS or EFI_NOT_FOUND, or further
processing will be aborted.
Return EFI_NOT_FOUND to continue processing but act if no file found.
Expand Down
2 changes: 1 addition & 1 deletion Include/Apple/IndustryStandard/AppleIntelCpuInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*
* These are meant to identify the CPU's marketing name - an
* application can map these to (possibly) localized strings.
* NB: the encodings of the CPU families are intentionally arbitrary.
* Note: the encodings of the CPU families are intentionally arbitrary.
* There is no ordering, and you should never try to deduce whether
* or not some feature is available based on the family.
* Use feature flags (eg, hw.optional.altivec) to test for optional
Expand Down
2 changes: 1 addition & 1 deletion Include/Apple/IndustryStandard/AppleSmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
// we define SMC_MAKE_IDENTIFIER to produce Little Endian keys in UEFI (EFIAPI),
// and Big Endian keys in all other places.
//
// NB: This code assumes Little Endian host byte order, which so far is the
// Note: This code assumes Little Endian host byte order, which so far is the
// only supported byte order in UEFI.
//
#ifdef EFIAPI
Expand Down
2 changes: 1 addition & 1 deletion Library/OcAppleKernelLib/LegacyBcopy.nasm
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Lbcopy:
; void *memcpy(void *dst, const void *src, size_t len)
; void *memmove(void *dst, const void *src, size_t len)
;
; NB: These need to be 32 bytes from bcopy().
; Note: These need to be 32 bytes from bcopy().
;------------------------------------------------------------------------------
align 32
Lmemcpy:
Expand Down
4 changes: 2 additions & 2 deletions Library/OcBootManagementLib/HotKeySupport.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ GetPickerKeyInfo (
}

//
// NB As historically SHIFT handling here is considered a 'hotkey':
// Note: As historically SHIFT handling here is considered a 'hotkey':
// it's original reason for being here is to fix difficulties in
// detecting this and other hotkey modifiers during no-picker boot.
//
Expand Down Expand Up @@ -792,7 +792,7 @@ OcInitHotKeys (
}

//
// NB Raw AKMA is also still used for HotKeys, since we really do need
// Note: Raw AKMA is also still used for HotKeys, since we really do need
// three different types of keys response for fluent UI behaviour.
//

Expand Down
2 changes: 1 addition & 1 deletion Platform/OpenLinuxBoot/LoaderEntry.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ typedef enum ENTRY_PARSE_STATE_ {
// First match, therefore Ubuntu should come after similar variants,
// and probably very short strings should come last in case they
// occur elsewhere in another kernel version string.
// NB: Should be kept in sync with Flavours.md.
// Note: Should be kept in sync with Flavours.md.
//
STATIC
CHAR8 *
Expand Down
5 changes: 1 addition & 4 deletions User/Library/UserMisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ CpuBreakpoint (
VOID
)
{
ASSERT (FALSE);

while (TRUE) {
}
abort ();
}

VOID
Expand Down
6 changes: 5 additions & 1 deletion User/Library/UserPcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@
**/

#include <UserPcd.h>
#include <Library/DebugLib.h>

#define _PCD_VALUE_PcdUefiLibMaxPrintBufferSize 320U
#define _PCD_VALUE_PcdUgaConsumeSupport ((BOOLEAN)1U)
#define _PCD_VALUE_PcdDebugPropertyMask 0x23U
#define _PCD_VALUE_PcdDebugPropertyMask (\
DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED \
| DEBUG_PROPERTY_DEBUG_PRINT_ENABLED \
| DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED )
#define _PCD_VALUE_PcdDebugClearMemoryValue 0xAFU
#define _PCD_VALUE_PcdFixedDebugPrintErrorLevel 0x80000002U
#define _PCD_VALUE_PcdDebugPrintErrorLevel 0x80000002U
Expand Down
Loading

0 comments on commit 2e40175

Please sign in to comment.