OpenCore
1.0.4
OpenCore Bootloader
|
#include <Protocol/AppleFramebufferInfo.h>
#include <Protocol/AppleEg2Info.h>
#include <Protocol/ConsoleControl.h>
#include <Protocol/GraphicsOutput.h>
#include <Library/OcBootManagementLib.h>
#include <Library/OcFileLib.h>
Go to the source code of this file.
Data Structures | |
struct | _OC_CONSOLE_FONT_PAGE |
struct | _OC_CONSOLE_FONT |
struct | _OC_CONSOLE_FONT_RANGE |
Macros | |
#define | OC_CONSOLE_MARK_UNCONTROLLED L"MarkUncontrolled" |
#define | ISO_CHAR_WIDTH (8u) |
#define | ISO_CHAR_HEIGHT (16u) |
#define | OC_CONSOLE_FONT_FALLBACK_CHAR (L'_') |
Typedefs | |
typedef struct _OC_CONSOLE_FONT_PAGE | OC_CONSOLE_FONT_PAGE |
typedef struct _OC_CONSOLE_FONT | OC_CONSOLE_FONT |
typedef struct _OC_CONSOLE_FONT_RANGE | OC_CONSOLE_FONT_RANGE |
Functions | |
VOID | OcSetupConsole (IN EFI_CONSOLE_CONTROL_SCREEN_MODE InitialMode, IN OC_CONSOLE_RENDERER Renderer, IN OC_STORAGE_CONTEXT *Storage OPTIONAL, IN CONST CHAR8 *Font OPTIONAL, IN BOOLEAN IgnoreTextOutput, IN BOOLEAN SanitiseClearScreen, IN BOOLEAN ClearScreenOnModeSwitch, IN BOOLEAN ReplaceTabWithSpace, IN UINT32 Width, IN UINT32 Height) |
EFI_CONSOLE_CONTROL_SCREEN_MODE | OcConsoleControlSetMode (IN EFI_CONSOLE_CONTROL_SCREEN_MODE Mode) |
EFI_CONSOLE_CONTROL_SCREEN_MODE | OcConsoleControlGetMode (VOID) |
VOID | OcParseScreenResolution (IN CONST CHAR8 *String, OUT UINT32 *Width, OUT UINT32 *Height, OUT UINT32 *Bpp, OUT BOOLEAN *Max) |
VOID | OcParseConsoleMode (IN CONST CHAR8 *String, OUT UINT32 *Width, OUT UINT32 *Height, OUT BOOLEAN *Max) |
EFI_STATUS | OcSetGopBurstMode (VOID) |
EFI_STATUS | OcGopModeBytesPerPixel (IN EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *Mode, OUT UINTN *BytesPerPixel) |
EFI_STATUS | OcGopModeSafeFrameBufferSize (IN EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *Mode, OUT UINTN *FrameBufferSize) |
EFI_STATUS | OcSetConsoleResolution (IN UINT32 Width OPTIONAL, IN UINT32 Height OPTIONAL, IN UINT32 Bpp OPTIONAL, IN BOOLEAN Force) |
EFI_STATUS | OcSetConsoleMode (IN UINT32 Width, IN UINT32 Height) |
EFI_STATUS | OcProvideConsoleGop (IN BOOLEAN Route) |
VOID | OcReconnectConsole (VOID) |
EFI_STATUS | OcUseDirectGop (IN INT32 CacheType) |
EFI_SYSTEM_TABLE * | AllocateNullTextOutSystemTable (IN EFI_SYSTEM_TABLE *SystemTable) |
EFI_STATUS | OcProvideUgaPassThrough (VOID) |
EFI_STATUS | OcProvideGopPassThrough (IN BOOLEAN ForAll) |
APPLE_FRAMEBUFFER_INFO_PROTOCOL * | OcAppleFbInfoInstallProtocol (IN BOOLEAN Reinstall) |
APPLE_EG2_INFO_PROTOCOL * | OcAppleEg2InfoInstallProtocol (IN BOOLEAN Reinstall) |
EFI_STATUS | OcGopInfoDump (IN EFI_FILE_PROTOCOL *Root) |
Variables | |
OC_CONSOLE_FONT | gDefaultConsoleFont |
OC_CONSOLE_FONT_RANGE | gEfiRequiredUnicodeChars [] |
OC_CONSOLE_FONT_RANGE | gExtendedUnicodeChars [] |
Copyright (C) 2019, vit9696. 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 OcConsoleLib.h.
#define ISO_CHAR_HEIGHT (16u) |
Definition at line 50 of file OcConsoleLib.h.
#define ISO_CHAR_WIDTH (8u) |
Console font.
Definition at line 49 of file OcConsoleLib.h.
#define OC_CONSOLE_FONT_FALLBACK_CHAR (L'_') |
Definition at line 52 of file OcConsoleLib.h.
#define OC_CONSOLE_MARK_UNCONTROLLED L"MarkUncontrolled" |
Special commands sent to Builtin text renderer through TestString. Extension to notify OpenCore builtin renderer that any text it may have produced on screen is mixed with graphics which it did not control.
Definition at line 44 of file OcConsoleLib.h.
typedef struct _OC_CONSOLE_FONT OC_CONSOLE_FONT |
typedef struct _OC_CONSOLE_FONT_PAGE OC_CONSOLE_FONT_PAGE |
typedef struct _OC_CONSOLE_FONT_RANGE OC_CONSOLE_FONT_RANGE |
enum OC_CONSOLE_RENDERER |
Console renderer to use.
Enumerator | |
---|---|
OcConsoleRendererBuiltinGraphics | |
OcConsoleRendererBuiltinText | |
OcConsoleRendererSystemGraphics | |
OcConsoleRendererSystemText | |
OcConsoleRendererSystemGeneric |
Definition at line 29 of file OcConsoleLib.h.
EFI_SYSTEM_TABLE * AllocateNullTextOutSystemTable | ( | IN EFI_SYSTEM_TABLE * | SystemTable | ) |
Allocate new System Table with disabled text output.
[in] | SystemTable | Base System Table. |
non | NULL The System Table table was allocated successfully. |
Definition at line 147 of file TextOutputNull.c.
APPLE_EG2_INFO_PROTOCOL * OcAppleEg2InfoInstallProtocol | ( | IN BOOLEAN | Reinstall | ) |
APPLE_FRAMEBUFFER_INFO_PROTOCOL * OcAppleFbInfoInstallProtocol | ( | IN BOOLEAN | Reinstall | ) |
Install and initialise Apple Framebuffer Info protocol on top of GOP protocol. For EfiBoot 10.4, which can only use UGA, this is the only way to obtain framebuffer base for XNU kernel PE Boot_args.
[in] | Reinstall | Overwrite installed protocol. |
installed | or located protocol or NULL. |
Definition at line 106 of file FramebufferInfo.c.
EFI_CONSOLE_CONTROL_SCREEN_MODE OcConsoleControlGetMode | ( | VOID | ) |
Get existing console control screen mode, default to text if no existing console control protocol.
existing | console control mode. |
Definition at line 74 of file ConsoleControl.c.
EFI_CONSOLE_CONTROL_SCREEN_MODE OcConsoleControlSetMode | ( | IN EFI_CONSOLE_CONTROL_SCREEN_MODE | Mode | ) |
Update console control screen mode.
[in] | Mode | Desired mode. |
previous | console control mode. |
Definition at line 29 of file ConsoleControl.c.
EFI_STATUS OcGopInfoDump | ( | IN EFI_FILE_PROTOCOL * | Root | ) |
Dump GOP info to the specified directory.
[in] | Root | Directory to write CPU data. |
EFI_SUCCESS | on success. |
Definition at line 26 of file GopInfoDump.c.
EFI_STATUS OcGopModeBytesPerPixel | ( | IN EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE * | Mode, |
OUT UINTN * | BytesPerPixel ) |
Return the bytes per pixel for the current GOP mode.
GOP mode information does not include anything directly containing the bytes per pixel, but there is a defined algorithm for working out this size, even for non-standard pixel masks, and also a defined situation (PixelBltOnly pixel format) where there is no such size.
[in] | Mode | GOP mode. |
[in] | BytesPerPixel | Bytes per pixel for the mode in use. |
EFI_SUCCESS | Success. |
EFI_UNSUPPORTED | There is no frame buffer. |
EFI_INVALID_PARAMETER | Mode info parameters are outside valid ranges. |
Definition at line 29 of file GopUtils.c.
EFI_STATUS OcGopModeSafeFrameBufferSize | ( | IN EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE * | Mode, |
OUT UINTN * | FrameBufferSize ) |
Return the frame buffer size in use for the current GOP mode, even where Gop->Mode->FrameBufferSize misreports this.
Occasional GOP implementations report a frame buffer size far larger (e.g. ~100x) than required for the actual mode in use.
[in] | Mode | GOP mode. |
[in] | FrameBufferSize | Frame buffer size in use. |
EFI_SUCCESS | Success. |
EFI_UNSUPPORTED | There is no frame buffer. |
EFI_INVALID_PARAMETER | Size parameters are outside valid ranges. |
Definition at line 85 of file GopUtils.c.
VOID OcParseConsoleMode | ( | IN CONST CHAR8 * | String, |
OUT UINT32 * | Width, | ||
OUT UINT32 * | Height, | ||
OUT BOOLEAN * | Max ) |
Parse console mode from string.
[in] | String | Resolution in WxH format. |
[out] | Width | Parsed mode width or 0. |
[out] | Height | Parsed mode height or 0. |
[out] | Max | Set to TRUE when String equals to Max. |
Definition at line 121 of file ResolutionParsing.c.
VOID OcParseScreenResolution | ( | IN CONST CHAR8 * | String, |
OUT UINT32 * | Width, | ||
OUT UINT32 * | Height, | ||
OUT UINT32 * | Bpp, | ||
OUT BOOLEAN * | Max ) |
Parse screen resolution from string.
[in] | String | Resolution in WxH@B or WxH format. |
[out] | Width | Parsed resolution width or 0. |
[out] | Height | Parsed resolution height or 0. |
[out] | Bpp | Parsed resolution bpp or 0. |
[out] | Max | Set to TRUE when String equals to Max. |
Definition at line 103 of file ResolutionParsing.c.
EFI_STATUS OcProvideConsoleGop | ( | IN BOOLEAN | Route | ) |
Ensure installed GOP protocol on ConOut handle.
Definition at line 81 of file ConsoleGop.c.
EFI_STATUS OcProvideGopPassThrough | ( | IN BOOLEAN | ForAll | ) |
Provide GOP protocol instances on top of existing UGA instances.
[in] | ForAll | For all instances, otherwises for AppleFramebuffer-enabled only. |
EFI_SUCCESS | on success. |
< or PixelBlueGreenRedReserved8BitPerColor?
Definition at line 108 of file GopPassThrough.c.
EFI_STATUS OcProvideUgaPassThrough | ( | VOID | ) |
Provide UGA protocol instances on top of existing GOP instances.
EFI_SUCCESS | on success. |
Definition at line 154 of file UgaPassThrough.c.
VOID OcReconnectConsole | ( | VOID | ) |
Perform console reconnection.
Definition at line 482 of file ConsoleGop.c.
EFI_STATUS OcSetConsoleMode | ( | IN UINT32 | Width, |
IN UINT32 | Height ) |
Set console mode.
[in] | Width | Resolution width or 0 for Max. |
[in] | Height | Resolution height or 0 for Max. |
EFI_SUCCESS | on success. |
Definition at line 380 of file OcConsoleLib.c.
EFI_STATUS OcSetConsoleResolution | ( | IN UINT32 Width | OPTIONAL, |
IN UINT32 Height | OPTIONAL, | ||
IN UINT32 Bpp | OPTIONAL, | ||
IN BOOLEAN | Force ) |
Set screen resolution on console handle.
[in] | Width | Resolution width or 0 for Max. |
[in] | Height | Resolution height or 0 for Max. |
[in] | Bpp | Resolution bpp or 0 for automatic. |
[in] | Force | Force the specified resolution using the OC_FORCE_RESOLUTION protocol. |
EFI_SUCCESS | on success. |
Definition at line 289 of file OcConsoleLib.c.
EFI_STATUS OcSetGopBurstMode | ( | VOID | ) |
Use PAT to enable write-combining caching (burst mode) on GOP memory, when it is suppported but firmware has not set it up.
EFI_SUCCESS | on success. |
Definition at line 308 of file GopUtils.c.
VOID OcSetupConsole | ( | IN EFI_CONSOLE_CONTROL_SCREEN_MODE | InitialMode, |
IN OC_CONSOLE_RENDERER | Renderer, | ||
IN OC_STORAGE_CONTEXT *Storage | OPTIONAL, | ||
IN CONST CHAR8 *Font | OPTIONAL, | ||
IN BOOLEAN | IgnoreTextOutput, | ||
IN BOOLEAN | SanitiseClearScreen, | ||
IN BOOLEAN | ClearScreenOnModeSwitch, | ||
IN BOOLEAN | ReplaceTabWithSpace, | ||
IN UINT32 | Width, | ||
IN UINT32 | Height ) |
Configure console control protocol with given options.
[in] | InitialMode | Initial mode to use, or set max. value to use existing mode. |
[in] | Renderer | Renderer to use. |
[in] | Storage | Storage context - only required if Font parameter is used. |
[in] | Font | Font file to load. Use builtin font if NULL or empty string. |
[in] | IgnoreTextOutput | Skip console output in text mode. |
[in] | SanitiseClearScreen | Workaround ClearScreen breaking resolution. |
[in] | ClearScreenOnModeSwitch | Clear graphic screen when switching to text mode. |
[in] | ReplaceTabWithSpace | Replace invisible tab characters with spaces in OutputString. |
[in] | Width | Width to set - applies to builtin renderer only. |
[in] | Height | Height to set - applies to builtin renderer only. |
Definition at line 389 of file OcConsoleLib.c.
EFI_STATUS OcUseDirectGop | ( | IN INT32 | CacheType | ) |
Use direct GOP renderer for console.
[in] | CacheType | Caching type, e.g. CacheWriteCombining or -1 to disable. |
[in] | Rotation | Rotation scheme in degrees (must be one of 0, 90, 180, 270). |
EFI_SUCCESS | on success. |
Definition at line 536 of file ConsoleGop.c.
|
extern |
Free font used by XNU, plus unicode box drawing chars.
Definition at line 611 of file ConsoleFont.c.
|
extern |
List of non-page 0 chars required by EFI. Refs: https://github.com/acidanthera/audk/blob/master/MdePkg/Include/Protocol/SimpleTextOut.h#L177-L178 https://github.com/acidanthera/audk/blob/master/MdePkg/Include/Protocol/SimpleTextOut.h#L34-L98
Definition at line 631 of file ConsoleFont.c.
|
extern |
List of all chars present in Extended Unicode range. Ref: https://int10h.org/oldschool-pc-fonts/fontlist/font?ibm_vga_8x16
Definition at line 654 of file ConsoleFont.c.