Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Sep 2022 01:26:18 +0300
From:      Toomas Soome <tsoome@me.com>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        Warner Losh <imp@FreeBSD.org>, "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org>
Subject:   Re: git: df065f699f1f - main - stand: More sensible defaults when ConOut is missing
Message-ID:  <09EEDF01-3894-4157-90A4-C884B5D1BBD2@me.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

--Apple-Mail=_53C56070-8524-4BCC-B129-404EE3099AA9
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8



> On 24. Sep 2022, at 00:29, John Baldwin <jhb@FreeBSD.org> wrote:
>=20
> 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=3Ddf065f699f1ff819bb9607c44a675427=
5ab335ed
>> 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
>=20
> 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.)

If RB_SERIAL | RB_MULTIPLE is returned from parse_uefi_con_out(), we do =
keep =E2=80=9Ctext=E2=80=9D mode, meaning, we output to UEFI console =
with Simple Text Output protocol.

ANSI code like garbage on screen means there is no interpreter and we =
end up sending sequences to console UEFI video console has no idea how =
to handle those; if serial port is also bound to console output, the =
Simple Text Output protocol does not pass ESC through, so terminal =
emulator at the other end of the serial link also does draw garbage.=20

So, garbage means =E2=80=9Ctext" mode + no TERM_EMU is defined at build =
time.

rgds,
toomas

>=20
> 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.
>=20
> --=20
> John Baldwin


--Apple-Mail=_53C56070-8524-4BCC-B129-404EE3099AA9
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><br =
class=3D""><div><br class=3D""><blockquote type=3D"cite" class=3D""><div =
class=3D"">On 24. Sep 2022, at 00:29, John Baldwin &lt;<a =
href=3D"mailto:jhb@FreeBSD.org" class=3D"">jhb@FreeBSD.org</a>&gt; =
wrote:</div><br class=3D"Apple-interchange-newline"><div class=3D""><meta =
charset=3D"UTF-8" class=3D""><span style=3D"caret-color: rgb(0, 0, 0); =
font-family: Hack-Regular; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;" =
class=3D"">On 8/26/22 9:18 PM, Warner Losh wrote:</span><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Hack-Regular; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><blockquote type=3D"cite" style=3D"font-family: =
Hack-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; =
-webkit-text-stroke-width: 0px; text-decoration: none;" class=3D"">The =
branch main has been updated by imp:<br class=3D"">URL: <a =
href=3D"https://cgit.FreeBSD.org/src/commit/?id=3Ddf065f699f1ff819bb9607c4=
4a6754275ab335ed" =
class=3D"">https://cgit.FreeBSD.org/src/commit/?id=3Ddf065f699f1ff819bb960=
7c44a6754275ab335ed</a><br class=3D"">commit =
df065f699f1ff819bb9607c44a6754275ab335ed<br class=3D"">Author: =
&nbsp;&nbsp;&nbsp;&nbsp;Warner Losh &lt;<a href=3D"mailto:imp@FreeBSD.org"=
 class=3D"">imp@FreeBSD.org</a>&gt;<br class=3D"">AuthorDate: 2022-08-26 =
21:46:33 +0000<br class=3D"">Commit: &nbsp;&nbsp;&nbsp;&nbsp;Warner Losh =
&lt;<a href=3D"mailto:imp@FreeBSD.org" =
class=3D"">imp@FreeBSD.org</a>&gt;<br class=3D"">CommitDate: 2022-08-27 =
04:17:56 +0000<br class=3D"">&nbsp;&nbsp;&nbsp;&nbsp;stand: More =
sensible defaults when ConOut is missing<br =
class=3D"">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;When =
ConOut is missing, we used to default to serial. Except we did it<br =
class=3D"">&nbsp;&nbsp;&nbsp;&nbsp;in the worst way possible by just =
setting the howto bits and not<br =
class=3D"">&nbsp;&nbsp;&nbsp;&nbsp;updating the console setting, which =
lead to weird behavior where we'd<br =
class=3D"">&nbsp;&nbsp;&nbsp;&nbsp;get some things on the video port, =
others on serial.<br =
class=3D"">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Instead, =
set console to "efi,comconsole" for this case. Also set<br =
class=3D"">&nbsp;&nbsp;&nbsp;&nbsp;RB_MULTIPLE always (so we get dual =
consoles from the kernel) and or in<br =
class=3D"">&nbsp;&nbsp;&nbsp;&nbsp;RB_SERIAL when we can't find GOPs =
that suggest the precense of a video<br =
class=3D"">&nbsp;&nbsp;&nbsp;&nbsp;console. This will put output in the =
most places and have a sensible<br =
class=3D"">&nbsp;&nbsp;&nbsp;&nbsp;default for 'primary' console.<br =
class=3D"">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sponsored=
 by: =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Netflix<br =
