From nobody Tue Sep 24 15:06:41 2024 X-Original-To: current@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 4XCjrH4plbz5XtBK for ; Tue, 24 Sep 2024 15:06:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XCjrG4FSZz4DJ2 for ; Tue, 24 Sep 2024 15:06:54 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20230601.gappssmtp.com header.s=20230601 header.b="w4/OWWAp"; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::62c) smtp.mailfrom=wlosh@bsdimp.com Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-2068bee21d8so57338895ad.2 for ; Tue, 24 Sep 2024 08:06:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1727190413; x=1727795213; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=JhkpIQxZP/z7FLgdnfrI+0wDw0JmEGiCmORhO3HiL90=; b=w4/OWWAp51BBs+0IMYyyGshRGM0bipRe6BLnskME5tgYnHW44NUShZ62n/6f1ZDT2e OyYOVHNsWmLFsknOXU2LIFmvp/wgi29KcqNB4W2p+VofAdRPBuLzAUrqw+2PcuZC7YPO 4nu0c77+qRae0g6C/Xt4QRz3Bu2/4re+icA+yeJnnPWKIHjGi8TfEGvsOQcx2abqLn2p +VuH+/A028Rrmz2ZMopJhEe/b3A5VxWOwbhPHryrzpnSqPQloTQ3u0nw6+RVQ6sG8lHj p/gDqmXDvDDoliOu4Z4+mSZqqqhM6qGFwNlZ2Ow2EUUWbct2huOzSCJvJzgsC49HXE/S MDKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727190413; x=1727795213; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JhkpIQxZP/z7FLgdnfrI+0wDw0JmEGiCmORhO3HiL90=; b=ek+33MIDVQP3qMgUWXUPlZp+xTLt8TrkacaF9AjndqX3CtIb1ZuGdxhEs16rsARgp6 5hTsehZmxucN8TnvsJbwpG0nRscF5stTM7SJJNWFHzRCFch0NgZLRq4Te6QuaHE+nOdj P+ztPm2ZzMSZsPRGHDOYh5BcNdGO5r59GbepMSh/xm7pPhbzoIcBa7joClJcvYfjqDcA eVxyQCBxfK1IyK9NHSOG0mdUlE/gB2KB5TiaBs9MNwk4rm3rhbD0G6T9t4fMqnmZiu/a 1iLnQuDz99E591p6U6dnNuMzsnK8vzsy+e5HvxVxK04ff6OCaqdgVuIglcAWJGt4BxPd FLig== X-Gm-Message-State: AOJu0YyHxijpgz+0hLro2Kp6irxyxY4524p3CcdJ4JBsMgh3qfFBnkrp u3lh99hGz7tnse5HTNV2OdDF5mJ8g56d7+MSytKoCXPBW0uUdFlBOGHuAJh4QNPnsmSA7OLnJzJ dIiglrCTwmocgD3iIpyzLVMSwzXu3AQ3nr9V9Og== X-Google-Smtp-Source: AGHT+IE6MbGP9J0/DbvWNynyyPmtaaPFBRleh4zNd+qkOs1a1TJ+RaRjzbe/GQQDtb4JNVKVh5qwUdDBFODjRwKCPM0= X-Received: by 2002:a17:90b:310b:b0:2d8:f11e:f7e with SMTP id 98e67ed59e1d1-2dd7f3e4f0fmr18597995a91.12.1727190413038; Tue, 24 Sep 2024 08:06:53 -0700 (PDT) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 References: <2661b46d-b1bb-4731-acbd-75a7fb3c6233@blastwave.org> In-Reply-To: From: Warner Losh Date: Tue, 24 Sep 2024 09:06:41 -0600 Message-ID: Subject: Re: regarding that stack of newline chars expressed at boot To: Dennis Clarke Cc: FreeBSD Current Content-Type: multipart/alternative; boundary="00000000000007797e0622dedb9e" X-Spamd-Result: default: False [-2.99 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.990]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20230601.gappssmtp.com:s=20230601]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; MISSING_XM_UA(0.00)[]; R_SPF_NA(0.00)[no SPF record]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_TWO(0.00)[2]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; FROM_HAS_DN(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::62c:from]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[current@freebsd.org]; MLMMJ_DEST(0.00)[current@freebsd.org]; DKIM_TRACE(0.00)[bsdimp-com.20230601.gappssmtp.com:+] X-Rspamd-Queue-Id: 4XCjrG4FSZz4DJ2 X-Spamd-Bar: -- --00000000000007797e0622dedb9e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable https://reviews.freebsd.org/D46771 might fix this setup. Dennis, can you test it? It seems to work for me, but it's good to have more eyes on it. Warner On Sun, Sep 22, 2024 at 1:46=E2=80=AFPM Warner Losh wrote: > Consider the following (cut and pasted, so you may need to tweak). > > Warner > > diff --git a/stand/lua/menu.lua b/stand/lua/menu.lua > index ed84360d93b0..bab99b79c253 100644 > --- a/stand/lua/menu.lua > +++ b/stand/lua/menu.lua > @@ -533,6 +533,14 @@ function menu.run() > print("Exiting menu!") > end > > +local function print_str(str) > + local i > + > + for i =3D 1, str.len() do > + printc(str[i]) > + end > +end > + > function menu.autoboot(delay) > local x =3D loader.getenv("loader_menu_timeout_x") or 4 > local y =3D loader.getenv("loader_menu_timeout_y") or 24 > @@ -544,7 +552,7 @@ function menu.autoboot(delay) > if last =3D=3D nil or last ~=3D time then > last =3D time > screen.setcursor(x, y) > - print("Autoboot in " .. time .. > + print_str("Autoboot in " .. time .. > " seconds. [Space] to pause ") > screen.defcursor() > end > > On Sun, Sep 22, 2024 at 6:15=E2=80=AFPM Dennis Clarke > wrote: > >> >> >> This is from the "better late than never" file. So yes, any machine I >> had with a serial console was kicking out a newline char on every one >> of the "autoboot_delay" countdown. Seems to be a default of 10 secs >> and so therefore I was seeing ten lines of stuff. >> >> Seems to be related to : >> >> >> >> https://cgit.freebsd.org/src/commit/?id=3D101afbc6ee2f06f77e6886f1f3ffe1= 15c579967c >> >> The trivial solution is to NOT use and old fashioned 80x24 DEC VT100 >> type XTerm size for the session that connects to serial. The behavior >> vanishes at 80x25 now. I see that as the old DOS PC-Term size that some >> folks at Microsoft loved. Many years ago. >> >> Maybe it would be more elegant to just output the countdown secs number >> and then utter 010 BS chars and keep kicking out numbers that overwrite >> whatever was there before? >> >> Or do nothing. >> >> Hardly an issue really. Just seemed weird when I saw it. >> >> Thanks for letting me paint the bikeshed. >> >> >> -- >> Dennis Clarke >> RISC-V/SPARC/PPC/ARM/CISC >> UNIX and Linux spoken >> >> --00000000000007797e0622dedb9e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
https://reviews.freebsd.org/D46771 might fix this setup. Dennis, = can you test it?
It seems to work for me, but it's good to ha= ve more eyes on it.

