Initialize the UEFI console
This commit is contained in:
parent
4076175436
commit
03b6e9cd90
@ -8,6 +8,7 @@ include_directories(
|
||||
|
||||
# Specify list of source code files
|
||||
list(APPEND XTLDR_SOURCE
|
||||
${XTLDR_SOURCE_DIR}/console.c
|
||||
${XTLDR_SOURCE_DIR}/globals.c
|
||||
${XTLDR_SOURCE_DIR}/xtldr.c)
|
||||
|
||||
|
48
xtldr2/console.c
Normal file
48
xtldr2/console.c
Normal 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);
|
||||
}
|
@ -21,6 +21,14 @@ EXTERN PEFI_SYSTEM_TABLE EfiSystemTable;
|
||||
|
||||
|
||||
/* XTLDR routines forward references */
|
||||
XTCDECL
|
||||
VOID
|
||||
BmClearScreen();
|
||||
|
||||
XTCDECL
|
||||
VOID
|
||||
BmInitializeConsole();
|
||||
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
BmStartXtLoader(IN EFI_HANDLE ImageHandle,
|
||||
|
@ -33,6 +33,9 @@ BmStartXtLoader(IN EFI_HANDLE ImageHandle,
|
||||
EfiImageHandle = ImageHandle;
|
||||
EfiSystemTable = SystemTable;
|
||||
|
||||
/* Initialize UEFI console */
|
||||
BmInitializeConsole();
|
||||
|
||||
/* This point should be never reached, if this happen return error code */
|
||||
return STATUS_EFI_LOAD_ERROR;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user