From nobody Sun May 29 15:03:56 2022 X-Original-To: freebsd-hackers@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 9884C1B5561B for ; Sun, 29 May 2022 15:04:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-vk1-xa32.google.com (mail-vk1-xa32.google.com [IPv6:2607:f8b0:4864:20::a32]) (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 "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LB1yw2S32z3pkN for ; Sun, 29 May 2022 15:04:08 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-vk1-xa32.google.com with SMTP id n20so289160vkl.9 for ; Sun, 29 May 2022 08:04:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+LqHnVeiWVOS6i23b2SKpHm2xuc+so9woATIN6xxnAE=; b=JL1t+p27wybgGtNrwBKALY8GIGyJ5IKKTfeTtqjzPG3m1HwtjZUTQfDnA7ByUI95XI glyeAiVX1JJZ9tZ1cWm+W24xXyzPpQ785/Yrd4boRQx/NlZkd1v/7ocBQP5lJYlnQMQh SnsZYsZyZgxyULQIPivQjF/aYXTPB2bSHcCzUXvCJIKj8ZD2wJdsO/Z70GDRUnvhRMmF Gihg5i5+KikbT5+4p4p734g0AYpFJNHstj8gxtQnT195WYCV87FWSC8RJJkZ0IwHnbu+ aorXHQgqNglqAFnMVqCvvbIr/yZLA0aW104nUWMLyPgJYE9dj8eqb9YQi3Hb7ybTmCxX ZW8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+LqHnVeiWVOS6i23b2SKpHm2xuc+so9woATIN6xxnAE=; b=kKcecQvEeqfnPgj3K7kN0JFkrZC1LpRrpFK/9w2CPxwRJExeLm3jHjjeel36cG2lwQ jZzH9rlXL1SnFinaTnyigRi40LfVbS0/2IQLsb0q1XyQPP9rvOMXfhQ1x4HSMaZ8ndnT 9otSag67AsKqimtZfrf0pfndKNPR6vIE2kxsJgNNwmHIy7uDkJloWKH7pmdovA1kYwjd sAVcVY03nOjtXLgdhfItv05hPvVe2oVxNCh3S3bk5AKUytCyB3xM02Vl6HVNjs/17R91 uIcSkVAMTaBaMULibsSapi3S5cw4WjURPFVKZXH8DuapShVPTqlrEtzpOYz09NQ6uJlu jPYQ== X-Gm-Message-State: AOAM531vGZLVuY6P4raPJGXe49VO+jRmj2Ak8sWoIni6QvY4fjHh5Yrw ipMUutjXSGRfVpFcnCpzIMXMEWUL9yE3YgqnE+dzOHsQZ3E= X-Google-Smtp-Source: ABdhPJw2Ka9It76bH8JEMXDisEhOs8RRa27mvuzUS/0IXMWUKd89jrOiojw3ty0nLR9CNUipn/d9MYSXEc0ZJm4K2KE= X-Received: by 2002:a1f:5981:0:b0:358:4f47:b321 with SMTP id n123-20020a1f5981000000b003584f47b321mr7748035vkb.3.1653836647733; Sun, 29 May 2022 08:04:07 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 References: <3D090089-F20B-4B5D-A589-391E6536A875@chrisbowman.com> In-Reply-To: <3D090089-F20B-4B5D-A589-391E6536A875@chrisbowman.com> From: Warner Losh Date: Sun, 29 May 2022 09:03:56 -0600 Message-ID: Subject: Re: putchar in boot1.c adds extra blank lines on Xilinx ZYNQ board with U-boot 2020.04 To: Christopher Bowman Cc: FreeBSD Hackers Content-Type: multipart/alternative; boundary="000000000000e7b02205e027d901" X-Rspamd-Queue-Id: 4LB1yw2S32z3pkN X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20210112.gappssmtp.com header.s=20210112 header.b=JL1t+p27; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::a32) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [0.99 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.97)[-0.971]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20210112.gappssmtp.com:s=20210112]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.96)[0.961]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20210112.gappssmtp.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::a32:from]; NEURAL_SPAM_LONG(1.00)[0.995]; MLMMJ_DEST(0.00)[freebsd-hackers]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; R_SPF_NA(0.00)[no SPF record]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N --000000000000e7b02205e027d901 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, May 29, 2022, 7:56 AM Christopher Bowman wrote: > Looking at /usr/src/stand/efi/boot1/boot1.c > > The bottom of the file has: > void > putchar(int c) > { > CHAR16 buf[2]; > > if (c =3D=3D '\n') { > buf[0] =3D '\r'; > buf[1] =3D 0; > ST->ConOut->OutputString(ST->ConOut, buf); > } > buf[0] =3D c; > buf[1] =3D 0; > ST->ConOut->OutputString(ST->ConOut, buf); > } > > On my platform this results in an extra blank line after each new line. > > I=E2=80=99m running on a Xilinx ZYNQ board with U-boot 2020.04. > > Does this blank line show on other platforms too? If so is this the > desired functionality? Perhaps it=E2=80=99s needed for serial consoles t= o work > right? > I=E2=80=99m running locally with the if statement completely removed and = that > fixes the extraneous blank lines I see. > No other platform does that... in fact, no carriage return would mess up other platforms. It's needed everywhere for all kinds of consoles. Warner Warner > Regards, > Christopher > --000000000000e7b02205e027d901 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Sun, May 29, 2022, 7:56 AM Christopher Bowman <<= a href=3D"mailto:crb@chrisbowman.com">crb@chrisbowman.com> wrote:
Looking at /usr/src/stand/efi/boot1/b= oot1.c

The bottom of the file has:
void
putchar(int c)
{
=C2=A0 =C2=A0 =C2=A0 =C2=A0 CHAR16 buf[2];

=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (c =3D=3D '\n') {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 buf[0] =3D '\r&= #39;;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 buf[1] =3D 0;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ST->ConOut->O= utputString(ST->ConOut, buf);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
=C2=A0 =C2=A0 =C2=A0 =C2=A0 buf[0] =3D c;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 buf[1] =3D 0;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ST->ConOut->OutputString(ST->ConOut, b= uf);
}

On my platform this results in an extra blank line after each new line.

I=E2=80=99m running on a Xilinx ZYNQ board with U-boot 2020.04.

Does this blank line show on other platforms too?=C2=A0 If so is this the d= esired functionality?=C2=A0 Perhaps it=E2=80=99s needed for serial consoles= to work right?
I=E2=80=99m running locally with the if statement completely removed and th= at fixes the extraneous blank lines I see.

No other platform does that... in= fact, no carriage return would mess up other platforms. It's needed ev= erywhere for all kinds of consoles.=C2=A0

=
Warner=C2=A0

Warner
Regards,
Christopher
--000000000000e7b02205e027d901--