Source: Hackintosh-forum.de

I have written kernel patches one time or another in the past, mostly in relation to ozmosis. Since I released KextInjection Patches using the Clover / Ozmosis (general KernelBooterExtension-) method with the release of Big Sur, I thought I would just implement them in Clover and see if Clover could handle Big Sur. I did a couple of tests with CMMChris on Hackintosh-forum.de and after a few tries it was possible to boot from Big Sur’s existing installation.

Then I tried to install the necessary mechanisms in Clover. Unfortunately I have not been able to bring the internal mechanisms that broke with Big Sur back to life until now. Since I have never really dealt with Clover, in particular Clover source code and the latter is unfortunately more than unstructured, I lack the insight to implement a clean and permanent solution in Clover. I think this requires the work of long-time Clover Devs who know their own code. Nevertheless, I want to publish the interim results here so that others can build on it and everyone who wants to test a little.

Technical background:

The clover version in the appendix automatically sets the NVRam variables booter-fileset-kerneland booter-fileset-basesystemwhen booting macOS Big Sur , so that the prelinked kernel is automatically forced when booting an existing installation of Big Sur. It is not possible to boot an installer because there is no suitable prelinkedkernel and can be loaded in this way. Even with a forced prelinked kernel, unfortunately Clovers internal kernel booter extension patches fail, according to my tests the procedure is not started because OnExitBootServicesthe tests probably do not occur. If the KernelPatcher is forced without an event, the kernel is not found. What works, however, are user kernel patches. That’s why I provide the necessary KernelBooterExtension patches for Big SurKernelToPatchEntries ready. If necessary, the patches could still be implemented based on symbols. In the attached Clover version, the actual internal patching mechanisms for the boot of Big Sur (10.16) are deactivated in order to avoid duplications.

All patches search for the beginning of the corresponding procedure and then for the appropriate patching location. All patches are also implemented with simple wildcards.

KbeBS-EXT searches for readStartupExtensions (010031FFBE140005), the patch reads:

E8 ?? 00 00 00 EB 05 E8 ->

E8 ?? 00 00 00 90 90 E8.

KbeBS- SIP searches for loadExecutable (02000041BF010000DC), the patch reads:

E8 ?? ?? ?? 00 85 C0 0F 84 ?? 00 00 00 49 8B 45 ->

E8 ?? ?? ?? 00 85 C0 90 90 90 90 90 90 49 8B 45.

KbeBS-KxldUnmap looks for removeKextBootstrap (488D152B262500), the patch is:

FF 80 3D ?? ?? ?? 00 00 0F 85 ?? 01 00 00 41 ->

FF 80 3D ?? ?? ?? 00 00 90 E9 ?? 01 00 00 41.

Furthermore, the use of OCQuirks is a mandatory prerequisite for booting Big Sur, as any old AptioFix variants are not compatible. The latest OCQuirks release contains changes to AvoidRuntimeDefrag , without which it is not possible to boot macOS Big Sur 10.16 / 11.

Use:

  • Replace CLOVERX64.efi (r5119 Mod) on the EFI with the appendix
  • Insert the following KernelToPatch entries into the config.plist: (Who doesn’t know how to do this is out of place – sorry)

Link to Clover Package

<key>KernelAndKextPatches</key>
    <dict>
        <key>KernelToPatch</key>
        <array>
            <dict>
                <key>Comment</key>
                <string>KbeBS-EXT (kuckkuck)</string>
                <key>Count</key>
                <integer>1</integer>
                <key>Disabled</key>
                <false/>
                <key>Find</key>
                <data>
                6NQAAADrBeg=
                </data>
                <key>MaskFind</key>
                <data>
                /wD///////8=
                </data>
                <key>MaskReplace</key>
                <data>
                AAAAAAD///8=
                </data>
                <key>MatchOS</key>
                <string>10.16</string>
                <key>Replace</key>
                <data>
                6NQAAACQkOg=
                </data>
                <key>StartPattern</key>
                <data>
                AQAx/74UAAU=
                </data>
            </dict>
            <dict>
                <key>Comment</key>
                <string>KbeBS-SIP (kuckkuck)</string>
                <key>Count</key>
                <integer>1</integer>
                <key>Disabled</key>
                <false/>
                <key>Find</key>
                <data>
                6HXmDgCFwA+E+gAAAEmLRQ==
                </data>
                <key>MaskFind</key>
                <data>
                /wAAAP//////AP///////w==
                </data>
                <key>MaskReplace</key>
                <data>
                AAAAAAAAAP///////wAAAA==
                </data>
                <key>MatchOS</key>
                <string>10.16</string>
                <key>Replace</key>
                <data>
                6HXmDgCFwJCQkJCQkEmLRQ==
                </data>
                <key>StartPattern</key>
                <data>
                AgAAQb8BAADc
                </data>
            </dict>
            <dict>
                <key>Comment</key>
                <string>KbeBS-KxldUnmap (vit9696, kuckkuck)</string>
                <key>Count</key>
                <integer>1</integer>
                <key>Disabled</key>
                <false/>
                <key>Find</key>
                <data>
                /4A9JZxOAAAPhRcBAABB
                </data>
                <key>MaskFind</key>
                <data>
                ////AAAA/////wD/////
                </data>
                <key>MaskReplace</key>
                <data>
                AAAAAAAAAAD//wAAAAAA
                </data>
                <key>MatchOS</key>
                <string>10.16</string>
                <key>Replace</key>
                <data>
                /4A9JZxOAACQ6RcBAABB
                </data>
                <key>StartPattern</key>
                <data>
                SI0VKyYlAA==
                </data>
            </dict>
        </array>
    </dict>
  • Replace any used OsxAptioFix.efi or AptioMemoryFix.efi UEFI drivers with the latest OCQuirks release and place OCQuirks.efi, OpenRuntime.efi and OcQuirks.plist in / Clover / drivers / UEFI.

Only existing Big Sur installations can be booted. Big Sur cannot be installed by installer.

Have fun testing and otherwise wait and see when something comes from the Clover developers.