# OpenCore Debugging
Needing to figure out why you're getting issues or stalling? Well, you've come to the right place:
# File Swaps
To start, make sure you're using either the DEBUG
or NOOPT
versions of OpenCore. This will provide much more info than the RELEASE
version, the specific files that need to be swapped:
- EFI/BOOT/
BOOTx64.efi
- EFI/OC/Drivers/
OpenRuntime.efi
OpenCanopy.efi
(if you're using it)
- EFI/OC/
OpenCore.efi
- Note: Generally best to debug systems without OpenCanopy, if required make sure this file is from DEBUG else there will be virtually no debug information.
# Config Changes
Next, head to your config.plist and locate the Misc
> Debug
section, we have a couple entries we'll want to play with here:
# Misc > Debug
Here we'll want to enable the following:
AppleDebug: YES
- Provides much more debugging information, specifically relating to boot.efi and will also store the log to disk.
ApplePanic: YES
- This will allow kernel panics to be stored to disk, highly recommend keeping
keepsyms=1
in boot-args to preserve as much info as possible.
- This will allow kernel panics to be stored to disk, highly recommend keeping
DisableWatchdog: YES
- Disables the UEFI watchdog, used for when OpenCore is stalling on something non-critical.
Target:
67
(or calculate one below)- Used for enabling different levels of debugging
Value | Comment |
---|---|
0x01 | Enable Logging |
0x02 | Enable Onscreen debug |
0x04 | Enable logging to Data Hub. |
0x08 | Enable serial port logging. |
0x10 | Enable UEFI variable logging. |
0x20 | Enable non-volatile UEFI variable logging. |
0x40 | Enable logging to file. |
To calculate the target, we can use a hex calculator and then convert it to decimal. For us we want to have our values on stored onto a .txt file for later viewing:
0x01
— Enable Logging0x02
— Enable on-screen debug- Note this can heavily increase boot times on firmwares with poor GOP implementations
0x40
— Enable logging to file
0x01
+ 0x02
+ 0x40
= 0x43
0x43
converted to decimal becomes 67
So we can set Misc
-> Debug
-> Target
-> 67
- DisplayLevel:
2147483714
(or calculate one below)- Used for setting what is logged
Value | Comment |
---|---|
0x00000002 | DEBUG_WARN in DEBUG, NOOPT, RELEASE. |
0x00000040 | DEBUG_INFO in DEBUG, NOOPT. |
0x00400000 | DEBUG_VERBOSE in custom builds. |
0x80000000 | DEBUG_ERROR in DEBUG, NOOPT, RELEASE. |
A full list can be found in DebugLib.h (opens new window).
For us we just want the following:
0x00000002
— DEBUG_WARN in DEBUG, NOOPT, RELEASE.0x00000040
— DEBUG_INFO in DEBUG, NOOPT.0x80000000
— DEBUG_ERROR in DEBUG, NOOPT, RELEASE.
Just like with Target
, we use a hex calculator then convert to decimal:
0x80000042
Converted to decimal becomes 2147483714
Misc
-> Debug
-> DisplayLevel
-> 2147483714
Once done, your config.plist should look like this:
# Disabling all logging
To remove all file logging, and debug messages, simply swap out all your OpenCore files for those in RELEASE like we did before in File Swap section.
Lastly, to remove writing to disk set the following:
- AppleDebug =
NO
- ApplePanic =
NO
- Target =
0