Implement BlSetConsoleMode() and forcibly set mode to 80x25 to avoid offscreen
All checks were successful
Builds / ExectOS (amd64) (push) Successful in 33s
Builds / ExectOS (i686) (push) Successful in 28s

This commit is contained in:
2023-12-21 22:57:11 +01:00
parent 782e6e3987
commit 5ee6377080
2 changed files with 38 additions and 9 deletions

View File

@@ -179,6 +179,23 @@ BlSetConsoleAttributes(IN ULONGLONG Attributes)
EfiSystemTable->ConOut->SetAttribute(EfiSystemTable->ConOut, Attributes);
}
/**
* Sets the output console device to the requested mode.
*
* @param Mode
* Supplies a text mode number to set.
*
* @return This routine returns a status code.
*
* @since XT 1.0
*/
XTCDECL
EFI_STATUS
BlSetConsoleMode(IN ULONGLONG Mode)
{
return EfiSystemTable->ConOut->SetMode(EfiSystemTable->ConOut, Mode);
}
/**
* Sets new coordinates of the console cursor position.
*
@@ -238,6 +255,14 @@ BlpInitializeConsole()
EfiSystemTable->ConOut->Reset(EfiSystemTable->ConOut, TRUE);
EfiSystemTable->StdErr->Reset(EfiSystemTable->StdErr, TRUE);
/* Make sure that current console mode is 80x25 characters, as some broken EFI implementations might
* set different mode that do not fit on the screen, causing a text to be displayed offscreen */
if(EfiSystemTable->ConOut->Mode->Mode != 0)
{
/* Set console mode to 0, which is standard, 80x25 text mode */
BlSetConsoleMode(0);
}
/* Clear screen and enable cursor */
BlClearConsoleScreen();
BlEnableConsoleCursor();