[PATCH v2 6/6] efi_selftest: Add symbol character selftest

Heinrich Schuchardt xypron.glpk at gmx.de
Mon Feb 12 14:20:18 CET 2024


On 10.02.24 13:46, Janne Grunau via B4 Relay wrote:
> From: Janne Grunau <j at jannau.net>
>
> Draw symbols from code page 437 code points 0x01 - 01f used by UEFI
> applications to draw user interfaces using
> EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.
>
> Add a simple test to displaying the Konami code using symbols used by

The Unicode standards calls page 25A0 "Geometric shapes".

Konami is an unrelated brand of 'Konami Digital Entertainment".

> grub2. The output has to be checked manually on the screen for
> correctness.
>
> Signed-off-by: Janne Grunau <j at jannau.net>
> ---
>   lib/efi_selftest/efi_selftest_textoutput.c | 7 +++++++
>   1 file changed, 7 insertions(+)
>
> diff --git a/lib/efi_selftest/efi_selftest_textoutput.c b/lib/efi_selftest/efi_selftest_textoutput.c
> index cc11a22eee..9e5d944fa0 100644
> --- a/lib/efi_selftest/efi_selftest_textoutput.c
> +++ b/lib/efi_selftest/efi_selftest_textoutput.c
> @@ -46,6 +46,8 @@ u"left bottom \u2502 right bottom  \u2502\n\u2514\u2500\u2500\u2500"
>   u"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534"
>   u"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"
>   u"\u2500\u2500\u2500\u2500\u2518\n";
> +	const u16 konami[] =
> +u"Konami code: \u25b2 \u25b2 \u25bc \u25bc \u25c4 \u25ba \u25c4 \u25ba B A\n";

If you want a human to check the output visually, how about:

Geometric shapes:
U+25B2 ▲ - Black up-pointing triangle
U+25BA ► - Black right-pointing pointer
U+25BC ▼ - Black down-pointing triangle
U+25C4 ◄ - Black left-pointing pointer

Best regards

Heinrich

>
>   	/* SetAttribute */
>   	efi_st_printf("\nColor palette\n");
> @@ -144,6 +146,11 @@ u"\u2500\u2500\u2500\u2500\u2518\n";
>   		efi_st_error("OutputString failed for box drawing chars\n");
>   		return EFI_ST_FAILURE;
>   	}
> +	ret = con_out->output_string(con_out, konami);
> +	if (ret != EFI_ST_SUCCESS) {
> +		efi_st_error("OutputString failed for symbol chars\n");
> +		return EFI_ST_FAILURE;
> +	}
>   	con_out->output_string(con_out, u"waiting for admiration...\n");
>   	EFI_CALL(systab.boottime->stall(3000000));
>   	efi_st_printf("\n");
>



More information about the U-Boot mailing list