XTLDR Rewrite #7

Merged
belliash merged 184 commits from xtldr_rewrite into master 2024-01-09 18:51:04 +01:00
2 changed files with 38 additions and 9 deletions
Showing only changes of commit 5ee6377080 - Show all commits

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();

View File

@ -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,