From nobody Fri Sep 23 22:26:18 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MZ6FG28jLz4d5d2 for ; Fri, 23 Sep 2022 22:26:26 +0000 (UTC) (envelope-from tsoome@me.com) Received: from pv50p00im-hyfv10011601.me.com (pv50p00im-hyfv10011601.me.com [17.58.6.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4MZ6FF1qNHz3krv for ; Fri, 23 Sep 2022 22:26:25 +0000 (UTC) (envelope-from tsoome@me.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1663971983; bh=qcH2uyGFuI9uQTBeiGzVi96ArW3WqizQLxeQLfTFSPA=; h=From:Message-Id:Content-Type:Mime-Version:Subject:Date:To; b=1bc3CT4NbsjxeZEO9ohIPKW144MV4M8PeuuZ2Gbiqg6/PAzOtKOVjUCo+1MN5gg+h Dy6ZsBCWrpbcz+Gbjf0r0PHaBDl6bNT7FLhKBDpL5hJHrFQJh4eF0ia2VVbVG9BZxv cLe/UJpSw/t8GUtk41sGuhpsJNsNVO7/mjtY6uP2sjjbKQNHqpRmThuM+fhHQXjkUF w/M1Vl4Rf90Jj89byLmnqDYSDOkI3scaIKPz2qWCDL1mu2ddgpgPzIl4Pywfh/Fe1M EEyr5wCqJllO4T3TfLd8A05VqwQWV2/pSztM27pjUkG7iVKULyPLiTbjPnWSJQIpGF nyVfiVlVApUDQ== Received: from smtpclient.apple (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-hyfv10011601.me.com (Postfix) with ESMTPSA id 316D996067C; Fri, 23 Sep 2022 22:26:20 +0000 (UTC) From: Toomas Soome Message-Id: <09EEDF01-3894-4157-90A4-C884B5D1BBD2@me.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_53C56070-8524-4BCC-B129-404EE3099AA9" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: git: df065f699f1f - main - stand: More sensible defaults when ConOut is missing Date: Sat, 24 Sep 2022 01:26:18 +0300 In-Reply-To: <0fccddc3-126d-f7b6-3b69-5fc1cbdb2775@FreeBSD.org> Cc: Warner Losh , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" To: John Baldwin References: <202208270418.27R4IkeL078154@gitrepo.freebsd.org> <0fccddc3-126d-f7b6-3b69-5fc1cbdb2775@FreeBSD.org> X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Proofpoint-ORIG-GUID: FK24m1FF-Jj3i6Ym-aa3zLqp9_ubsGaO X-Proofpoint-GUID: FK24m1FF-Jj3i6Ym-aa3zLqp9_ubsGaO X-Proofpoint-Virus-Version: =?UTF-8?Q?vendor=3Dfsecure_engine=3D1.1.170-22c6f66c430a71ce266a39bfe25bc?= =?UTF-8?Q?2903e8d5c8f:6.0.517,18.0.572,17.11.64.514.0000000_definitions?= =?UTF-8?Q?=3D2022-06-21=5F01:2022-06-21=5F01,2020-02-14=5F11,2022-02-23?= =?UTF-8?Q?=5F01_signatures=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 clxscore=1015 phishscore=0 adultscore=0 mlxlogscore=999 mlxscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2209230145 X-Rspamd-Queue-Id: 4MZ6FF1qNHz3krv X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=me.com header.s=1a1hai header.b=1bc3CT4N; dmarc=pass (policy=quarantine) header.from=me.com; spf=pass (mx1.freebsd.org: domain of tsoome@me.com designates 17.58.6.43 as permitted sender) smtp.mailfrom=tsoome@me.com X-Spamd-Result: default: False [-3.59 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-0.99)[-0.995]; DMARC_POLICY_ALLOW(-0.50)[me.com,quarantine]; MV_CASE(0.50)[]; R_DKIM_ALLOW(-0.20)[me.com:s=1a1hai]; R_SPF_ALLOW(-0.20)[+ip4:17.58.0.0/16]; RCVD_IN_DNSWL_LOW(-0.10)[17.58.6.43:from]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; FREEFALL_USER(0.00)[tsoome]; TO_DN_EQ_ADDR_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; ARC_NA(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; DWL_DNSWL_NONE(0.00)[me.com:dkim]; FREEMAIL_ENVFROM(0.00)[me.com]; ASN(0.00)[asn:714, ipnet:17.58.0.0/20, country:US]; FREEMAIL_FROM(0.00)[me.com]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[5]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[me.com:+]; RCVD_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N --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 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 >> AuthorDate: 2022-08-26 21:46:33 +0000 >> Commit: Warner Losh >> 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

On 24. Sep 2022, at 00:29, 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=3Ddf065f699f1ff819bb960= 7c44a6754275ab335ed
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.)

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. 

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

rgds,
toomas


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.

-- John = Baldwin

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