Skip site navigation (1)Skip section navigation (2)
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
--000000000000e7b02205e027d901
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

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 =3D=3D '\n') {
>                 buf[0] =3D '\r';
>                 buf[1] =3D 0;
>                 ST->ConOut->OutputString(ST->ConOut, buf);
>         }
>         buf[0] =3D c;
>         buf[1] =3D 0;
>         ST->ConOut->OutputString(ST->ConOut, buf);
> }
>
> On my platform this results in an extra blank line after each new line.
>
> I=E2=80=99m 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=E2=80=99s needed for serial consoles t=
o work
> right?
> I=E2=80=99m 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
>

--000000000000e7b02205e027d901
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div><br><br><div class=3D"gmail_quote"><div dir=3D"ltr" =
class=3D"gmail_attr">On Sun, May 29, 2022, 7:56 AM Christopher Bowman &lt;<=
a href=3D"mailto:crb@chrisbowman.com">crb@chrisbowman.com</a>&gt; wrote:<br=
></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-=
left:1px #ccc solid;padding-left:1ex">Looking at /usr/src/stand/efi/boot1/b=
oot1.c<br>
<br>
The bottom of the file has:<br>
void<br>
putchar(int c)<br>
{<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 CHAR16 buf[2];<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (c =3D=3D &#39;\n&#39;) {<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 buf[0] =3D &#39;\r&=
#39;;<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 buf[1] =3D 0;<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ST-&gt;ConOut-&gt;O=
utputString(ST-&gt;ConOut, buf);<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 buf[0] =3D c;<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 buf[1] =3D 0;<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ST-&gt;ConOut-&gt;OutputString(ST-&gt;ConOut, b=
uf);<br>
}<br>
<br>
On my platform this results in an extra blank line after each new line.<br>
<br>
I=E2=80=99m running on a Xilinx ZYNQ board with U-boot 2020.04.<br>
<br>
Does this blank line show on other platforms too?=C2=A0 If so is this the d=
esired functionality?=C2=A0 Perhaps it=E2=80=99s needed for serial consoles=
 to work right?<br>
I=E2=80=99m running locally with the if statement completely removed and th=
at fixes the extraneous blank lines I see.<br></blockquote></div></div><div=
 dir=3D"auto"><br></div><div dir=3D"auto">No other platform does that... in=
 fact, no carriage return would mess up other platforms. It&#39;s needed ev=
erywhere for all kinds of consoles.=C2=A0</div><div dir=3D"auto"><br></div>=
<div dir=3D"auto">Warner=C2=A0</div><div dir=3D"auto"><br></div><div dir=3D=
"auto">Warner</div><div dir=3D"auto"><div class=3D"gmail_quote"><blockquote=
 class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc soli=
d;padding-left:1ex">
Regards,<br>
Christopher<br>
</blockquote></div></div></div>

--000000000000e7b02205e027d901--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfobgHmi4B70wfgV9sOg22e9VMJCphnZaYf0YLq6gWeNew>