From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web08.14760.1631120534883670784 for ; Wed, 08 Sep 2021 10:02:15 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=pLu/MOqA; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: ray.ni@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10101"; a="220222158" X-IronPort-AV: E=Sophos;i="5.85,278,1624345200"; d="scan'208";a="220222158" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2021 10:01:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,278,1624345200"; d="scan'208";a="430712294" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga006.jf.intel.com with ESMTP; 08 Sep 2021 10:01:49 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 8 Sep 2021 10:01:49 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Wed, 8 Sep 2021 10:01:49 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.176) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Wed, 8 Sep 2021 10:01:48 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DZxllfOhqHIlDw333i/4+OVK5hcElwE/hAGoRfYD+ob565IlYMccirTusmwpzycixizbwhdGL74Hm/s/frFoKChPDYByp+GD752E1FA+QsJZgHJXMZiP5KTC/XFaTTLqUmaQLgvWonUOGmi8gw5zkdlChePfLQaZSmm1PMYKWYITseWG+3DmObT/gbLHpbRwlhPcQEA6bcl5H2D27w5H6CM+AnLfN8w56sY6YEhVg169Cj8PaBbSjwnW6UMMqvXTcC35olneBeqwOsYBABlK/OomPHKP/0ZuarWyZ+mQmD6nrcsGN1zUKK2/icNf9Hh1EJr1cSRgBVnhGxHfN1fvnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=XkEyeVefFpGcJjl67YgELEvxuqqVg3TD1gAcMs+b3Ss=; b=J1Lt7e3HNjkGzuN/q1yw+nF+7mqkP5z4zSPzjiyFndzyH0UwQV2UyYMhoYj6EmCtBbxjr4St69jyEVFlB7d2QFF9e134zxEKfz6znm73CjIpBxKQZXiqqG5L7iifMb/MPZW03ktfmBF1O+1IWt6+ZGiXaJQNik2CVLkJDEkkKyulA1Wi3YD+HdIw3YucLXcIXluCsb7XqYMf8KkKzgJjnC3rthuKQLNZNYoP1cg2pU+ZSK4c3aXcduPLBLo/jIH0hBdo9t4MuDYyl4fN8hGnman/BA0AnW3EDSfhyp1wa+uW7Rv3s+db4Vc9crJZ52c9T749OHSSFoFB3GA/QDSfvA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XkEyeVefFpGcJjl67YgELEvxuqqVg3TD1gAcMs+b3Ss=; b=pLu/MOqAli7cXBYWgd8XCaKS4Xjs7kPet/nZVq5xriZ3YmX5kqCBZ5yRA3XwxzUCHu7uWQqmBIzNNEGgj2OsxL0cu4TeBMLWHmkW2sf0gyuAH105Fu2Wp3So40g3U0UdZW2r+EDC5Yv9Gathjtjktfg2A+c+nWnTwmhsLEKjUYc= Received: from CO1PR11MB4930.namprd11.prod.outlook.com (2603:10b6:303:9b::11) by MWHPR11MB1552.namprd11.prod.outlook.com (2603:10b6:301:e::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4478.22; Wed, 8 Sep 2021 17:01:48 +0000 Received: from CO1PR11MB4930.namprd11.prod.outlook.com ([fe80::50ce:c9a3:ab37:9fac]) by CO1PR11MB4930.namprd11.prod.outlook.com ([fe80::50ce:c9a3:ab37:9fac%9]) with mapi id 15.20.4500.016; Wed, 8 Sep 2021 17:01:47 +0000 From: "Ni, Ray" To: "Gao, Zhichao" , "devel@edk2.groups.io" CC: "Wang, Jian J" , Liming Gao Subject: Re: [PATCH] MdeModulePkg/UefiBootManagerLib: Limit the boot description to 72 chars Thread-Topic: [PATCH] MdeModulePkg/UefiBootManagerLib: Limit the boot description to 72 chars Thread-Index: AQHXo69pAyIat7X9/kuydzcoMKwMMauYMzaggAAI2FCAAiK1YA== Date: Wed, 8 Sep 2021 17:01:47 +0000 Message-ID: References: <20210907061252.2069-1-zhichao.gao@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d692d8f4-dbd4-4f67-0aa6-08d972ea5859 x-ms-traffictypediagnostic: MWHPR11MB1552: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 0bUhRsNKEC7WnFEKi/S9kP2W6AuPyLIfY7gw3o5FpCMkjbWyMlx+qHM6mA1fReuI+1cqJwu54AF+vHNUPGGZ59RHh6kNyijWP4wIynXm43mU+nT+in6cvlYgefao8o8DIKtj/STTHsI4RIoSI5MISaJ81K6a5UF/KxYQjtk2TSmqvIH7mGgzm8X16N+opu80YEhb13ux4suR7u6eOcL2Yict0q4otGx+eHq6uJX+XEBJva8lDtvaVJFxWKWc+Pp0G3PwbZ9NohZJAYbSGkwOSNdKBI95ohFH7b0KhCFHIIol62mDZ0hN51BY/8luHDS66x8Wwepj83tSBYrXbdlQvyEDwFU9vlHHZqnOyHUh74zGmJ0ON35DN6ntGaWef/lTcv9Z1MduH5ttopEc5I+7Hcug6INNazQ2jWG/0TdscskDMlzj5BuikxlUfCHA2apPaKAsZ3AW9Cn5EJvKPPQdIP9HYb+dGEd4bobVydXsUZLEcuabyUpONKRdzZB0YLgjpOjC/Pk/TMHKqf0Bk0+KkNuuild/P4lTaS8rqEShAQjOYRx79/zGWE3RAMo3N+zD/3PAzNaX3nEU8BoRdG1F21k19tYo4h8lSGVI7AF4Kr/MrmOIDAHnz5WqnJ2JDafzOFxIL5jQ3Yynwt8VTponN5JBnMWQBJTO7gpw3urgQ3bTQsjdcon4fUPXZmU1c+0YIRFvRRHLCcpaFnc5l0d3uK7M4wWCGp9+zbDvDN/1UeyArx77eT5HUD/u4cl8Lvouqemaa40dEq9drqgFtA+c5qZKxr9ttlK5mv8yYKaUe74= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR11MB4930.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(366004)(396003)(346002)(39860400002)(136003)(4326008)(71200400001)(7696005)(26005)(110136005)(9686003)(2906002)(55016002)(86362001)(8936002)(6506007)(8676002)(66556008)(316002)(64756008)(66946007)(66446008)(76116006)(52536014)(38070700005)(66476007)(186003)(966005)(33656002)(478600001)(38100700002)(54906003)(122000001)(5660300002)(83380400001)(53546011);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?zenILxWy4imko/P7wk8//vAB0tn2SmZVhzxVy+0oNkp5ZFTeSY77jmIj+/b7?= =?us-ascii?Q?E4dJhNCY74bYURdUZ/zbQphbp4VaoJR1Fy4khilrf7IWrnHDnZc5dyfOf+7S?= =?us-ascii?Q?D0ZhpwscYoTDW59OEcWcy4LumUrAv9R4taRECd5pxhZGRqXWWlDHwqqdXc4e?= =?us-ascii?Q?fTtOjieAZlOUJ68AGdpSDHabg0BzqhbdAFCD0nyDLipXwmp6B0T++MoWc5xQ?= =?us-ascii?Q?vJzA6QywuZoTbt+bZFI/2uYvt2gU8d78QXXI3sPQ47t6rwZLHIGigc6QjaSz?= =?us-ascii?Q?xJ4a6orThUfwDY1AMX8QFvZQfQLaZSyk9qGkdGa8vgnlf3wiIoeNQCzAkRt+?= =?us-ascii?Q?IAw6eEAsWRi1xnW25LzFKpkP0Jvq+W9P95vK6vPXw3Xy+NsEVlcWnzwQ/WOL?= =?us-ascii?Q?dQ1Cr0Vf7to0bpYo/wxVSs8i6RmaUnl2WP596UKXdLEnK4oiLtWTZn7v+/H6?= =?us-ascii?Q?7tShzhaIswKmmIkN/b5TNhunFEsRATlroIc+V04iFZsaP8I/0kXbkTGg5htj?= =?us-ascii?Q?Zosc8K+TBxeqI+YJobx/Lpn23JWpgsPJvrhpVNBlgd2oExfeatluF98p232B?= =?us-ascii?Q?nFfwNhnuccjdaOWq9S+Nb+0wfQpY8MOJHuGT04+KqEdcRd+WnBoCzvczl0FO?= =?us-ascii?Q?evPkDm4Sz5cBv4zEzZkdKj2wpQQCVyPgbVvmskF27WH94WifxJSynZ4HkGce?= =?us-ascii?Q?dmpwKHJ83fjkCvrb+WcieyJR+VONttATRoeoP5M7C871cdLQNiO0pJXF9wac?= =?us-ascii?Q?FSEWsDteeQk5rEt4VWOlYrPQzFXHEBidHhJhptwxWp3lJnuU8muMw9j01xqf?= =?us-ascii?Q?mdyMKDljHwQMfr+zgW7+cvCPb96xn65WaPwICpaoS64NTA03xCcQDGIuzPyL?= =?us-ascii?Q?AjMX6lM9Vt3/skS2T+d23APAaUHTUGCGN/slcvlc+qt5gXGRuHCgocw16h16?= =?us-ascii?Q?LLuXf76fqS9xyGKHIrd1bbeah7iPO6/7xh3xPIYhJiRQ4Z8tw2h5FCIPDtXc?= =?us-ascii?Q?1SSFfOePa6QSHi0dZT68b6s+NVfLRhyIalLmam5761BIazaErJ1AcsIP5w8o?= =?us-ascii?Q?PgvdPZ4p/vOWdHhMBePQv1LiVMSixNt2bsuQOCrZ7n/5DmC6g4HEX8D4OwD+?= =?us-ascii?Q?PuSZqZS/niI0t+YyXLBumPODg7BjDf/EPJGc1doIw0XFc9ub3+v+ZxsAt7Ag?= =?us-ascii?Q?q2tVFtzr0Hx1XpUM7FqmgqZSb4TU5j1FCxp5pUKWq342R9yQt2DGGOQcR2RV?= =?us-ascii?Q?JrnB0Pyf3ixni6WwSKzHeChVYKN8VV6/lcXNbYAG7dNeFofsBGce1vOjvYyN?= =?us-ascii?Q?wfKC5cY7TGZp6H3V124yZ5qS?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4930.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d692d8f4-dbd4-4f67-0aa6-08d972ea5859 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Sep 2021 17:01:47.8635 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: LHMGpd1Mw6M0hsjP2kgGOXzJwa29j66zr2mboDHJq2PVH30AgkzdUlZ0uuWJejPT2xkarE4ys38Obhk9ZCfbFA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1552 Return-Path: ray.ni@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Zhichao, I didn't mean to update UI logic to support scrolling. I meant to update BM= logic to show partial string of boot description. Thanks, Ray > -----Original Message----- > From: Gao, Zhichao > Sent: Wednesday, September 8, 2021 10:29 AM > To: Ni, Ray ; devel@edk2.groups.io > Cc: Wang, Jian J ; Liming Gao > Subject: RE: [PATCH] MdeModulePkg/UefiBootManagerLib: Limit the boot desc= ription to 72 chars >=20 > Hi Ray, >=20 > Agree with you. I used to think of change the display logic of the BM app= . But it is not tiny. It need to update the scroll bar > definition and one more trace for the item string lines. I would prefer t= o defer it. > The limitation of the boot description length is required. I don't know w= hy some USB disk would have a very long serial number > string. On my opinion, 72 characters is enough for the boot option. If th= ere is no limitation, the boot description can be long > enough that one screen can not even show one item. > 80 * 25 is the minimum mode for most terminal console device. That is why= I choose it and add the limitation. >=20 > Thanks, > Zhichao >=20 > > -----Original Message----- > > From: Ni, Ray > > Sent: Tuesday, September 7, 2021 3:54 PM > > To: Gao, Zhichao ; devel@edk2.groups.io > > Cc: Wang, Jian J ; Liming Gao > > > > Subject: RE: [PATCH] MdeModulePkg/UefiBootManagerLib: Limit the boot > > description to 72 chars > > > > Zhichao, > > The mode 80x25 is platform specific. I don't prefer to update common lo= gic to > > have such limitation. > > Can you update the UI logic of displaying the boot option list? > > > > > -----Original Message----- > > > From: Gao, Zhichao > > > Sent: Tuesday, September 7, 2021 2:13 PM > > > To: devel@edk2.groups.io > > > Cc: Wang, Jian J ; Liming Gao > > > ; Ni, Ray > > > Subject: [PATCH] MdeModulePkg/UefiBootManagerLib: Limit the boot > > > description to 72 chars > > > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3590 > > > > > > The minimum mode is 80*25 which means echo line can have 80 charactor= s > > > and max 25 line on the screen. And the BootManagerMeu see each boot > > > option as one line. The BootManagerMenuApp would have 2 charactors fo= r > > > draw box and 6 charactors for space. So it is better to limit the boo= t > > > description within 72 charactors. > > > > > > Cc: Jian J Wang > > > Cc: Liming Gao > > > Cc: Ray Ni > > > Signed-off-by: Zhichao Gao > > > --- > > > .../Library/UefiBootManagerLib/BmBootDescription.c | 24 > > > ++++++++++++++++++---- > > > 1 file changed, 20 insertions(+), 4 deletions(-) > > > > > > diff --git > > > a/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c > > > b/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c > > > index aa891feb17..7260b2a203 100644 > > > --- a/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c > > > +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmBootDescription.c > > > @@ -1,7 +1,7 @@ > > > /** @file > > > > > > Library functions which relate with boot option description. > > > > > > > > > > > > -Copyright (c) 2011 - 2018, Intel Corporation. All rights > > > reserved.
> > > > > > +Copyright (c) 2011 - 2021, Intel Corporation. All rights > > > +reserved.
> > > > > > (C) Copyright 2015 Hewlett Packard Enterprise Development LP
> > > > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > > > > > > > @@ -14,6 +14,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > > > #define PRODUCT_IDENTIFICATION_OFFSET 11 > > > > > > #define PRODUCT_IDENTIFICATION_LENGTH 16 > > > > > > > > > > > > +#define MAX_BOOT_DESCRIPTION_LEGNTH 72 > > > > > > + > > > > > > CONST UINT16 mBmUsbLangId =3D 0x0409; // English > > > > > > CHAR16 mBmUefiPrefix[] =3D L"UEFI "; > > > > > > > > > > > > @@ -773,6 +775,7 @@ BmGetBootDescription ( > > > CHAR16 *DefaultDescription; > > > > > > CHAR16 *Temp; > > > > > > UINTN Index; > > > > > > + UINTN DescriptionLen; > > > > > > > > > > > > // > > > > > > // Firstly get the default boot description > > > > > > @@ -785,10 +788,23 @@ BmGetBootDescription ( > > > // Avoid description confusion between UEFI & Legacy boot > > > option by adding "UEFI " prefix > > > > > > // ONLY for core provided boot description handler. > > > > > > // > > > > > > - Temp =3D AllocatePool (StrSize (DefaultDescription) + sizeof > > (mBmUefiPrefix)); > > > > > > + if (StrLen (DefaultDescription) + StrLen (mBmUefiPrefix) > > > > + MAX_BOOT_DESCRIPTION_LEGNTH) { > > > > > > + // > > > > > > + // Limit the MAX length of boot description to 72 charactors= . > > > > > > + // Replace the last 3 charactors to L"...". > > > > > > + // > > > > > > + DescriptionLen =3D MAX_BOOT_DESCRIPTION_LEGNTH + 1; > > > > > > + DefaultDescription[MAX_BOOT_DESCRIPTION_LEGNTH - 5 - 3] =3D > > > + L'.'; > > > > > > + DefaultDescription[MAX_BOOT_DESCRIPTION_LEGNTH - 5 - 2] =3D > > > + L'.'; > > > > > > + DefaultDescription[MAX_BOOT_DESCRIPTION_LEGNTH - 5 - 1] =3D > > > + L'.'; > > > > > > + DefaultDescription[MAX_BOOT_DESCRIPTION_LEGNTH - 5] =3D L'\0= '; > > > > > > + } else { > > > > > > + DescriptionLen =3D (StrSize (DefaultDescription) + sizeof > > > + (mBmUefiPrefix)) / sizeof (CHAR16); > > > > > > + } > > > > > > + Temp =3D AllocatePool (DescriptionLen * sizeof (CHAR16)); > > > > > > ASSERT (Temp !=3D NULL); > > > > > > - StrCpyS (Temp, (StrSize (DefaultDescription) + sizeof (mBmUefi= Prefix)) > > / sizeof (CHAR16), mBmUefiPrefix); > > > > > > - StrCatS (Temp, (StrSize (DefaultDescription) + sizeof (mBmUefi= Prefix)) > > / sizeof (CHAR16), DefaultDescription); > > > > > > + StrCpyS (Temp, DescriptionLen, mBmUefiPrefix); > > > > > > + StrCatS (Temp, DescriptionLen, DefaultDescription); > > > > > > FreePool (DefaultDescription); > > > > > > DefaultDescription =3D Temp; > > > > > > break; > > > > > > -- > > > 2.16.2.windows.1