Initialize the UEFI console
All checks were successful
Builds / ExectOS (amd64) (push) Successful in 27s
Builds / ExectOS (i686) (push) Successful in 26s

This commit is contained in:
Rafal Kupiec 2023-12-02 22:38:58 +01:00
parent 4076175436
commit 03b6e9cd90
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
4 changed files with 60 additions and 0 deletions

View File

@ -8,6 +8,7 @@ include_directories(
# Specify list of source code files # Specify list of source code files
list(APPEND XTLDR_SOURCE list(APPEND XTLDR_SOURCE
${XTLDR_SOURCE_DIR}/console.c
${XTLDR_SOURCE_DIR}/globals.c ${XTLDR_SOURCE_DIR}/globals.c
${XTLDR_SOURCE_DIR}/xtldr.c) ${XTLDR_SOURCE_DIR}/xtldr.c)

48
xtldr2/console.c Normal file
View File

@ -0,0 +1,48 @@
/**
* PROJECT: ExectOS
* COPYRIGHT: See COPYING.md in the top level directory
* FILE: xtldr/console.c
* DESCRIPTION: EFI console support
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
*/
#include <xtbm.h>
/**
* This routine clears the UEFI console screen.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
XTCDECL
VOID
BmClearScreen()
{
/* Clear screen */
EfiSystemTable->ConOut->ClearScreen(EfiSystemTable->ConOut);
}
/**
* This routine initializes the EFI console.
*
* @return This routine returns status code.
*
* @since XT 1.0
*/
XTCDECL
VOID
BmInitializeConsole()
{
/* Clear console buffers */
EfiSystemTable->ConIn->Reset(EfiSystemTable->ConIn, TRUE);
EfiSystemTable->ConOut->Reset(EfiSystemTable->ConOut, TRUE);
EfiSystemTable->StdErr->Reset(EfiSystemTable->StdErr, TRUE);
/* Clear screen */
BmClearScreen();
/* Enable cursor */
EfiSystemTable->ConOut->EnableCursor(EfiSystemTable->ConOut, TRUE);
}

View File

@ -21,6 +21,14 @@ EXTERN PEFI_SYSTEM_TABLE EfiSystemTable;
/* XTLDR routines forward references */ /* XTLDR routines forward references */
XTCDECL
VOID
BmClearScreen();
XTCDECL
VOID
BmInitializeConsole();
XTCDECL XTCDECL
EFI_STATUS EFI_STATUS
BmStartXtLoader(IN EFI_HANDLE ImageHandle, BmStartXtLoader(IN EFI_HANDLE ImageHandle,

View File

@ -33,6 +33,9 @@ BmStartXtLoader(IN EFI_HANDLE ImageHandle,
EfiImageHandle = ImageHandle; EfiImageHandle = ImageHandle;
EfiSystemTable = SystemTable; EfiSystemTable = SystemTable;
/* Initialize UEFI console */
BmInitializeConsole();
/* This point should be never reached, if this happen return error code */ /* This point should be never reached, if this happen return error code */
return STATUS_EFI_LOAD_ERROR; return STATUS_EFI_LOAD_ERROR;
} }