Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Sep 2022 15:39:14 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        John Baldwin <jhb@freebsd.org>
Cc:        Warner Losh <imp@freebsd.org>, src-committers <src-committers@freebsd.org>,  "<dev-commits-src-all@freebsd.org>" <dev-commits-src-all@freebsd.org>, dev-commits-src-main@freebsd.org
Subject:   Re: git: df065f699f1f - main - stand: More sensible defaults when ConOut is missing
Message-ID:  <CANCZdfqnBYDCXv%2BhyQohbyxjK4C7UB_1=ZxCRC8cXA-uqbopkg@mail.gmail.com>
In-Reply-To: <0fccddc3-126d-f7b6-3b69-5fc1cbdb2775@FreeBSD.org>
References:  <202208270418.27R4IkeL078154@gitrepo.freebsd.org> <0fccddc3-126d-f7b6-3b69-5fc1cbdb2775@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--0000000000000b48d705e95f03f3
Content-Type: text/plain; charset="UTF-8"

On Fri, Sep 23, 2022 at 3:29 PM John Baldwin <jhb@freebsd.org> wrote:

> On 8/26/22 9:18 PM, Warner Losh wrote:
> > The branch main has been updated by imp:
> >
> > URL:
> https://cgit.FreeBSD.org/src/commit/?id=df065f699f1ff819bb9607c44a6754275ab335ed
> >
> > commit df065f699f1ff819bb9607c44a6754275ab335ed
> > Author:     Warner Losh <imp@FreeBSD.org>
> > AuthorDate: 2022-08-26 21:46:33 +0000
> > Commit:     Warner Losh <imp@FreeBSD.org>
> > CommitDate: 2022-08-27 04:17:56 +0000
> >
> >      stand: More sensible defaults when ConOut is missing
> >
> >      When ConOut is missing, we used to default to serial. Except we did
> it
> >      in the worst way possible by just setting the howto bits and not
> >      updating the console setting, which lead to weird behavior where
> we'd
> >      get some things on the video port, others on serial.
> >
> >      Instead, set console to "efi,comconsole" for this case. Also set
> >      RB_MULTIPLE always (so we get dual consoles from the kernel) and or
> in
> >      RB_SERIAL when we can't find GOPs that suggest the precense of a
> video
> >      console. This will put output in the most places and have a sensible
> >      default for 'primary' console.
> >
> >      Sponsored by:           Netflix
> >      Reviewed by:            emaste, manu
> >      Differential Revision:  https://reviews.freebsd.org/D36299
>
> One possibly surprising result of this is that I did not get dual console
> output on my rpi after this.  (Curiously this only affected my arm64 image
> but not my armv7 image.)  Loader output goes to both, but kernel output is
> only on the video console (which I don't normally use for my pi).  (Also,
> none of the ANSI escape sequences used by the loader work on the pi's video
> console, so once the menu starts it just looks like raw ANSI code garbage
> until the kernel starts booting.)
>
> Not sure if this warrants UPDATING as the effect is that the serial console
> seems to stop working?  The lack of working dual console output is perhaps
> the only real bug.  Not sure what is up there.
>

We don't do the ANSI interpretation correctly on arm for reasons that I
don't recall. It may be just not defining TERM_EMU on arm. That's a separate
issue, one that might be easy to fix.

It is true that this change went from 'We don't know, so use both' to ' Oh,
there
might be a video thing, use only that'. I'm not completely happy with this,
but
was talked into it.

What does u-boot/rpi provide for ConIn?

>FWIW, using 'console="comconsole,efi"' did not work as a workaround.  Same
>results (used the video console only for the kernel).  Had to use
>'console="comconsole"' in /boot/loader.conf.

That's definitely a bug as well. comconsole on arm EFI is special as well,
but not
that special.

The loader gets to set the console, and it tells the kernel through some
rather byzantine
hints what to use. One can also set the console a little more directly with
hw.uart.console
which tells the kernel, when configuring a serial console, which one to
use. You can also
use boot_serial=yes boot_dual=no in the environment.

The whole interface / handoff has been a series of historical hacks that
have not layered
well at all...

