Initialize console without error reporting and allow serial port configuration to be passed via EFI shell
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
2022-08-13 13:25:29 +02:00
parent 35b3c59270
commit a6d892bf08
4 changed files with 125 additions and 47 deletions

View File

@@ -18,28 +18,6 @@ PEFI_SYSTEM_TABLE EfiSystemTable;
/* Serial port configuration */
CPPORT EfiSerialPort;
/**
* Writes a character to the serial console.
*
* @param Character
* The integer promotion of the character to be written.
*
* @return This routine does not return any value.
*
* @since XT 1.0
*/
VOID
BlComPortPutChar(IN USHORT Character)
{
USHORT Buffer[2];
/* Write character to the serial console */
Buffer[0] = Character;
Buffer[1] = 0;
HlComPortPutByte(&EfiSerialPort, Buffer[0]);
}
/**
* This routine is the entry point of the XT EFI boot loader.
*
@@ -63,22 +41,15 @@ BlStartXtLoader(IN EFI_HANDLE ImageHandle,
EfiImageHandle = ImageHandle;
EfiSystemTable = SystemTable;
/* Early initialize COM port for debugging (115200 8n1) */
Status = HlInitializeComPort(&EfiSerialPort, 1, 0);
if(Status != STATUS_SUCCESS)
/* Initialize EFI console */
BlConsoleInitialize();
/* Early initialize COM port for debugging */
Status = BlComPortInitialize();
if(Status != STATUS_EFI_SUCCESS)
{
/* Initialization failed, try printing error to stdout and serial console */
BlEfiPrint(L"Failed to initialize serial console");
}
/* Initialize EFI console */
Status = BlConsoleInitialize();
if(Status != STATUS_EFI_SUCCESS) {
/* Initialization failed, try printing error to stdout and serial console */
BlEfiPrint(L"Failed to initialize EFI console services");
/* Consider it as unsupported EFI implementation */
return STATUS_EFI_INCOMPATIBLE_VERSION;
BlEfiPrint(L"ERROR: Failed to initialize serial console");
}
/* Disable watchdog timer */