<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Mike,<div class=""><br class=""></div><div class="">That reminds me that my patch to fix this for Xcode is still in limbo. </div><div class=""><br class=""></div><div class="">Thanks,</div><div class=""><br class=""></div><div class="">Andrew Fish<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Aug 26, 2021, at 9:44 AM, Kinney, Michael D <<a href="mailto:michael.d.kinney@intel.com" class="">michael.d.kinney@intel.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Marvin,</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">The main reason most components in the EDK II repos continue to use the variables is<span class="Apple-converted-space"> </span></span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">because there are incomplete tools to generate PE/COFF resource sections for all</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">the OS/compiler combinations that EDK II supports.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">The preference would be to use PE/COFF resource sections and we would have converted</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">all components to that style long ago if the tools existed to be aligned with the</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">UEFI Specification instead of an EDK II specific implementation feature.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Also, it is not a good idea to only look at the open source EDK II repos to</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">understand how a feature is used.  There are many downstream consumers of the</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">EDK II repos.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">The UEFI Driver Writer's Guide *only* documents the PE/COFF resource section</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">method.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="https://tianocore-docs.github.io/edk2-UefiDriverWritersGuide/draft/7_driver_entry_point/74_adding_hii_packages_feature.html#74-adding-hii-packages-feature" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://tianocore-docs.github.io/edk2-UefiDriverWritersGuide/draft/7_driver_entry_point/74_adding_hii_packages_feature.html#74-adding-hii-packages-feature</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Best regards,</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Mike</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">-----Original Message-----<br class="">From: Marvin Häuser <<a href="mailto:mhaeuser@posteo.de" class="">mhaeuser@posteo.de</a>><br class="">Sent: Thursday, August 26, 2021 9:07 AM<br class="">To:<span class="Apple-converted-space"> </span><a href="mailto:tim.lewis@insyde.com" class="">tim.lewis@insyde.com</a>;<span class="Apple-converted-space"> </span><a href="mailto:devel@edk2.groups.io" class="">devel@edk2.groups.io</a>; Kinney, Michael D <<a href="mailto:michael.d.kinney@intel.com" class="">michael.d.kinney@intel.com</a>><br class="">Cc: 'Andrew Fish' <<a href="mailto:afish@apple.com" class="">afish@apple.com</a>>;<span class="Apple-converted-space"> </span><a href="mailto:leif@nuviainc.com" class="">leif@nuviainc.com</a>; Ni, Ray <<a href="mailto:ray.ni@intel.com" class="">ray.ni@intel.com</a>>; Gao, Zhichao <<a href="mailto:zhichao.gao@intel.com" class="">zhichao.gao@intel.com</a>>;<br class="">Wang, Jian J <<a href="mailto:jian.j.wang@intel.com" class="">jian.j.wang@intel.com</a>>; Wu, Hao A <<a href="mailto:hao.a.wu@intel.com" class="">hao.a.wu@intel.com</a>>; Bi, Dandan <<a href="mailto:dandan.bi@intel.com" class="">dandan.bi@intel.com</a>>; Dong, Eric<br class=""><<a href="mailto:eric.dong@intel.com" class="">eric.dong@intel.com</a>>; 'Bret Barkelew' <<a href="mailto:Bret.Barkelew@microsoft.com" class="">Bret.Barkelew@microsoft.com</a>>; 'Vitaly Cheptsov' <<a href="mailto:vit9696@protonmail.com" class="">vit9696@protonmail.com</a>><br class="">Subject: Re: [edk2-devel] [RFC] Expose HII package list via C variables<br class=""><br class="">Hey Tim,<br class=""><br class="">Interesting, do you happen to have some tool or code that performs such<br class="">edits at hand to take a look at? Seems like most modules already use<br class="">variables and thus cannot be modified in such a way even right now?<br class=""><br class="">That's the kind of information I am looking for, thanks a lot!<br class=""><br class="">Best regards,<br class="">Marvin<br class=""><br class="">On 26/08/2021 18:01, <a href="mailto:tim.lewis@insyde.com" class="">tim.lewis@insyde.com</a> wrote:<br class=""><blockquote type="cite" class="">Hi Marvin --<br class=""><br class="">I would like to add some historical perspective on this. One of the design requirements back when HII was first<br class=""></blockquote>introduced into the UEFI specification after Intel's initial contribution was that of binary editability. In order to be<br class="">able to reliably find, extract and then re-insert the HII data into the binary, it needed to be discoverable and not<br class="">affect the offsets of the code and data in the binary.<br class=""><blockquote type="cite" class=""><br class="">While it was possible to put some sort of signature in the read-only data sections of the binary and leave padding for<br class=""></blockquote>possible future edits, it was felt that using a PE/COFF section similar to the resource sections was better. Resource<br class="">sections are commonly in use for PE/COFF files (in Windows) and the similar idea existed in the then-extant Mac binary<br class="">format (resource fork?).<br class=""><blockquote type="cite" class=""><br class="">Thanks,<br class=""><br class="">Tim Lewis<br class="">CTO, Insyde Software<br class=""><a href="http://www.insyde.com" class="">www.insyde.com</a><br class=""><br class="">-----Original Message-----<br class="">From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Michael D Kinney<br class="">Sent: Thursday, August 26, 2021 7:37 AM<br class="">To: devel@edk2.groups.io; mhaeuser@posteo.de; Kinney, Michael D <michael.d.kinney@intel.com><br class="">Cc: Andrew Fish <afish@apple.com>; leif@nuviainc.com; Ni, Ray <ray.ni@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>;<br class=""></blockquote>Wang, Jian J <<a href="mailto:jian.j.wang@intel.com" class="">jian.j.wang@intel.com</a>>; Wu, Hao A <<a href="mailto:hao.a.wu@intel.com" class="">hao.a.wu@intel.com</a>>; Bi, Dandan <<a href="mailto:dandan.bi@intel.com" class="">dandan.bi@intel.com</a>>; Dong, Eric<br class=""><<a href="mailto:eric.dong@intel.com" class="">eric.dong@intel.com</a>>; Bret Barkelew <<a href="mailto:Bret.Barkelew@microsoft.com" class="">Bret.Barkelew@microsoft.com</a>>; Vitaly Cheptsov <<a href="mailto:vit9696@protonmail.com" class="">vit9696@protonmail.com</a>><br class=""><blockquote type="cite" class="">Subject: Re: [edk2-devel] [RFC] Expose HII package list via C variables<br class=""><br class="">Marvin,<br class=""><br class="">One constraint in this discussion is that the HII content in a PE/COFF resource section is defined in the UEFI<br class=""></blockquote>Specification, Which means UEFI Apps and UEFI Drivers from media and option ROMs that are not part of the system FW image<br class="">are allowed to use this feature,  This means the system FW PE/COFF loader must support loading HII content from this<br class="">PE/COFF resource section to be UEFI conformant.  So we cannot remove this feature from the PE/COFF loader without changes<br class="">to the UEFI Specification.  Even if changes to the UEFI Specification we made, we would have to continue to support this<br class="">feature for backward compatibility with existing UEFI Apps/Drivers that may be using this feature.<br class=""><blockquote type="cite" class=""><br class="">Thanks,<br class=""><br class="">Mike<br class=""><br class=""><blockquote type="cite" class="">-----Original Message-----<br class="">From: <a href="mailto:devel@edk2.groups.io" class="">devel@edk2.groups.io</a> <<a href="mailto:devel@edk2.groups.io" class="">devel@edk2.groups.io</a>> On Behalf Of Marvin<br class="">Häuser<br class="">Sent: Thursday, August 26, 2021 1:51 AM<br class="">To: <a href="mailto:devel@edk2.groups.io" class="">devel@edk2.groups.io</a>; Kinney, Michael D<br class=""><<a href="mailto:michael.d.kinney@intel.com" class="">michael.d.kinney@intel.com</a>><br class="">Cc: <a href="mailto:devel@edk2.groups.io" class="">devel@edk2.groups.io</a>; Andrew Fish <<a href="mailto:afish@apple.com" class="">afish@apple.com</a>>;<br class=""><a href="mailto:leif@nuviainc.com" class="">leif@nuviainc.com</a>; Ni, Ray <<a href="mailto:ray.ni@intel.com" class="">ray.ni@intel.com</a>>; Gao, Zhichao<br class=""><<a href="mailto:zhichao.gao@intel.com" class="">zhichao.gao@intel.com</a>>; Wang, Jian J <<a href="mailto:jian.j.wang@intel.com" class="">jian.j.wang@intel.com</a>>; Wu, Hao<br class="">A <<a href="mailto:hao.a.wu@intel.com" class="">hao.a.wu@intel.com</a>>; Bi, Dandan <<a href="mailto:dandan.bi@intel.com" class="">dandan.bi@intel.com</a>>; Dong, Eric<br class=""><<a href="mailto:eric.dong@intel.com" class="">eric.dong@intel.com</a>>; Bret Barkelew <<a href="mailto:Bret.Barkelew@microsoft.com" class="">Bret.Barkelew@microsoft.com</a>>;<br class="">Vitaly Cheptsov <<a href="mailto:vit9696@protonmail.com" class="">vit9696@protonmail.com</a>><br class="">Subject: Re: [edk2-devel] [RFC] Expose HII package list via C<br class="">variables<br class=""><br class="">Hey Mike,<br class=""><br class="">Thanks for your reply!<br class=""><br class="">Well, this switch is not well-documented. Looking now at both the<br class="">generation code and the emitted code, it does not generate a package<br class="">list like my code does, but separate data variables (strings and<br class="">images) that cannot easily be passed to HiiDatabase as-is. However<br class="">apparently there are drivers that use this functionality successfully<br class="">by composing the package list at runtime [1].<br class=""><br class="">Looking with this information now at the pattern of using HII C<br class="">variables (which I did not know existed before) vs the PE/COFF HII<br class="">section, most that use latter are Shell applications, which I guess<br class="">means the section has actually been introduced to resolve D.? There<br class="">are exceptions such as LogoDxe [2], which use the PE/COFF section while D.<br class="">is not a problem, hence I got confused, sorry. I think these modules<br class="">should be updated in any case. Do you agree?<br class=""><br class="">So, for modules that use C variables already, my patch would save some<br class="">runtime generation code and dynamic memory allocation for the HII<br class="">package list. This was not my goal (as I said, I didn't realise HII C<br class="">variables already were a thing in the first place), but the changes<br class="">are small enough that it might be worth considering anyway, in my opinion.<br class="">If a HII package list is generated for both Shell and non-Shell apps,<br class="">this also means code paths can be unified. For example, there could be<br class="">a library class with constructor and destructor to add/remove packages<br class="">from the HII database for all modules that use such, Shell or not. For<br class="">BaseTools it means that there is no real need for separate Python and<br class="">C paths as ideally they just generate the exact same data.<br class=""><br class="">Now to D., the only usage for this seems to be that Shell can locate<br class="">the help text in the executable without executing it, yet it is fully<br class="">loaded anyway [3]. To be honest, I find it hard to justify loading an<br class="">executable (PE/COFF loading, memory permission application, the full<br class="">process) to retrieve a help text and then unloading it again,<br class="">especially with the HII code being on a core dispatcher level. 1. to<br class="">7. still hold true in my opinion. Was there any discussion I could<br class="">read through why Shell apps cannot simply support a "--help" or "-?"<br class="">command and output the string themselves? Pushing the burden to the<br class="">Shell apps does preserve the "drawback" that a full loading is<br class="">required (which honestly does not matter for a debugging application<br class="">like Shell), however it does relieve the burden of PE/COFF HII parsing<br class="">from the core dispatcher (which matters a lot in my opinion to keep<br class="">the core simple). It would simply be a normal Shell app execution as<br class="">any other however. If someone wants to avoid the PE/COFF burden<br class="">altogether, they can still provide a .man file.<br class=""><br class="">As for my points 6. and 7., maybe I should provide some context. Due<br class="">to many issues with TE files, platforms started abandoning them and<br class="">returned to PE/COFF Images. I think a big reason for this is that TE<br class="">is not really a sound and complete format, but a stripped version of<br class="">PE/COFF with none of the necessary fixups applied. I'm currently<br class="">sketching a possible alternative [4], and I would really like to not<br class="">having to specify a HII section type, while still preserving<br class="">compatibility with all of the UEFI Image types and use-cases [4].<br class=""><br class="">Thanks again!<br class=""><br class="">Best regards,<br class="">Marvin<br class=""><br class=""><br class="">[1]<br class=""><a href="https://github.com/tianocore/edk2/blob/7b4a99be8a39c12d3a7fc4b8db9f0ea" class="">https://github.com/tianocore/edk2/blob/7b4a99be8a39c12d3a7fc4b8db9f0ea</a><br class="">b4ac688d5/MdeModulePkg/Application/BootManagerMenuAp<br class="">p/BootManagerMenu.c#L929-L934<br class=""><br class="">[2]<br class="">https://github.com/tianocore/edk2/blob/7b4a99be8a39c12d3a7fc4b8db9f0ea<br class="">b4ac688d5/MdeModulePkg/Logo/LogoDxe.inf#L23<br class=""><br class="">[3]<br class=""><br class=""></blockquote></blockquote><a href="https://github.com/tianocore/edk2/blob/7b4a99be8a39c12d3a7fc4b8db9f0eab4ac688d5/ShellPkg/Application/Shell/ShellManParser" class="">https://github.com/tianocore/edk2/blob/7b4a99be8a39c12d3a7fc4b8db9f0eab4ac688d5/ShellPkg/Application/Shell/ShellManParser</a>.<br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">c#L646-L671<br class=""><br class="">[4]<br class=""><a href="https://github.com/mhaeuser/edk2/blob/ue_poc/MdePkg/Include/IndustrySt" class="">https://github.com/mhaeuser/edk2/blob/ue_poc/MdePkg/Include/IndustrySt</a><br class="">andard/UeImage.h<br class=""><br class="">26.08.2021 00:34:12 Michael D Kinney <michael.d.kinney@intel.com>:<br class=""><br class=""><blockquote type="cite" class="">Hi Marvin,<br class=""><br class="">I think this feature is already there and supported.<br class=""><br class="">HII can either be in a global variable or in a PE/COFF resource section.<br class="">The default is a global variable because HII was implemented before<br class="">the PE/COFF resource section feature was added to the UEFI Specification.<br class=""><br class="">There is an INF [Defines] section statement to enable the PE/COFF<br class="">section. See UefiHiiResource in the following link.<br class=""><br class="">https://tianocore-docs.github.io/edk2-InfSpecification/draft/3_edk_i<br class="">i_inf_file_format/34_[defines]_section.html#34-<br class=""></blockquote>defines-section<br class=""><blockquote type="cite" class="">How is your proposal different than this existing capability?<br class=""><br class="">Thanks,<br class=""><br class="">Mike<br class=""><br class=""><blockquote type="cite" class="">-----Original Message-----<br class="">From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of<br class="">Marvin Häuser<br class="">Sent: Wednesday, August 25, 2021 2:21 PM<br class="">To: devel@edk2.groups.io<br class="">Cc: Andrew Fish <afish@apple.com>; leif@nuviainc.com; Kinney,<br class="">Michael D <michael.d.kinney@intel.com>; Ni, Ray <ray.ni@intel.com>;<br class="">Gao, Zhichao <zhichao.gao@intel.com>; Wang, Jian J<br class=""><jian.j.wang@intel.com>; Wu, Hao A <hao.a.wu@intel.com>; Bi, Dandan<br class=""><dandan.bi@intel.com>; Dong, Eric <eric.dong@intel.com>; Bret<br class="">Barkelew <Bret.Barkelew@microsoft.com>; Vitaly Cheptsov<br class=""><vit9696@protonmail.com><br class="">Subject: [edk2-devel] [RFC] Expose HII package list via C variables<br class=""><br class="">Good day everyone,<br class=""><br class="">Currently, the HII package list is stored in a PE/COFF resource<br class="">section [1]. I propose to store it in a C variable (byte array with<br class="">a pointer to it and its size exposed) instead. DxeCore would have a<br class="">guard to toggle the deprecated support for the automatic protocol<br class="">installation. This has the following advantages:<br class=""><br class="">1. Fixes BZ (incl. future toolchains):<br class="">https://bugzilla.tianocore.org/show_bug.cgi?id=557<br class="">2. Universal method across all toolchains and output file formats<br class="">3. Saves error-prone parsing work 4. Saves protocol install/locate<br class="">work, the data is available right away 5. The omission of a<br class="">dedicated section can save space 6. Terse file formats can support<br class="">this and remain terse :) 7. Removes a dependency on the PE/COFF<br class="">format specifically<br class=""><br class="">A *very rough* PoC diff can be found here:<br class="">https://github.com/mhaeuser/edk2/compare/master...wip_hii_cvar<br class="">If the feedback is positive, I will clean it up of course. OVMF<br class="">boots with everything working fine.<br class=""><br class="">I'd explicitly like feedback on the following:<br class="">A. Is this an acceptable solution to BZ 557 (Andrew?)?<br class="">B. Is this an acceptable solution for the "HII workflow" (MdeModule<br class="">maintainers?)?<br class="">C. Is it acceptable to make support UEFI-side support for the old<br class="">mechanism optional (Stewards?)?<br class="">D. Can an acceptable alternative be found for the removed ShellPkg<br class="">code (Shell maintainers?)?<br class=""><br class="">As you can see the BaseTools part also is rough, but that is more a<br class="">question of "how" rather than "whether", so I'll postpone asking about it.<br class=""><br class="">Thanks for your time and feedback!<br class=""><br class="">Best regards,<br class="">Marvin<br class=""><br class=""><br class="">[1] "Once the image is loaded, LoadImage() installs<br class="">EFI_HII_PACKAGE_LIST_PROTOCOL on the handle if the image contains a<br class="">custom PE/COFF resource with the type 'HII'."<br class="">- UEFI 2.9, 7.4, "EFI_BOOT_SERVICES.LoadImage()"<br class=""><br class=""><br class=""><br class=""><br class=""></blockquote><br class=""><br class=""><br class=""></blockquote><br class=""><br class=""><br class=""></blockquote><br class=""><br class=""></blockquote></blockquote></div></blockquote></div><br class=""></div></body></html>


 <div width="1" style="color:white;clear:both">_._,_._,_</div> <hr>   Groups.io Links:<p>   You receive all messages sent to this group.    <p> <a target="_blank" href="https://edk2.groups.io/g/devel/message/79864">View/Reply Online (#79864)</a> |    |  <a target="_blank" href="https://groups.io/mt/85147044/1813853">Mute This Topic</a>  | <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>    <a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> | <a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |  <a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>  [edk2-devel-archive@redhat.com]<br> <div width="1" style="color:white;clear:both">_._,_._,_</div>