Implement BlSetConsoleAttributes() routine
All checks were successful
Builds / ExectOS (amd64) (push) Successful in 28s
Builds / ExectOS (i686) (push) Successful in 27s

This commit is contained in:
Rafal Kupiec 2023-12-11 23:35:58 +01:00
parent 2434a018c4
commit 155ce1e366
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
4 changed files with 41 additions and 17 deletions

View File

@ -37,6 +37,7 @@ typedef VOID (*PBL_CONSOLE_DISABLE_CURSOR)();
typedef VOID (*PBL_CONSOLE_ENABLE_CURSOR)();
typedef VOID (*PBL_CONSOLE_PRINT)(IN PUINT16 Format, IN ...);
typedef VOID (*PBL_CONSOLE_QUERY_MODE)(OUT PUINT_PTR ResX, OUT PUINT_PTR ResY);
typedef VOID (*PBL_CONSOLE_SET_ATTRIBUTES)(IN ULONGLONG Attributes);
typedef VOID (*PBL_CONSOLE_SET_CURSOR_POSITION)(IN ULONGLONG PosX, IN ULONGLONG PosY);
typedef VOID (*PBL_CONSOLE_WRITE)(IN PUSHORT String);
typedef VOID (*PBL_DEBUG_PRINT)(IN PUINT16 Format, IN ...);
@ -82,6 +83,7 @@ typedef struct _XTBL_LOADER_PROTOCOL
PBL_CONSOLE_ENABLE_CURSOR EnableCursor;
PBL_CONSOLE_PRINT Print;
PBL_CONSOLE_QUERY_MODE QueryMode;
PBL_CONSOLE_SET_ATTRIBUTES SetAttributes;
PBL_CONSOLE_SET_CURSOR_POSITION SetCursorPosition;
PBL_CONSOLE_WRITE Write;
} Console;

View File

@ -114,6 +114,40 @@ BlConsoleQueryMode(OUT PUINT_PTR ResX,
EfiSystemTable->ConOut->QueryMode(EfiSystemTable->ConOut, EfiSystemTable->ConOut->Mode->Mode, ResX, ResY);
}
/**
* Displays the string on the device at the current cursor location.
*
* @param String
* The string to be displayed.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTCDECL
VOID
BlConsoleWrite(IN PUSHORT String)
{
EfiSystemTable->ConOut->OutputString(EfiSystemTable->ConOut, String);
}
/**
* Sets the foreground and background colors.
*
* @param Attribute
* Specifies the foreground and background colors (bits 0..3 are fg, and bits 4..6 are bg color).
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTCDECL
VOID
BlSetConsoleAttributes(IN ULONGLONG Attributes)
{
EfiSystemTable->ConOut->SetAttribute(EfiSystemTable->ConOut, Attributes);
}
/**
* Sets new coordinates of the console cursor position.
*
@ -135,23 +169,6 @@ BlSetCursorPosition(IN ULONGLONG PosX,
EfiSystemTable->ConOut->SetCursorPosition(EfiSystemTable->ConOut, PosX, PosY);
}
/**
* Displays the string on the device at the current cursor location.
*
* @param String
* The string to be displayed.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTCDECL
VOID
BlConsoleWrite(IN PUSHORT String)
{
EfiSystemTable->ConOut->OutputString(EfiSystemTable->ConOut, String);
}
/**
* Writes a character to the default EFI console.
*

View File

@ -118,6 +118,10 @@ EFI_STATUS
BlSetConfigValue(IN CONST PWCHAR ConfigName,
IN CONST PWCHAR ConfigValue);
XTCDECL
VOID
BlSetConsoleAttributes(IN ULONGLONG Attributes);
XTCDECL
VOID
BlSetCursorPosition(IN ULONGLONG PosX,

View File

@ -95,6 +95,7 @@ BlpRegisterXtLoaderProtocol()
LdrProtocol.Console.EnableCursor = BlConsoleEnableCursor;
LdrProtocol.Console.Print = BlConsolePrint;
LdrProtocol.Console.QueryMode = BlConsoleQueryMode;
LdrProtocol.Console.SetAttributes = BlSetConsoleAttributes;
LdrProtocol.Console.SetCursorPosition = BlSetCursorPosition;
LdrProtocol.Console.Write = BlConsoleWrite;
LdrProtocol.Debug.Print = BlDebugPrint;