Implement BlSetConsoleMode() and forcibly set mode to 80x25 to avoid offscreen
This commit is contained in:
parent
782e6e3987
commit
5ee6377080
@ -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();
|
||||
|
@ -107,6 +107,15 @@ EFI_STATUS
|
||||
BlMemoryAllocatePool(IN UINT_PTR Size,
|
||||
OUT PVOID *Memory);
|
||||
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
BlMemoryFreePages(IN UINT64 Pages,
|
||||
IN EFI_PHYSICAL_ADDRESS Memory);
|
||||
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
BlMemoryFreePool(IN PVOID Memory);
|
||||
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
BlOpenVolume(IN PEFI_DEVICE_PATH_PROTOCOL DevicePath,
|
||||
@ -133,15 +142,6 @@ XTCDECL
|
||||
VOID
|
||||
BlResetConsoleInputBuffer();
|
||||
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
BlMemoryFreePages(IN UINT64 Pages,
|
||||
IN EFI_PHYSICAL_ADDRESS Memory);
|
||||
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
BlMemoryFreePool(IN PVOID Memory);
|
||||
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
BlOpenXtProtocol(OUT PVOID *ProtocolHandler,
|
||||
@ -156,6 +156,10 @@ XTCDECL
|
||||
VOID
|
||||
BlSetConsoleAttributes(IN ULONGLONG Attributes);
|
||||
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
BlSetConsoleMode(IN ULONGLONG Mode);
|
||||
|
||||
XTCDECL
|
||||
VOID
|
||||
BlSetCursorPosition(IN ULONGLONG PosX,
|
||||
|
Loading…
Reference in New Issue
Block a user