Date: Tue, 24 Sep 2024 09:06:41 -0600 From: Warner Losh <imp@bsdimp.com> To: Dennis Clarke <dclarke@blastwave.org> Cc: FreeBSD Current <current@freebsd.org> Subject: Re: regarding that stack of newline chars expressed at boot Message-ID: <CANCZdfo0T-JSa7Ly6PiwF4DB7vFr7RuTg822mP9S2A0nv_kDfQ@mail.gmail.com> In-Reply-To: <CANCZdfoQwxUvfY=Y2Z-s9k3h-kK=rJxVR4gxs1weR5DtXyoMhA@mail.gmail.com> References: <2661b46d-b1bb-4731-acbd-75a7fb3c6233@blastwave.org> <CANCZdfoQwxUvfY=Y2Z-s9k3h-kK=rJxVR4gxs1weR5DtXyoMhA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <imp@bsdimp.com> 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 <dclarke@blastwave.= org> > 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 <div dir=3D"ltr"><div dir=3D"ltr"><a href=3D"https://reviews.freebsd.org/D4= 6771">https://reviews.freebsd.org/D46771</a> might fix this setup. Dennis, = can you test it?</div><div>It seems to work for me, but it's good to ha= ve more eyes on it.</div><div dir=3D"ltr"><br></div><div>Warner</div><br><d= iv class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Sun, Sep = 22, 2024 at 1:46=E2=80=AFPM Warner Losh <<a href=3D"mailto:imp@bsdimp.co= m">imp@bsdimp.com</a>> wrote:<br></div><blockquote class=3D"gmail_quote"= style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);p= adding-left:1ex"><div dir=3D"ltr"><div>Consider the following (cut and past= ed, so you may need to tweak).</div><div><br></div><div>Warner</div><div><b= r></div>diff --git a/stand/lua/menu.lua b/stand/lua/menu.lua<br>index ed843= 60d93b0..bab99b79c253 100644<br>--- a/stand/lua/menu.lua<br>+++ b/stand/lua= /menu.lua<br>@@ -533,6 +533,14 @@ function menu.run()<br>=C2=A0 =C2=A0 =C2= =A0 =C2=A0 print("Exiting menu!")<br>=C2=A0end<br><br>+local func= tion print_str(str)<br>+ local i<br>+<br>+ for i =3D 1, str.len() do<br>+ = =C2=A0 =C2=A0 =C2=A0 =C2=A0 printc(str[i])<br>+ end<br>+end<br>+<br>=C2=A0f= unction menu.autoboot(delay)<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 local x =3D loa= der.getenv("loader_menu_timeout_x") or 4<br>=C2=A0 =C2=A0 =C2=A0 = =C2=A0 local y =3D loader.getenv("loader_menu_timeout_y") or 24<b= r>@@ -544,7 +552,7 @@ function menu.autoboot(delay)<br>=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<br>=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<br>=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)<br>- =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 print("Aut= oboot in " .. time ..<br>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 print_str("Autoboot in " .. time ..<br>=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 ")<br>=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()<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 end<b= r></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr= ">On Sun, Sep 22, 2024 at 6:15=E2=80=AFPM Dennis Clarke <<a href=3D"mail= to:dclarke@blastwave.org" target=3D"_blank">dclarke@blastwave.org</a>> w= rote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0p= x 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br> <br> This is from the "better late than never" file. So yes, any machi= ne I<br> had with a serial console was kicking out a newline char on every one<br> of the "autoboot_delay" countdown. Seems to be a default of 10 se= cs<br> and so therefore I was seeing ten lines of stuff.<br> <br> Seems to be related to :<br> <br> <br> <a href=3D"https://cgit.freebsd.org/src/commit/?id=3D101afbc6ee2f06f77e6886= f1f3ffe115c579967c" rel=3D"noreferrer" target=3D"_blank">https://cgit.freeb= sd.org/src/commit/?id=3D101afbc6ee2f06f77e6886f1f3ffe115c579967c</a><br> <br> The trivial solution is to NOT use and old fashioned 80x24 DEC VT100<br> type XTerm size for the session that connects to serial. The behavior<br> vanishes at 80x25 now. I see that as the old DOS PC-Term size that some<br> folks at Microsoft loved. Many years ago.<br> <br> Maybe it would be more elegant to just output the countdown secs number<br> and then utter 010 BS chars and keep kicking out numbers that overwrite<br> whatever was there before?<br> <br> Or do nothing.<br> <br> Hardly an issue really. Just seemed weird when I saw it.<br> <br> Thanks for letting=C2=A0 me paint the bikeshed.<br> <br> <br> --<br> Dennis Clarke<br> RISC-V/SPARC/PPC/ARM/CISC<br> UNIX and Linux spoken<br> <br> </blockquote></div> </blockquote></div></div> --00000000000007797e0622dedb9e--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfo0T-JSa7Ly6PiwF4DB7vFr7RuTg822mP9S2A0nv_kDfQ>