Warner

On Sun, Sep = 22, 2024 at 1:46=E2=80=AFPM Warner Losh <imp@bsdimp.com> wrote:
Consider the following (cut and past= ed, so you may need to tweak).

Warner
diff --git a/stand/lua/menu.lua b/stand/lua/menu.lua
index ed843= 60d93b0..bab99b79c253 100644
--- a/stand/lua/menu.lua
+++ b/stand/lua= /menu.lua
@@ -533,6 +533,14 @@ function menu.run()
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 print("Exiting menu!")
=C2=A0end

+local func= tion print_str(str)
+ local i
+
+ for i =3D 1, str.len() do
+ = =C2=A0 =C2=A0 =C2=A0 =C2=A0 printc(str[i])
+ end
+end
+
=C2=A0f= unction menu.autoboot(delay)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 local x =3D loa= der.getenv("loader_menu_timeout_x") or 4
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 local y =3D loader.getenv("loader_menu_timeout_y") or 24@@ -544,7 +552,7 @@ function menu.autoboot(delay)
=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if last =3D=3D nil or last ~=3D time th= en
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 last =3D time
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 screen.setcursor(x, y)
- =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 print("Aut= oboot in " .. time ..
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 print_str("Autoboot in " .. time ..
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 " seconds. [Space] to pause ")
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 screen.d= efcursor()
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 end

On Sun, Sep 22, 2024 at 6:15=E2=80=AFPM Dennis Clarke <dclarke@blastwave.org> w= rote:


This is from the "better late than never" file. So yes, any machi= ne I
had with a serial console was kicking out a newline char on every one
of the "autoboot_delay" countdown. Seems to be a default of 10 se= cs
and so therefore I was seeing ten lines of stuff.

Seems to be related to :


https://cgit.freeb= sd.org/src/commit/?id=3D101afbc6ee2f06f77e6886f1f3ffe115c579967c

The trivial solution is to NOT use and old fashioned 80x24 DEC VT100
type XTerm size for the session that connects to serial. The behavior
vanishes at 80x25 now. I see that as the old DOS PC-Term size that some
folks at Microsoft loved. Many years ago.

Maybe it would be more elegant to just output the countdown secs number
and then utter 010 BS chars and keep kicking out numbers that overwrite
whatever was there before?

Or do nothing.

Hardly an issue really. Just seemed weird when I saw it.

Thanks for letting=C2=A0 me paint the bikeshed.


--
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken

--00000000000007797e0622dedb9e--