Skip to content

Commit 5f5cacf

Browse files
committed
Docs: Finish writing documentation for Booter section and others
1 parent e611445 commit 5f5cacf

File tree

5 files changed

+368
-99
lines changed

5 files changed

+368
-99
lines changed

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ OpenCore Changelog
1616
- Significantly improved boot stability on APTIO
1717
- Added support for Windows & OpenCore on the same drive through `BlessOverride`
1818
- Added advanced user-specified boot entries through `Misc` -> `Entries`
19+
- Added `DisableVariableWrite` quirk to disable hardware NVRAM write in macOS
1920

2021
#### v0.0.3
2122
- Added complete modern platform database (2012+)

Docs/Configuration.pdf

5.56 KB
Binary file not shown.

Docs/Configuration.tex

Lines changed: 154 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,6 @@ \subsection{Contribution}\label{configuration-comp}
554554
-I/UefiPackages/EfiPkg
555555
-I/UefiPackages/EfiPkg/Include
556556
-I/UefiPackages/EfiPkg/Include/X64
557-
-I/UefiPackages/AptioFixPkg/Include
558557
-I/UefiPackages/AppleSupportPkg/Include
559558
-I/UefiPackages/OpenCorePkg/Include
560559
-I/UefiPackages/OcSupportPkg/Include
@@ -939,6 +938,59 @@ \subsection{Introduction}\label{booterintro}
939938
which is no longer maintained. See \hyperref[troubleshootingtricks]{Tips and Tricks}
940939
section for migration steps.
941940

