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 <<a = href=3D"mailto:jhb@FreeBSD.org" class=3D"">jhb@FreeBSD.org</a>> = 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: = Warner Losh <<a href=3D"mailto:imp@FreeBSD.org"= class=3D"">imp@FreeBSD.org</a>><br class=3D"">AuthorDate: 2022-08-26 = 21:46:33 +0000<br class=3D"">Commit: Warner Losh = <<a href=3D"mailto:imp@FreeBSD.org" = class=3D"">imp@FreeBSD.org</a>><br class=3D"">CommitDate: 2022-08-27 = 04:17:56 +0000<br class=3D""> stand: More = sensible defaults when ConOut is missing<br = class=3D""> When = ConOut is missing, we used to default to serial. Except we did it<br = class=3D""> in the worst way possible by just = setting the howto bits and not<br = class=3D""> updating the console setting, which = lead to weird behavior where we'd<br = class=3D""> get some things on the video port, = others on serial.<br = class=3D""> Instead, = set console to "efi,comconsole" for this case. Also set<br = class=3D""> RB_MULTIPLE always (so we get dual = consoles from the kernel) and or in<br = class=3D""> RB_SERIAL when we can't find GOPs = that suggest the precense of a video<br = class=3D""> console. This will put output in the = most places and have a sensible<br = class=3D""> default for 'primary' console.<br = class=3D""> Sponsored= by: = Netflix<br = class=3D""> Reviewed by: = emaste, = manu<br class=3D""> Differential Revision: = <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. (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.) 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). = (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 <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 </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 =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. </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? 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. 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"> </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>