OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
ProcessKernel.c File Reference
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/OcTemplateLib.h>
#include <Library/OcSerializeLib.h>
#include <Library/OcMiscLib.h>
#include <Library/OcAppleKernelLib.h>
#include <Library/OcConfigurationLib.h>
#include <Library/OcMainLib.h>
#include <UserFile.h>

Go to the source code of this file.

Macros

#define OC_USER_FULL_PATH_MAX_SIZE   256
 

Functions

STATIC BOOLEAN UserSetRootPath (IN CONST CHAR8 *RootPath)
 
STATIC UINT8 * UserReadFileFromRoot (IN CONST CHAR8 *FileName, OUT UINT32 *Size)
 
STATIC VOID AsciiHostSlashes (IN OUT CHAR8 *String)
 
STATIC EFI_STATUS UserOcKernelLoadAndReserveKext (IN OC_KERNEL_ADD_ENTRY *Kext, IN UINT32 Index, IN OC_GLOBAL_CONFIG *Config, IN BOOLEAN Is32Bit, IN OUT UINT32 *ReservedExeSize, IN OUT UINT32 *ReservedInfoSize, IN OUT UINT32 *NumReservedKexts)
 
EFI_STATUS OcGetFileData (IN EFI_FILE_PROTOCOL *File, IN UINT32 Position, IN UINT32 Size, OUT UINT8 *Buffer)
 
EFI_STATUS OcGetFileSize (IN EFI_FILE_PROTOCOL *File, OUT UINT32 *Size)
 
int WrapMain (int argc, char *argv[])
 
int main (int argc, char *argv[])
 

Variables

STATIC CHAR8 mFullPath [OC_USER_FULL_PATH_MAX_SIZE] = { 0 }
 
STATIC UINTN mRootPathLen = 0
 
STATIC BOOLEAN FailedToProcess = FALSE
 
STATIC UINT32 KernelVersion = 0
 
STATIC EFI_FILE_PROTOCOL NilFileProtocol
 
STATIC UINT8 * mPrelinked = NULL
 
STATIC UINT32 mPrelinkedSize = 0
 

Detailed Description

Copyright (C) 2022, Marvin Haeuser. All rights reserved. Copyright (C) 2022, PMheart. All rights reserved.

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 ProcessKernel.c.

Macro Definition Documentation

◆ OC_USER_FULL_PATH_MAX_SIZE

#define OC_USER_FULL_PATH_MAX_SIZE   256

Definition at line 28 of file ProcessKernel.c.

Function Documentation

◆ AsciiHostSlashes()

STATIC VOID AsciiHostSlashes ( IN OUT CHAR8 * String)

Definition at line 91 of file ProcessKernel.c.

◆ main()

int main ( int argc,
char * argv[] )

Definition at line 501 of file ProcessKernel.c.

◆ OcGetFileData()

EFI_STATUS OcGetFileData ( IN EFI_FILE_PROTOCOL * File,
IN UINT32 Position,
IN UINT32 Size,
OUT UINT8 * Buffer )

Read exact amount of bytes from EFI_FILE_PROTOCOL at specified position.

Parameters
[in]FileA pointer to the file protocol.
[in]PositionPosition to read data from.
[in]SizeThe size of the data read.
[out]BufferA pointer to previously allocated buffer to read data to.
Return values
EFI_SUCCESSon success.

Definition at line 282 of file ProcessKernel.c.

◆ OcGetFileSize()

EFI_STATUS OcGetFileSize ( IN EFI_FILE_PROTOCOL * File,
OUT UINT32 * Size )

Determine file size if it is less than 4 GB.

Parameters
[in]FileA pointer to the file protocol.
[out]Size32-bit file size.
Return values
EFI_SUCCESSon success.

Definition at line 300 of file ProcessKernel.c.

◆ UserOcKernelLoadAndReserveKext()

STATIC EFI_STATUS UserOcKernelLoadAndReserveKext ( IN OC_KERNEL_ADD_ENTRY * Kext,
IN UINT32 Index,
IN OC_GLOBAL_CONFIG * Config,
IN BOOLEAN Is32Bit,
IN OUT UINT32 * ReservedExeSize,
IN OUT UINT32 * ReservedInfoSize,
IN OUT UINT32 * NumReservedKexts )

Definition at line 105 of file ProcessKernel.c.

◆ UserReadFileFromRoot()

STATIC UINT8 * UserReadFileFromRoot ( IN CONST CHAR8 * FileName,
OUT UINT32 * Size )

Definition at line 68 of file ProcessKernel.c.

◆ UserSetRootPath()

STATIC BOOLEAN UserSetRootPath ( IN CONST CHAR8 * RootPath)

Definition at line 35 of file ProcessKernel.c.

◆ WrapMain()

int WrapMain ( int argc,
char * argv[] )

Definition at line 312 of file ProcessKernel.c.

Variable Documentation

◆ FailedToProcess

STATIC BOOLEAN FailedToProcess = FALSE

Definition at line 78 of file ProcessKernel.c.

◆ KernelVersion

STATIC UINT32 KernelVersion = 0

Definition at line 79 of file ProcessKernel.c.

◆ mFullPath

STATIC CHAR8 mFullPath[OC_USER_FULL_PATH_MAX_SIZE] = { 0 }

Definition at line 30 of file ProcessKernel.c.

◆ mPrelinked

STATIC UINT8* mPrelinked = NULL

Definition at line 83 of file ProcessKernel.c.

◆ mPrelinkedSize

STATIC UINT32 mPrelinkedSize = 0

Definition at line 84 of file ProcessKernel.c.

◆ mRootPathLen

STATIC UINTN mRootPathLen = 0

Definition at line 31 of file ProcessKernel.c.

◆ NilFileProtocol

STATIC EFI_FILE_PROTOCOL NilFileProtocol

Definition at line 81 of file ProcessKernel.c.