Refactor part 5; Implement debugging ports
All checks were successful
Builds / ExectOS (amd64) (push) Successful in 25s
Builds / ExectOS (i686) (push) Successful in 24s

This commit is contained in:
2023-12-03 23:18:49 +01:00
parent 6a03db6fcd
commit 5131a682b8
7 changed files with 381 additions and 41 deletions

View File

@@ -52,27 +52,6 @@ BlConsoleEnableCursor()
EfiSystemTable->ConOut->EnableCursor(EfiSystemTable->ConOut, TRUE);
}
/**
* This routine initializes the EFI console.
*
* @return This routine returns status code.
*
* @since XT 1.0
*/
XTCDECL
VOID
BlConsoleInitialize()
{
/* Clear console buffers */
EfiSystemTable->ConIn->Reset(EfiSystemTable->ConIn, TRUE);
EfiSystemTable->ConOut->Reset(EfiSystemTable->ConOut, TRUE);
EfiSystemTable->StdErr->Reset(EfiSystemTable->StdErr, TRUE);
/* Clear screen and enable cursor */
BlConsoleClearScreen();
BlConsoleEnableCursor();
}
/**
* This routine formats the input string and prints it out to the stdout and serial console.
*
@@ -99,10 +78,42 @@ BlConsolePrint(IN PUINT16 Format,
/* Format and print the string to the stdout */
BlpStringPrint(BlpConsolePrintChar, Format, Arguments);
/* Print to serial console only if not running under OVMF */
if(RtlWideStringCompare(EfiSystemTable->FirmwareVendor, L"EDK II", 6) != 0)
{
/* Check if debugging enabled and if EFI serial port is fully initialized */
if(DEBUG && (BlpSerialPort.Flags & COMPORT_FLAG_INIT))
{
/* Format and print the string to the serial console */
BlpStringPrint(BlpDebugPutChar, Format, Arguments);
}
}
/* Clean up the va_list */
VA_END(Arguments);
}
/**
* This routine initializes the EFI console.
*
* @return This routine returns status code.
*
* @since XT 1.0
*/
XTCDECL
VOID
BlpConsoleInitialize()
{
/* Clear console buffers */
EfiSystemTable->ConIn->Reset(EfiSystemTable->ConIn, TRUE);
EfiSystemTable->ConOut->Reset(EfiSystemTable->ConOut, TRUE);
EfiSystemTable->StdErr->Reset(EfiSystemTable->StdErr, TRUE);
/* Clear screen and enable cursor */
BlConsoleClearScreen();
BlConsoleEnableCursor();
}
/**
* Writes a character to the default EFI console.
*