diff --git a/xtldr2/console.c b/xtldr2/console.c index 0bf55d1..7bfd862 100644 --- a/xtldr2/console.c +++ b/xtldr2/console.c @@ -24,6 +24,34 @@ BmClearScreen() EfiSystemTable->ConOut->ClearScreen(EfiSystemTable->ConOut); } +/** + * Disables the cursor on the UEFI console. + * + * @return This routine does not return any value. + * + * @since XT 1.0 + */ +XTCDECL +VOID +BmDisableCursor() +{ + EfiSystemTable->ConOut->EnableCursor(EfiSystemTable->ConOut, FALSE); +} + +/** + * Enables the cursor on the UEFI console. + * + * @return This routine does not return any value. + * + * @since XT 1.0 + */ +XTCDECL +VOID +BmEnableCursor() +{ + EfiSystemTable->ConOut->EnableCursor(EfiSystemTable->ConOut, TRUE); +} + /** * This routine initializes the EFI console. * @@ -40,9 +68,29 @@ BmInitializeConsole() EfiSystemTable->ConOut->Reset(EfiSystemTable->ConOut, TRUE); EfiSystemTable->StdErr->Reset(EfiSystemTable->StdErr, TRUE); - /* Clear screen */ + /* Clear screen and enable cursor */ BmClearScreen(); - - /* Enable cursor */ - EfiSystemTable->ConOut->EnableCursor(EfiSystemTable->ConOut, TRUE); + BmEnableCursor(); +} + +/** + * Writes a character to the default EFI console. + * + * @param Character + * The integer promotion of the character to be written. + * + * @return This routine does not return any value. + * + * @since XT 1.0 + */ +XTCDECL +VOID +BmPrintChar(IN USHORT Character) +{ + USHORT Buffer[2]; + + /* Write character to the screen console */ + Buffer[0] = Character; + Buffer[1] = 0; + EfiSystemTable->ConOut->OutputString(EfiSystemTable->ConOut, Buffer); } diff --git a/xtldr2/includes/xtbm.h b/xtldr2/includes/xtbm.h index d3fe630..53224d7 100644 --- a/xtldr2/includes/xtbm.h +++ b/xtldr2/includes/xtbm.h @@ -25,10 +25,22 @@ XTCDECL VOID BmClearScreen(); +XTCDECL +VOID +BmDisableCursor(); + +XTCDECL +VOID +BmEnableCursor(); + XTCDECL VOID BmInitializeConsole(); +XTCDECL +VOID +BmPrintChar(IN USHORT Character); + XTCDECL EFI_STATUS BmStartXtLoader(IN EFI_HANDLE ImageHandle,