class=3D"">&nbsp;&nbsp;&nbsp;&nbsp;Reviewed by: =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;emaste, =
manu<br class=3D"">&nbsp;&nbsp;&nbsp;&nbsp;Differential Revision: =
&nbsp;<a href=3D"https://reviews.freebsd.org/D36299" =
class=3D"">https://reviews.freebsd.org/D36299</a><br =
class=3D""></blockquote><br style=3D"caret-color: rgb(0, 0, 0); =
font-family: Hack-Regular; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;" class=3D""><span style=3D"caret-color: rgb(0, 0, =
0); font-family: Hack-Regular; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;" =
class=3D"">One possibly surprising result of this is that I did not get =
dual console</span><br style=3D"caret-color: rgb(0, 0, 0); font-family: =
Hack-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><span style=3D"caret-color: rgb(0, 0, 0); font-family: =
Hack-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; float: none; display: inline !important;" class=3D"">output on my =
rpi after this. &nbsp;(Curiously this only affected my arm64 =
image</span><br style=3D"caret-color: rgb(0, 0, 0); font-family: =
Hack-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><span style=3D"caret-color: rgb(0, 0, 0); font-family: =
Hack-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; float: none; display: inline !important;" class=3D"">but not my =
armv7 image.) &nbsp;Loader output goes to both, but kernel output =
is</span><br style=3D"caret-color: rgb(0, 0, 0); font-family: =
Hack-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><span style=3D"caret-color: rgb(0, 0, 0); font-family: =
Hack-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; float: none; display: inline !important;" class=3D"">only on the =
video console (which I don't normally use for my pi). =
&nbsp;(Also,</span><br style=3D"caret-color: rgb(0, 0, 0); font-family: =
Hack-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><span style=3D"caret-color: rgb(0, 0, 0); font-family: =
Hack-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; float: none; display: inline !important;" class=3D"">none of the =
ANSI escape sequences used by the loader work on the pi's =
video</span><br style=3D"caret-color: rgb(0, 0, 0); font-family: =
Hack-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><span style=3D"caret-color: rgb(0, 0, 0); font-family: =
Hack-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; float: none; display: inline !important;" class=3D"">console, so =
once the menu starts it just looks like raw ANSI code garbage</span><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Hack-Regular; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><span style=3D"caret-color: rgb(0, 0, 0); font-family: =
Hack-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; float: none; display: inline !important;" class=3D"">until the =
kernel starts booting.)</span><br style=3D"caret-color: rgb(0, 0, 0); =
font-family: Hack-Regular; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;" class=3D""></div></blockquote><div><br =
class=3D""></div><div>If&nbsp;<span style=3D"font-family: Hack; =
background-color: rgb(255, 255, 255); font-variant-ligatures: =
no-common-ligatures;" class=3D"">RB_SERIAL | RB_</span><span =
style=3D"font-family: Hack; font-variant-ligatures: =
no-common-ligatures;" class=3D"">MULT</span><span style=3D"font-family: =
Hack; background-color: rgb(255, 255, 255); font-variant-ligatures: =
no-common-ligatures;" class=3D"">IPLE is returned from&nbsp;</span><span =
style=3D"background-color: rgb(255, 255, 255);" class=3D""><font =
face=3D"Hack" class=3D"">parse_uefi_con_out(), we do =
keep&nbsp;=E2=80=9Ctext=E2=80=9D mode, meaning, we output to UEFI =
console with Simple Text Output protocol.</font></span></div><div><span =
style=3D"background-color: rgb(255, 255, 255);" class=3D""><font =
face=3D"Hack" class=3D""><br class=3D""></font></span></div><div>ANSI =
code like garbage on screen means there is no interpreter and we end up =
sending sequences to console UEFI video console has no idea how to =
handle those; if serial port is also bound to console output, the Simple =
Text Output protocol does not pass ESC through, so terminal emulator at =
the other end of the serial link also does draw =
garbage.&nbsp;</div><div><br class=3D""></div><div>So, garbage means =
=E2=80=9Ctext" mode + no TERM_EMU is defined at build =
time.</div><div></div><div><br =
class=3D""></div><div>rgds,</div><div>toomas</div><br =
class=3D""><blockquote type=3D"cite" class=3D""><div class=3D""><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Hack-Regular; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><span style=3D"caret-color: rgb(0, 0, 0); font-family: =
Hack-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; float: none; display: inline !important;" class=3D"">Not sure if =
this warrants UPDATING as the effect is that the serial =
console</span><br style=3D"caret-color: rgb(0, 0, 0); font-family: =
Hack-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><span style=3D"caret-color: rgb(0, 0, 0); font-family: =
Hack-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; float: none; display: inline !important;" class=3D"">seems to stop =
working? &nbsp;The lack of working dual console output is =
perhaps</span><br style=3D"caret-color: rgb(0, 0, 0); font-family: =
Hack-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><span style=3D"caret-color: rgb(0, 0, 0); font-family: =
Hack-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; float: none; display: inline !important;" class=3D"">the only real =
bug. &nbsp;Not sure what is up there.</span><br style=3D"caret-color: =
rgb(0, 0, 0); font-family: Hack-Regular; font-size: 12px; font-style: =
normal; font-variant-caps: normal; font-weight: 400; letter-spacing: =
normal; text-align: start; text-indent: 0px; text-transform: none; =
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;" class=3D""><br style=3D"caret-color: rgb(0, 0, =
0); font-family: Hack-Regular; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;" class=3D""><span style=3D"caret-color: rgb(0, 0, =
0); font-family: Hack-Regular; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;" =
class=3D"">--<span class=3D"Apple-converted-space">&nbsp;</span></span><br=
 style=3D"caret-color: rgb(0, 0, 0); font-family: Hack-Regular; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><span style=3D"caret-color: rgb(0, 0, 0); font-family: =
Hack-Regular; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; float: none; display: inline !important;" class=3D"">John =
Baldwin</span></div></blockquote></div><br class=3D""></body></html>=

--Apple-Mail=_53C56070-8524-4BCC-B129-404EE3099AA9--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?09EEDF01-3894-4157-90A4-C884B5D1BBD2>