Date: Sun, 29 May 2022 09:03:56 -0600 From: Warner Losh <imp@bsdimp.com> To: Christopher Bowman <crb@chrisbowman.com> Cc: FreeBSD Hackers <freebsd-hackers@freebsd.org> Subject: Re: putchar in boot1.c adds extra blank lines on Xilinx ZYNQ board with U-boot 2020.04 Message-ID: <CANCZdfobgHmi4B70wfgV9sOg22e9VMJCphnZaYf0YLq6gWeNew@mail.gmail.com> In-Reply-To: <3D090089-F20B-4B5D-A589-391E6536A875@chrisbowman.com> References: <3D090089-F20B-4B5D-A589-391E6536A875@chrisbowman.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Sun, May 29, 2022, 7:56 AM Christopher Bowman <crb@chrisbowman.com>
wrote:
> Looking at /usr/src/stand/efi/boot1/boot1.c
>
> The bottom of the file has:
> void
> putchar(int c)
> {
> CHAR16 buf[2];
>
> if (c == '\n') {
> buf[0] = '\r';
> buf[1] = 0;
> ST->ConOut->OutputString(ST->ConOut, buf);
> }
> buf[0] = c;
> buf[1] = 0;
> ST->ConOut->OutputString(ST->ConOut, buf);
> }
>
> On my platform this results in an extra blank line after each new line.
>
> I’m running on a Xilinx ZYNQ board with U-boot 2020.04.
>
> Does this blank line show on other platforms too? If so is this the
> desired functionality? Perhaps it’s needed for serial consoles to work
> right?
> I’m running locally with the if statement completely removed and that
> fixes the extraneous blank lines I see.
>
No other platform does that... in fact, no carriage return would mess up
other platforms. It's needed everywhere for all kinds of consoles.
Warner
Warner
> Regards,
> Christopher
>
[-- Attachment #2 --]
<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, May 29, 2022, 7:56 AM Christopher Bowman <<a href="mailto:crb@chrisbowman.com">crb@chrisbowman.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Looking at /usr/src/stand/efi/boot1/boot1.c<br>
<br>
The bottom of the file has:<br>
void<br>
putchar(int c)<br>
{<br>
CHAR16 buf[2];<br>
<br>
if (c == '\n') {<br>
buf[0] = '\r';<br>
buf[1] = 0;<br>
ST->ConOut->OutputString(ST->ConOut, buf);<br>
}<br>
buf[0] = c;<br>
buf[1] = 0;<br>
ST->ConOut->OutputString(ST->ConOut, buf);<br>
}<br>
<br>
On my platform this results in an extra blank line after each new line.<br>
<br>
I’m running on a Xilinx ZYNQ board with U-boot 2020.04.<br>
<br>
Does this blank line show on other platforms too? If so is this the desired functionality? Perhaps it’s needed for serial consoles to work right?<br>
I’m running locally with the if statement completely removed and that fixes the extraneous blank lines I see.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">No other platform does that... in fact, no carriage return would mess up other platforms. It's needed everywhere for all kinds of consoles. </div><div dir="auto"><br></div><div dir="auto">Warner </div><div dir="auto"><br></div><div dir="auto">Warner</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Regards,<br>
Christopher<br>
</blockquote></div></div></div>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfobgHmi4B70wfgV9sOg22e9VMJCphnZaYf0YLq6gWeNew>