Warner

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

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Fri, Sep 23, 2022 at 3:29 PM John =
Baldwin &lt;<a href=3D"mailto:jhb@freebsd.org">jhb@freebsd.org</a>&gt; wrot=
e:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0=
.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 8/26/22 9:=
18 PM, Warner Losh wrote:<br>
&gt; The branch main has been updated by imp:<br>
&gt; <br>
&gt; URL: <a href=3D"https://cgit.FreeBSD.org/src/commit/?id=3Ddf065f699f1f=
f819bb9607c44a6754275ab335ed" rel=3D"noreferrer" target=3D"_blank">https://=
cgit.FreeBSD.org/src/commit/?id=3Ddf065f699f1ff819bb9607c44a6754275ab335ed<=
/a><br>
&gt; <br>
&gt; commit df065f699f1ff819bb9607c44a6754275ab335ed<br>
&gt; Author:=C2=A0 =C2=A0 =C2=A0Warner Losh &lt;imp@FreeBSD.org&gt;<br>
&gt; AuthorDate: 2022-08-26 21:46:33 +0000<br>
&gt; Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh &lt;imp@FreeBSD.org&gt;<br>
&gt; CommitDate: 2022-08-27 04:17:56 +0000<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 stand: More sensible defaults when ConOut is missi=
ng<br>
&gt;=C2=A0 =C2=A0 =C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 When ConOut is missing, we used to default to seri=
al. Except we did it<br>
&gt;=C2=A0 =C2=A0 =C2=A0 in the worst way possible by just setting the howt=
o bits and not<br>
&gt;=C2=A0 =C2=A0 =C2=A0 updating the console setting, which lead to weird =
behavior where we&#39;d<br>
&gt;=C2=A0 =C2=A0 =C2=A0 get some things on the video port, others on seria=
l.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 Instead, set console to &quot;efi,comconsole&quot;=
 for this case. Also set<br>
&gt;=C2=A0 =C2=A0 =C2=A0 RB_MULTIPLE always (so we get dual consoles from t=
he kernel) and or in<br>
&gt;=C2=A0 =C2=A0 =C2=A0 RB_SERIAL when we can&#39;t find GOPs that suggest=
 the precense of a video<br>
&gt;=C2=A0 =C2=A0 =C2=A0 console. This will put output in the most places a=
nd have a sensible<br>
&gt;=C2=A0 =C2=A0 =C2=A0 default for &#39;primary&#39; console.<br>
&gt;=C2=A0 =C2=A0 =C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 Sponsored by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0Netflix<br>
&gt;=C2=A0 =C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 emaste, manu<br>
&gt;=C2=A0 =C2=A0 =C2=A0 Differential Revision:=C2=A0 <a href=3D"https://re=
views.freebsd.org/D36299" rel=3D"noreferrer" target=3D"_blank">https://revi=
ews.freebsd.org/D36299</a><br>
<br>
One possibly surprising result of this is that I did not get dual console<b=
r>
output on my rpi after this.=C2=A0 (Curiously this only affected my arm64 i=
mage<br>
but not my armv7 image.)=C2=A0 Loader output goes to both, but kernel outpu=
t is<br>
only on the video console (which I don&#39;t normally use for my pi).=C2=A0=
 (Also,<br>
none of the ANSI escape sequences used by the loader work on the pi&#39;s v=
ideo<br>
console, so once the menu starts it just looks like raw ANSI code garbage<b=
r>
until the kernel starts booting.)<br>
<br>
Not sure if this warrants UPDATING as the effect is that the serial console=
<br>
seems to stop working?=C2=A0 The lack of working dual console output is per=
haps<br>
the only real bug.=C2=A0 Not sure what is up there.<br></blockquote><div><b=
r></div><div>We don&#39;t do the ANSI interpretation=C2=A0correctly on arm =
for reasons that I</div><div>don&#39;t recall. It may be just not defining =
TERM_EMU on arm. That&#39;s a separate</div><div>issue, one that might be e=
asy to fix.</div><div><br></div><div>It is true that this change went from =
&#39;We don&#39;t know, so use both&#39; to &#39; Oh, there</div><div>might=
 be a video thing, use only that&#39;. I&#39;m not completely happy with th=
is, but</div><div>was talked into it.</div><div><br></div><div>What does u-=
boot/rpi provide for ConIn?</div><div><br></div><div>&gt;FWIW, using &#39;c=
onsole=3D&quot;comconsole,efi&quot;&#39; did not work as a workaround.=C2=
=A0 Same</div>&gt;results (used the video console only for the kernel).=C2=
=A0 Had to use<br>&gt;&#39;console=3D&quot;comconsole&quot;&#39; in /boot/l=
oader.conf.<div><br></div><div>That&#39;s definitely a bug as well. comcons=
ole on arm EFI is special as well, but not</div><div>that special.</div><di=
v><br></div><div>The loader gets to set the console, and it tells the kerne=
l through some rather byzantine</div><div>hints what to use. One can also s=
et the console a little more directly with hw.uart.console</div><div>which =
tells the kernel, when configuring a serial console, which one to use. You =
can also</div><div>use boot_serial=3Dyes boot_dual=3Dno in the environment.=
</div><div><br></div><div>The whole interface / handoff has been a series o=
f historical hacks that have not layered</div><div>well at all...</div><div=
><br></div><div>Warner</div></div></div>

--0000000000000b48d705e95f03f3--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfqnBYDCXv%2BhyQohbyxjK4C7UB_1=ZxCRC8cXA-uqbopkg>