941+
If you are using this for the first time on a customised firmware, there is a
942+
list of checks to do first. Prior to starting please ensure that you have:
943+
944+
\begin{itemize}
945+
\tightlist
946+
\item Most up-to-date UEFI firmware (check your motherboard vendor website).
947+
\item \texttt{Fast Boot} and \texttt{Hardware Fast Boot} disabled in firmware
948+
settings if present.
949+
\item \texttt{Above 4G Decoding} or similar enabled in firmware
950+
settings if present. Note, that on some motherboards (notably ASUS WS-X299-PRO) this
951+
option causes adverse effects, and must be disabled. While no other motherboards
952+
with the same issue are known, consider this option to be first to check if you
953+
have erratic boot failures.
954+
\item \texttt{DisableIoMapper} quirk enabled, or \texttt{VT-d} disabled in
955+
firmware settings if present, or ACPI DMAR table dropped.
956+
\item \textbf{No} `slide` boot argument present in NVRAM or anywhere else.
957+
It is not necessary unless you cannot boot at all or see
958+
\texttt{No slide values are usable! Use custom slide!} message in the log.
959+
\item \texttt{CFG Lock} (MSR \texttt{0xE2} write protection) disabled in
960+
firmware settings if present. Cconsider
961+
\href{https://github.com/LongSoft/UEFITool/blob/master/UEFIPatch/patches.txt}{patching it}
962+
if you have enough skills and no option is available. See
963+
\href{https://github.com/acidanthera/AppleSupportPkg#verifymsre2}{VerifyMsrE2}
964+
nots for more details.
965+
\item \texttt{CSM} (Compatibility Support Module) disabled in firmware settings
966+
if present. You may need to flash GOP ROM on NVIDIA 6xx/AMD 2xx or older. Use
967+
\href{https://www.win-raid.com/t892f16-AMD-and-Nvidia-GOP-update-No-requests-DIY.html#msg15730}{GopUpdate}
968+
or \href{http://www.insanelymac.com/forum/topic/299614-asus-eah6450-video-bios-uefi-gop-upgrade-and-gop-uefi-binary-in-efi-for-many-ati-cards/page-1#entry2042163}{AMD UEFI GOP MAKER}
969+
in case you are not sure how.
970+
\item \texttt{EHCI/XHCI Hand-off} enabled in firmware settings \texttt{only} if boot
971+
stalls unless USB devices are disconnected.
972+
\item \texttt{VT-x}, \texttt{Hyper Threading}, \texttt{Execute Disable Bit} enabled
973+
in firmware settings if present.
974+
\item While it may not be required, sometimes you have to disable
975+
\texttt{Thunderbolt support}, \texttt{Intel SGX}, and \texttt{Intel Platform Trust}
976+
in firmware settings present.
977+
\end{itemize}
978+
979+
When debugging sleep issues you may want to (temporarily) disable Power Nap and
980+
automatic power off, which appear to sometimes cause wake to black screen or boot loop
981+
issues on older platforms. The particular issues may vary, but in general you should
982+
check ACPI tables first. Here is an example of a bug found in some
983+
\href{http://www.insanelymac.com/forum/topic/329624-need-cmos-reset-after-sleep-only-after-login/#entry2534645}{Z68 motherboards}.
984+
To turn Power Nap and the others off run the following commands in Terminal:
985+
\begin{lstlisting}[label=powernap, style=ocbash]
986+
sudo pmset autopoweroff 0
987+
sudo pmset powernap 0
988+
sudo pmset standby 0
989+
\end{lstlisting}
990+
991+
\emph{Note}: these settings may reset at hardware change and in certain other circumstances.
992+
To view their current state use \texttt{pmset -g} command in Terminal.
993+
942994
\subsection{Properties}\label{booterprops}
943995

944996
\begin{enumerate}
@@ -1094,7 +1146,8 @@ \subsection{Quirks Properties}\label{booterpropsquirks}
10941146
contiguous slots of similar types to prevent boot failures.
10951147

10961148
\emph{Note}: The necessity of this quirk is determined by early boot failures.
1097-
Do not use this unless you fully understand the consequences.
1149+
It is rare to need this quirk on Haswell or newer. Do not use unless you fully
1150+
understand the consequences.
10981151

10991152
\end{enumerate}
11001153

@@ -1263,7 +1316,7 @@ \subsection{Add Properties}\label{kernelpropsadd}
12631316
\texttt{MatchKernel}\\
12641317
\textbf{Type}: \texttt{plist\ string}\\
12651318
\textbf{Failsafe}: Empty string\\
1266-
\textbf{Description}: Blocks kernel driver on selected macOS version only.
1319+
\textbf{Description}: Adds kernel driver on selected macOS version only.
12671320
The selection happens based on prefix match with the kernel version, i.e.
12681321
\texttt{16.7.0} will match macOS 10.12.6 and \texttt{16.} will match
12691322
any macOS 10.12.x version.
@@ -1558,12 +1611,33 @@ \subsection{Properties}\label{miscprops}
15581611
\textbf{Description}: Apply boot configuration described in
15591612
\hyperref[miscbootprops]{Boot Properties} section below.
15601613

1614+
\item
1615+
\texttt{BlessOverride}\\
1616+
\textbf{Type}: \texttt{plist\ array}\\
1617+
\textbf{Description}: Add custom scanning paths through bless model.
1618+
1619+
Designed to be filled with \texttt{plist\ string} entries containing
1620+
absolute UEFI paths to customised bootloaders, for example,
1621+
\texttt{\textbackslash EFI\textbackslash Microsoft\textbackslash bootmgfw.efi}
1622+
for Microsoft bootloader. This allows unusual boot paths to be automaticlly
1623+
discovered by the boot picker. Designwise they are equivalent to predefined blessed path, such as
1624+
\texttt{\textbackslash System\textbackslash Library\textbackslash CoreServices\textbackslash boot.efi},
1625+
but unlike predefined bless paths they have highest priority.
1626+
15611627
\item
15621628
\texttt{Debug}\\
15631629
\textbf{Type}: \texttt{plist\ dict}\\
15641630
\textbf{Description}: Apply debug configuration described in
15651631
\hyperref[miscdebugprops]{Debug Properties} section below.
15661632

1633+
\item
1634+
\texttt{Entries}\\
1635+
\textbf{Type}: \texttt{plist\ array}\\
1636+
\textbf{Description}: Add boot entries to boot picker.
1637+
1638+
Designed to be filled with \texttt{plist\ dict} values, describing each load entry.
1639+
See \hyperref[miscentryprops]{Entry Properties} section below.
1640+
15671641
\item
15681642
\texttt{Security}\\
15691643
\textbf{Type}: \texttt{plist\ dict}\\
@@ -1573,10 +1647,10 @@ \subsection{Properties}\label{miscprops}
15731647
\item
15741648
\texttt{Tools}\\
15751649
\textbf{Type}: \texttt{plist\ array}\\
1576-
\textbf{Description}: Add new entries to boot picker.
1650+
\textbf{Description}: Add tool entries to boot picker.
15771651

1578-
Designed to be filled with \texttt{plist\ dict} values, describing each block entry.
1579-
See \hyperref[misctoolprops]{Tools Properties} section below.
1652+
Designed to be filled with \texttt{plist\ dict} values, describing each load entry.
1653+
See \hyperref[miscentryprops]{Entry Properties} section below.
15801654

15811655
\emph{Note}: Select tools, for example,
15821656
\href{https://github.com/acidanthera/OpenCoreShell}{UEFI Shell} or
@@ -1684,7 +1758,7 @@ \subsection{Boot Properties}\label{miscbootprops}
16841758

16851759
\begin{itemize}
16861760
\tightlist
1687-
\item Set to \texttt{WxH@Bpp} (e.g. \texttt{1920x1080@32}) \texttt{WxH}
1761+
\item Set to \texttt{WxH@Bpp} (e.g. \texttt{1920x1080@32}) or \texttt{WxH}
16881762
(e.g. \texttt{1920x1080}) formatted string to request custom resolution
16891763
from GOP if available.
16901764
\item Set to empty string not to change screen resolution.
@@ -2020,7 +2094,7 @@ \subsection{Security Properties}\label{miscsecurityprops}
20202094

20212095
\end{enumerate}
20222096

2023-
\subsection{Tools Properties}\label{misctoolprops}
2097+
\subsection{Entry Properties}\label{miscentryprops}
20242098

20252099
\begin{enumerate}
20262100
\item
@@ -2035,21 +2109,30 @@ \subsection{Tools Properties}\label{misctoolprops}
20352109
\texttt{Enabled}\\
20362110
\textbf{Type}: \texttt{plist\ boolean}\\
20372111
\textbf{Failsafe}: \texttt{false}\\
2038-
\textbf{Description}: This tool will not be listed unless set to
2112+
\textbf{Description}: This entry will not be listed unless set to
20392113
\texttt{true}.
20402114

20412115
\item
20422116
\texttt{Name}\\
20432117
\textbf{Type}: \texttt{plist\ string}\\
20442118
\textbf{Failsafe}: Empty string\\
2045-
\textbf{Description}: Human readable tool name displayed in boot picker.
2119+
\textbf{Description}: Human readable entry name displayed in boot picker.
20462120

20472121
\item
20482122
\texttt{Path}\\
20492123
\textbf{Type}: \texttt{plist\ string}\\
20502124
\textbf{Failsafe}: Empty string\\
2051-
\textbf{Description}: File path to select UEFI tool relative to \texttt{OC/Tools}
2052-
directory.
2125+
\textbf{Description}: Entry location depending on entry type.
2126+
2127+
\begin{itemize}
2128+
\tightlist
2129+
\item \texttt{Entries} specify external boot options, and therefore take device
2130+
paths in \texttt{Path} key. These values are not checked, thus be extremely careful.
2131+
Example: \texttt{PciRoot(0x0)/Pci(0x1,0x1)/.../\textbackslash EFI\textbackslash COOL.EFI}
2132+
\item \texttt{Tools} specify internal boot options, which are part of bootloader
2133+
vault, and therefore take file paths relative to \texttt{OC/Tools} directory.
2134+
Example: \texttt{CleanNvram.efi}.
2135+
\end{itemize}
20532136

20542137
\end{enumerate}
20552138

@@ -2281,21 +2364,31 @@ \subsection{Other Variables}\label{nvramvarsother}
22812364
\item \texttt{acpi\_level=0xFFFF5F} (implies
22822365
\href{https://github.com/acpica/acpica/blob/master/source/include/acoutput.h}
22832366
{\texttt{ACPI\_ALL\_COMPONENTS}})
2284-
\item \texttt{cpus=VALUE}
2285-
\item \texttt{debug=VALUE}
2286-
\item \texttt{io=VALUE}
2287-
\item \texttt{keepsyms=1}
2288-
\item \texttt{kextlog=VALUE}
2289-
\item \texttt{nvda\_drv=1}
2367+
\item \texttt{batman=VALUE} (\texttt{AppleSmartBatteryManager} debug mask)
2368+
\item \texttt{batman-nosmc=1} (disable \texttt{AppleSmartBatteryManager} SMC interface)
2369+
\item \texttt{cpus=VALUE} (maximum number of CPUs used)
2370+
\item \texttt{debug=VALUE} (debug mask)
2371+
\item \texttt{io=VALUE} (\texttt{IOKit} debug mask)
2372+
\item \texttt{keepsyms=1} (show panic log debug symbols)
2373+
\item \texttt{kextlog=VALUE} (kernel extension loading debug mask)
2374+
\item \texttt{nv\_disable=1} (disables NVIDIA GPU acceleration)
2375+
\item \texttt{nvda\_drv=1} (legacy way to enable NVIDIA web driver, removed in 10.12)
2376+
\item \texttt{npci=0x2000} (\href{https://www.insanelymac.com/forum/topic/260539-1068-officially-released/?do=findComment&comment=1707972}{legacy}, disables \texttt{kIOPCIConfiguratorPFM64})
22902377
\item \texttt{lapic\_dont\_panic=1}
2291-
\item \texttt{slide=VALUE}
2378+
\item \texttt{slide=VALUE} (manually set KASLR slide)
2379+
\item \texttt{smcdebug=VALUE} (\texttt{AppleSMC} debug mask)
2380+
\item \texttt{-amd\_no\_dgpu\_accel} (alternative to \href{https://github.com/acidanthera/WhateverGreen}{WhateverGreen}'s \texttt{-radvesa} for new GPUs)
22922381
\item \texttt{-nehalem\_error\_disable}
2293-
\item \texttt{-no\_compat\_check}
2294-
\item \texttt{-s}
2295-
\item \texttt{-v}
2296-
\item \texttt{-x}
2382+
\item \texttt{-no\_compat\_check} (disable model checking)
2383+
\item \texttt{-s} (single mode)
2384+
\item \texttt{-v} (verbose mode)
2385+
\item \texttt{-x} (safe mode)
22972386
\end{itemize}
22982387

2388+
There are multiple external places summarising macOS argument lists:
2389+
\href{https://osxeon.wordpress.com/2015/08/10/boot-argument-options-in-os-x}{example 1},
2390+
\href{https://superuser.com/questions/255176/is-there-a-list-of-available-boot-args-for-darwin-os-x}{example 2}.
2391+
22992392
\item
23002393
\texttt{7C436110-AB2A-4BBB-A880-FE41995C9F82:bootercfg}
23012394
\break
@@ -3033,23 +3126,18 @@ \subsection{Properties}\label{uefiprops}
30333126
quirks, like \texttt{RequestBootVarRouting}, require this driver for proper function.
30343127
Due to the nature of being a runtime driver, i.e. functioning in parallel with the
30353128
target operating system, it cannot be implemented within OpenCore itself.
3036-
\item \href{https://github.com/tianocore/edk2/tree/UDK2018}{\texttt{EmuVariableRuntimeDxe}}
3037-
--- NVRAM emulation driver from \texttt{MdeModulePkg}. NVRAM is supported by most
3038-
modern firmwares. For firmwares with macOS incompatible NVRAM implementation an
3039-
emulated driver may be used. This driver will not preserve NVRAM contents across the
3040-
reboots.
3041-
\item \href{https://github.com/tianocore/edk2/tree/UDK2018}{\texttt{EnglishDxe}}
3129+
\item \href{https://github.com/acidanthera/audk}{\texttt{EnglishDxe}}
30423130
--- Unicode collation driver from \texttt{MdeModulePkg}. This driver is a lightweight
30433131
alternative to \texttt{AppleUiSupport}, which contains no Apple-specific code, and
30443132
only provides unicode collation support. The driver is not recommended for use
30453133
on any hardware but few original Macs.
3046-
\item \href{https://github.com/tianocore/edk2/tree/UDK2018}{\texttt{EnhancedFatDxe}}
3134+
\item \href{https://github.com/acidanthera/audk}{\texttt{EnhancedFatDxe}}
30473135
--- FAT filesystem driver from \texttt{FatPkg}. This driver is embedded in all
30483136
UEFI firmwares, and cannot be used from OpenCore. It is known that multiple firmwares
30493137
have a bug in their FAT support implementation, which leads to corrupted filesystems
30503138
on write attempt. Embedding this driver within the firmware may be required in case
30513139
writing to EFI partition is needed during the boot process.
3052-
\item \href{https://github.com/tianocore/edk2/tree/UDK2018}{\texttt{NvmExpressDxe}}
3140+
\item \href{https://github.com/acidanthera/audk}{\texttt{NvmExpressDxe}}
30533141
--- NVMe support driver from \texttt{MdeModulePkg}. This driver is included in most
30543142
firmwares starting with Broadwell generation. For Haswell and earlier embedding it
30553143
within the firmware may be more favourable in case a NVMe SSD drive is installed.
@@ -3068,16 +3156,16 @@ \subsection{Properties}\label{uefiprops}
30683156
a closed source \texttt{HFSPlus} driver commonly found in Apple firmwares. While
30693157
it is feature complete, it is approximately 3~times slower and is yet to undergo
30703158
a security audit.
3071-
\item \href{https://github.com/tianocore/edk2/tree/UDK2018}{\texttt{XhciDxe}}
3159+
\item \href{https://github.com/acidanthera/audk}{\texttt{XhciDxe}}
30723160
--- XHCI USB controller support driver from \texttt{MdeModulePkg}. This driver is
30733161
included in most firmwares starting with Sandy Bridge generation. For earlier firmwares
30743162
or legacy systems it may be used to support external USB 3.0 PCI cards.
30753163
\end{itemize}
30763164

3077-
To compile the drivers from TianoCore UDK use the same command you do normally use
3165+
To compile the drivers from UDK (EDK II) use the same command you do normally use
30783166
for OpenCore compilation, but choose a corresponding package:
30793167
\begin{lstlisting}[label=compileudk, style=ocbash]
3080-
git clone https://github.com/tianocore/edk2 -b UDK2018 UDK
3168+
git clone https://github.com/acidanthera/audk UDK
30813169
cd UDK
30823170
source edksetup.sh
30833171
make -C BaseTools
@@ -3154,8 +3242,11 @@ \subsection{Quirks Properties}\label{uefiquirkprops}
31543242
\textbf{Description}: Advises allocators to avoid allocations above first 4 GBs of RAM.
31553243

31563244
This is a workaround for select board firmwares, namely GA-Z77P-D3 (rev. 1.1), failing
3157-
to properly access higher memory in UEFI Boot Services. Not recommended unless required
3158-
for booting. May cause recovery boot failures on unaffected boards.
3245+
to properly access higher memory in UEFI Boot Services. On these boards this quirk is
3246+
required for booting entries that need to allocate large memory chunks, such as macOS DMG
3247+
recovery entries. On unaffected boards it may cause boot failures, and thus strongly not
3248+
recommended. For known issues refer to
3249+
\href{https://github.com/acidanthera/bugtracker/issues/449}{\texttt{acidanthera/bugtracker\#449}}.
31593250

31603251
\item
31613252
\texttt{ExitBootServicesDelay}\\
@@ -3247,11 +3338,13 @@ \subsection{Windows support}\label{troubleshootingwin}
32473338
above) prepared with Boot Camp are supposed to work. Third-party UEFI installations
32483339
as well as systems partially supporting UEFI boot, like Windows 7, might work with
32493340
some extra precautions. Things to keep in mind:
3250-
3341+
32513342
\begin{itemize}
32523343
\item MBR (Master Boot Record) installations are legacy and will not be supported.
3253-
\item Installing Windows and macOS on the same drive is currently unsupported but
3254-
will be addressed later.
3344+
\item To install Windows, macOS, and OpenCore on the same drive you can specify
3345+
Windows bootloader path
3346+
(\texttt{\textbackslash EFI\textbackslash Microsoft\textbackslash bootmgfw.efi})
3347+
in \texttt{BlessOverride} section.
32553348
\item All the modifications applied (to ACPI, NVRAM, SMBIOS, etc.) are supposed
32563349
to be operating system agnostic, i.e. apply equally regardless of the OS booted.
32573350
This enables Boot Camp software experience on Windows.
@@ -3288,7 +3381,7 @@ \subsection{Windows support}\label{troubleshootingwin}
32883381

32893382
While Windows support software from Boot Camp solves most of compatibility problems,
32903383
sometimes you may have to address some of them manually:
3291-
3384+
32923385
\begin{itemize}
32933386
\item To invert mouse wheel scroll direction \texttt{FlipFlopWheel} must be set
32943387
to \texttt{1} as explained on \href{https://superuser.com/a/364353}{SuperUser}.
@@ -3461,6 +3554,27 @@ \subsection{Tips and Tricks}\label{troubleshootingtricks}
34613554
thus not implemented. More detailed explanation can be found on
34623555
\href{https://applelife.ru/posts/819790}{AppleLife.ru}.
34633556

3557+
\item
3558+
\textbf{How can I migrate from \texttt{AptioMemoryFix}?}
3559+
3560+
Behaviour similar to that of \texttt{AptioMemoryFix} can be obtained by
3561+
installing \texttt{FwRuntimeServices} driver and enabling the quirks listed below.
3562+
Please note, that most of these are not necessary to be enabled. Refer to their
3563+
individual descriptions in this document for more details.
3564+
\begin{itemize}
3565+
\tightlist
3566+
\item \texttt{ProvideConsoleGop} (UEFI quirk)
3567+
\item \texttt{AvoidRuntimeDefrag}
3568+
\item \texttt{DiscardHibernateMap}
3569+
\item \texttt{EnableSafeModeSlide}
3570+
\item \texttt{EnableWriteUnprotector}
3571+
\item \texttt{ForceExitBootServices}
3572+
\item \texttt{ProtectCsmRegion}
3573+
\item \texttt{ProvideCustomSlide}
3574+
\item \texttt{SetupVirtualMap}
3575+
\item \texttt{ShrinkMemoryMap}
3576+
\end{itemize}
3577+
34643578
\end{enumerate}
34653579

34663580
\end{document}

Docs/Differences/Differences.pdf

17.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)