OpenCore
1.0.4
OpenCore Bootloader
|
#include <Base.h>
#include <Library/OcMainLib.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/OcAfterBootCompatLib.h>
#include <Library/OcAppleKernelLib.h>
#include <Library/OcMiscLib.h>
#include <Library/OcAppleImg4Lib.h>
#include <Library/OcStringLib.h>
#include <Library/OcVirtualFsLib.h>
#include <Library/PrintLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
Go to the source code of this file.
Functions | |
STATIC VOID | OcKernelConfigureCapabilities (IN OUT EFI_LOADED_IMAGE_PROTOCOL *LoadedImage, IN UINT32 Capabilities) |
STATIC VOID | OcKernelLoadAndReserveKext (IN OC_KERNEL_ADD_ENTRY *Kext, IN UINT32 Index, IN BOOLEAN IsForced, IN EFI_FILE_PROTOCOL *RootFile, IN OC_STORAGE_CONTEXT *Storage, IN OC_GLOBAL_CONFIG *Config, IN KERNEL_CACHE_TYPE CacheType, IN BOOLEAN Is32Bit, IN OUT UINT32 *ReservedExeSize, IN OUT UINT32 *ReservedInfoSize, IN OUT UINT32 *NumReservedKexts) |
STATIC EFI_STATUS | OcKernelLoadKextsAndReserve (IN EFI_FILE_PROTOCOL *RootFile, IN OC_STORAGE_CONTEXT *Storage, IN OC_GLOBAL_CONFIG *Config, IN KERNEL_CACHE_TYPE CacheType, IN BOOLEAN Is32Bit, OUT UINT32 *ReservedExeSize, OUT UINT32 *ReservedInfoSize, OUT UINT32 *NumReservedKexts) |
STATIC VOID | OcKernelInjectKext (IN OC_KERNEL_ADD_ENTRY *Kext, IN UINT32 Index, IN BOOLEAN IsForced, IN KERNEL_CACHE_TYPE CacheType, IN VOID *Context, IN UINT32 DarwinVersion, IN BOOLEAN Is32Bit) |
VOID | OcKernelInjectKexts (IN OC_GLOBAL_CONFIG *Config, IN KERNEL_CACHE_TYPE CacheType, IN VOID *Context, IN UINT32 DarwinVersion, IN BOOLEAN Is32Bit, IN UINT32 LinkedExpansion, IN UINT32 ReservedExeSize) |
EFI_STATUS | OcKernelProcessPrelinked (IN OC_GLOBAL_CONFIG *Config, IN UINT32 DarwinVersion, IN BOOLEAN Is32Bit, IN OUT UINT8 *Kernel, IN UINT32 *KernelSize, IN UINT32 AllocatedSize, IN UINT32 LinkedExpansion, IN UINT32 ReservedExeSize) |
STATIC EFI_STATUS | OcKernelProcessMkext (IN OC_GLOBAL_CONFIG *Config, IN UINT32 DarwinVersion, IN BOOLEAN Is32Bit, IN OUT UINT8 *Mkext, IN OUT UINT32 *MkextSize, IN UINT32 AllocatedSize) |
STATIC EFI_STATUS | OcKernelInitCacheless (IN OC_GLOBAL_CONFIG *Config, IN CACHELESS_CONTEXT *Context, IN UINT32 DarwinVersion, IN BOOLEAN Is32Bit, IN CHAR16 *FileName, IN EFI_FILE_PROTOCOL *ExtensionsDir, OUT EFI_FILE_PROTOCOL **File) |
STATIC EFI_STATUS | OcKernelReadAppleKernel (IN EFI_FILE_PROTOCOL *RootFile, IN EFI_FILE_PROTOCOL *KernelFile, IN CHAR16 *FileName, IN BOOLEAN Is32Bit, IN OUT UINT32 *DarwinVersion, OUT UINT8 **Kernel, OUT UINT32 *KernelSize, OUT UINT32 *AllocatedSize, OUT UINT32 *ReservedExeSize, OUT UINT32 *LinkedExpansion, OUT UINT8 *Digest OPTIONAL) |
STATIC EFI_STATUS | OcKernelFuzzyMatch (IN EFI_FILE_PROTOCOL *RootFile, IN CHAR16 *FileName, IN UINT64 OpenMode, IN UINT64 Attributes, IN BOOLEAN Is32Bit, IN OUT UINT32 *DarwinVersion, OUT EFI_FILE_PROTOCOL **KernelFile, OUT UINT8 **Kernel, OUT UINT32 *KernelSize, OUT UINT32 *AllocatedSize, OUT UINT32 *ReservedExeSize, OUT UINT32 *LinkedExpansion, OUT UINT8 *Digest OPTIONAL) |
STATIC EFI_STATUS EFIAPI | OcKernelFileOpen (IN EFI_FILE_PROTOCOL *This, OUT EFI_FILE_PROTOCOL **NewHandle, IN CHAR16 *FileName, IN UINT64 OpenMode, IN UINT64 Attributes) |
VOID | OcLoadKernelSupport (IN OC_STORAGE_CONTEXT *Storage, IN OC_GLOBAL_CONFIG *Config, IN OC_CPU_INFO *CpuInfo) |
VOID | OcUnloadKernelSupport (VOID) |
Variables | |
STATIC OC_STORAGE_CONTEXT * | mOcStorage |
STATIC OC_GLOBAL_CONFIG * | mOcConfiguration |
STATIC OC_CPU_INFO * | mOcCpuInfo |
STATIC UINT8 | mKernelDigest [SHA384_DIGEST_SIZE] |
STATIC UINT32 | mOcDarwinVersion |
STATIC BOOLEAN | mUse32BitKernel |
STATIC CACHELESS_CONTEXT | mOcCachelessContext |
STATIC BOOLEAN | mOcCachelessInProgress |
STATIC EFI_FILE_PROTOCOL * | mCustomKernelDirectory |
STATIC BOOLEAN | mCustomKernelDirectoryInProgress |
OpenCore driver.
Copyright (c) 2019, vit9696. All rights reserved.
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.
Definition in file OpenCoreKernel.c.
STATIC VOID OcKernelConfigureCapabilities | ( | IN OUT EFI_LOADED_IMAGE_PROTOCOL * | LoadedImage, |
IN UINT32 | Capabilities ) |
Definition at line 48 of file OpenCoreKernel.c.
STATIC EFI_STATUS EFIAPI OcKernelFileOpen | ( | IN EFI_FILE_PROTOCOL * | This, |
OUT EFI_FILE_PROTOCOL ** | NewHandle, | ||
IN CHAR16 * | FileName, | ||
IN UINT64 | OpenMode, | ||
IN UINT64 | Attributes ) |
Definition at line 1096 of file OpenCoreKernel.c.
STATIC EFI_STATUS OcKernelFuzzyMatch | ( | IN EFI_FILE_PROTOCOL * | RootFile, |
IN CHAR16 * | FileName, | ||
IN UINT64 | OpenMode, | ||
IN UINT64 | Attributes, | ||
IN BOOLEAN | Is32Bit, | ||
IN OUT UINT32 * | DarwinVersion, | ||
OUT EFI_FILE_PROTOCOL ** | KernelFile, | ||
OUT UINT8 ** | Kernel, | ||
OUT UINT32 * | KernelSize, | ||
OUT UINT32 * | AllocatedSize, | ||
OUT UINT32 * | ReservedExeSize, | ||
OUT UINT32 * | LinkedExpansion, | ||
OUT UINT8 *Digest | OPTIONAL ) |
Definition at line 972 of file OpenCoreKernel.c.
STATIC EFI_STATUS OcKernelInitCacheless | ( | IN OC_GLOBAL_CONFIG * | Config, |
IN CACHELESS_CONTEXT * | Context, | ||
IN UINT32 | DarwinVersion, | ||
IN BOOLEAN | Is32Bit, | ||
IN CHAR16 * | FileName, | ||
IN EFI_FILE_PROTOCOL * | ExtensionsDir, | ||
OUT EFI_FILE_PROTOCOL ** | File ) |
Definition at line 833 of file OpenCoreKernel.c.
STATIC VOID OcKernelInjectKext | ( | IN OC_KERNEL_ADD_ENTRY * | Kext, |
IN UINT32 | Index, | ||
IN BOOLEAN | IsForced, | ||
IN KERNEL_CACHE_TYPE | CacheType, | ||
IN VOID * | Context, | ||
IN UINT32 | DarwinVersion, | ||
IN BOOLEAN | Is32Bit ) |
Definition at line 550 of file OpenCoreKernel.c.
VOID OcKernelInjectKexts | ( | IN OC_GLOBAL_CONFIG * | Config, |
IN KERNEL_CACHE_TYPE | CacheType, | ||
IN VOID * | Context, | ||
IN UINT32 | DarwinVersion, | ||
IN BOOLEAN | Is32Bit, | ||
IN UINT32 | LinkedExpansion, | ||
IN UINT32 | ReservedExeSize ) |
Inject kexts.
Definition at line 685 of file OpenCoreKernel.c.
STATIC VOID OcKernelLoadAndReserveKext | ( | IN OC_KERNEL_ADD_ENTRY * | Kext, |
IN UINT32 | Index, | ||
IN BOOLEAN | IsForced, | ||
IN EFI_FILE_PROTOCOL * | RootFile, | ||
IN OC_STORAGE_CONTEXT * | Storage, | ||
IN OC_GLOBAL_CONFIG * | Config, | ||
IN KERNEL_CACHE_TYPE | CacheType, | ||
IN BOOLEAN | Is32Bit, | ||
IN OUT UINT32 * | ReservedExeSize, | ||
IN OUT UINT32 * | ReservedInfoSize, | ||
IN OUT UINT32 * | NumReservedKexts ) |
Definition at line 235 of file OpenCoreKernel.c.
STATIC EFI_STATUS OcKernelLoadKextsAndReserve | ( | IN EFI_FILE_PROTOCOL * | RootFile, |
IN OC_STORAGE_CONTEXT * | Storage, | ||
IN OC_GLOBAL_CONFIG * | Config, | ||
IN KERNEL_CACHE_TYPE | CacheType, | ||
IN BOOLEAN | Is32Bit, | ||
OUT UINT32 * | ReservedExeSize, | ||
OUT UINT32 * | ReservedInfoSize, | ||
OUT UINT32 * | NumReservedKexts ) |
Definition at line 471 of file OpenCoreKernel.c.
STATIC EFI_STATUS OcKernelProcessMkext | ( | IN OC_GLOBAL_CONFIG * | Config, |
IN UINT32 | DarwinVersion, | ||
IN BOOLEAN | Is32Bit, | ||
IN OUT UINT8 * | Mkext, | ||
IN OUT UINT32 * | MkextSize, | ||
IN UINT32 | AllocatedSize ) |
Definition at line 800 of file OpenCoreKernel.c.
EFI_STATUS OcKernelProcessPrelinked | ( | IN OC_GLOBAL_CONFIG * | Config, |
IN UINT32 | DarwinVersion, | ||
IN BOOLEAN | Is32Bit, | ||
IN OUT UINT8 * | Kernel, | ||
IN UINT32 * | KernelSize, | ||
IN UINT32 | AllocatedSize, | ||
IN UINT32 | LinkedExpansion, | ||
IN UINT32 | ReservedExeSize ) |
Process prelinked.
Definition at line 767 of file OpenCoreKernel.c.
STATIC EFI_STATUS OcKernelReadAppleKernel | ( | IN EFI_FILE_PROTOCOL * | RootFile, |
IN EFI_FILE_PROTOCOL * | KernelFile, | ||
IN CHAR16 * | FileName, | ||
IN BOOLEAN | Is32Bit, | ||
IN OUT UINT32 * | DarwinVersion, | ||
OUT UINT8 ** | Kernel, | ||
OUT UINT32 * | KernelSize, | ||
OUT UINT32 * | AllocatedSize, | ||
OUT UINT32 * | ReservedExeSize, | ||
OUT UINT32 * | LinkedExpansion, | ||
OUT UINT8 *Digest | OPTIONAL ) |
Definition at line 867 of file OpenCoreKernel.c.
VOID OcLoadKernelSupport | ( | IN OC_STORAGE_CONTEXT * | Storage, |
IN OC_GLOBAL_CONFIG * | Config, | ||
IN OC_CPU_INFO * | CpuInfo ) |
Load Kernel compatibility support like kexts.
[in] | Storage | OpenCore storage. |
[in] | Config | OpenCore configuration. |
[in] | CpuInfo | CPU information. |
Definition at line 1530 of file OpenCoreKernel.c.
VOID OcUnloadKernelSupport | ( | VOID | ) |
Cleanup Kernel compatibility support on failure.
Definition at line 1581 of file OpenCoreKernel.c.
STATIC EFI_FILE_PROTOCOL* mCustomKernelDirectory |
Definition at line 43 of file OpenCoreKernel.c.
STATIC BOOLEAN mCustomKernelDirectoryInProgress |
Definition at line 44 of file OpenCoreKernel.c.
STATIC UINT8 mKernelDigest[SHA384_DIGEST_SIZE] |
Definition at line 35 of file OpenCoreKernel.c.
STATIC CACHELESS_CONTEXT mOcCachelessContext |
Definition at line 40 of file OpenCoreKernel.c.
STATIC BOOLEAN mOcCachelessInProgress |
Definition at line 41 of file OpenCoreKernel.c.
STATIC OC_GLOBAL_CONFIG* mOcConfiguration |
Definition at line 33 of file OpenCoreKernel.c.
STATIC OC_CPU_INFO* mOcCpuInfo |
Definition at line 34 of file OpenCoreKernel.c.
STATIC UINT32 mOcDarwinVersion |
Definition at line 37 of file OpenCoreKernel.c.
STATIC OC_STORAGE_CONTEXT* mOcStorage |
Definition at line 32 of file OpenCoreKernel.c.
STATIC BOOLEAN mUse32BitKernel |
Definition at line 38 of file OpenCoreKernel.c.