From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web09.52.1571868367827123626 for ; Wed, 23 Oct 2019 15:06:08 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: michael.d.kinney@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Oct 2019 15:06:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,222,1569308400"; d="scan'208,217";a="204079665" Received: from orsmsx108.amr.corp.intel.com ([10.22.240.6]) by FMSMGA003.fm.intel.com with ESMTP; 23 Oct 2019 15:06:06 -0700 Received: from orsmsx156.amr.corp.intel.com (10.22.240.22) by ORSMSX108.amr.corp.intel.com (10.22.240.6) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 23 Oct 2019 15:06:06 -0700 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.28]) by ORSMSX156.amr.corp.intel.com ([169.254.8.60]) with mapi id 14.03.0439.000; Wed, 23 Oct 2019 15:06:06 -0700 From: "Michael D Kinney" To: Kilian Kegel , "devel@edk2.groups.io" , "Kinney, Michael D" CC: "Richardson, Brian" Subject: Re: [staging/branch]: CdePkg - C Development Environment Package Thread-Topic: [staging/branch]: CdePkg - C Development Environment Package Thread-Index: AQHViYyegTYkDl4hFEuX1YcR9g4AEadox3+w Date: Wed, 23 Oct 2019 22:06:05 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.22.254.140] MIME-Version: 1.0 Return-Path: michael.d.kinney@intel.com Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_E92EE9817A31E24EB0585FDF735412F5B9DF1171ORSMSX113amrcor_" --_000_E92EE9817A31E24EB0585FDF735412F5B9DF1171ORSMSX113amrcor_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Kilian, Thanks for the contribution. I have a couple quick comments. * Some files do not have a file header at all. Please update these wit= h a proper file header * Some files have a BSD 2-Clause license. The preferred license for ED= K II is BSD+Patent and we prefer SPDX identifiers. Will you be able to upd= ate to this license and header format? * There are binaries (.lib) files in this branch. Source repos should = not have binaries. The preferred locations for binaries are GitHub release= pages for binaries build from a source tag or the edk2-non-osi repo. * Can you please summarize the differences between the copies of the Em= ulatorPkg and Vlv2TbltDevicePkg in your branch and the versions of those pa= ckages in the edk2 and edk2-platforms repos? Do you need help from those p= ackage maintainers to resolve the differences? Thanks, Mike From: Kilian Kegel Sent: Wednesday, October 23, 2019 1:02 PM To: devel@edk2.groups.io Cc: Kinney, Michael D ; Richardson, Brian Subject: [staging/branch]: CdePkg - C Development Environment Package Hi UEFI community, I'd like to introduce the CdePkg to edk2-staging. Some time ago I decided to write my own ANSI C Library for UEFI Shell and P= OST. The UEFI Shell library ("Torito C Library") has been production-ready for m= ore than one year. The POST version of the library ("CdeLib") is not yet fully tested. I will be demonstrating my verification procedure in the upcoming weeks on = EDK2 STAGING https://github.com/tianocore/edk2-staging/tree/CdePkg Currently there are 3 examples implemented: 1. argvc: https://github.com/tianocore/edk2-staging/blob/CdePkg/CdeValid= ationPkg/HOSTED_ENV/argcv/main.c#L57 argc/argv handling according to https://msdn.microsoft.com/en-us/library/a1= y7w461.aspx 1. systeminterfacePEI: https://github.com/tianocore/edk2-staging/blob/Cd= ePkg/CdeValidationPkg/SYSTEM_IF/systeminterfacePEI/main.c#L57 demonstration, how PeiServices and FileHandle are passed into main() 1. systeminterfaceDXE: https://github.com/tianocore/edk2-staging/blob/Cd= ePkg/CdeValidationPkg/SYSTEM_IF/systeminterfaceDXE/main.c#L57 demonstration, how SystemTable and ImageHandle are passed into main() Upcoming next demonstration will be the clock() function end of this week The idea is to bring the ANSI C Library interface into POST drivers. This will: 1. ease porting tasks 2. allow cross development 3. allow developers to focus on their aims, because they aren't forced t= o keep in mind a lot of additional info (e.g. RShiftU64) 4. provide all intrisics to allow the compiler to be a "C compiler" (e.g. char buffer[256] =3D { 1 };) What is CdePkg and Torito C Library? * CdePkg and Torito C Library are a one man show / after work party, th= at is owned and written solely by myself * CdePkg is a reference implementation only for Microsoft C compiler * CdePkg is a feasibility study * CdePkg is the successor of Torito C, based on the same source code * CdePkg C Development Environment is similar to MdePkg Module Develop= ment Environment but guarantees that the C compiler is always fully usable (all intrinsics = available) and the C90/C95 standard library is always available What are the design goals? * to rewrite the whole thing from scratch, without using any public sou= rce code from GNU, BSD, Watcom * completeness: full blown C90 + C95 support, as lowest common denomina= tor * tailored for UEFI: small code size, for UEFI-POST-driver uses a C-Lib= rary-Driver, that contains core/worker functions for realloc() =3D=3D mall= oc() and free(), entire printf()-family, entire scanf()-family. UEFI-POST-driver just uses small wrapper functions to run the C-Library-Dri= ver code. * stable, exact, chipset independent TSC based clock() with CLOCKS_PER_= SEC =3D=3D 1000 * complete set of the Microsoft C-compiler intrinsic functions * ROM-able! Runs with stack but w/o any static storage duration in .dat= a segment, e.g. for rand(), strtok(), tmpfile() This is required for early PEI before memory sizing, when PEI-images run di= rectly out of flash * Microsoft (bug) compatible (as far as possible) * use original Microsoft header files for UEFI Shell Apps created in= VS2019 * allow expensive debugging tasks of ANSI C .EFI applications in Vis= ual Studio in its Windows NT counter part * to save my lifetime writing a documentation https://github.com/tia= nocore/edk2-staging/tree/CdePkg/implemented.md#validation-status * all the above in one single C-Library CdeLib.lib CdePkg shall be adjusted to other compilers/tool chains too, once it is fea= ture-complete and accepted by the UEFI community. As long as it is for Microsoft VS2019 only. CdePkg README.md is here: h= ttps://github.com/tianocore/edk2-staging/tree/CdePkg#cdepkg CdePkg HOWTO is here: https://github.com/tianocore/edk2-staging/blob/CdePkg= /README.md#howto CdeValidationPkg README.md is here: https://github.com/tianocore/edk2-stagi= ng/blob/CdePkg/CdeValidationPkg/README.md CdeValidationPkg HOWTO is here: https://github.com/tianocore/edk2-staging/b= lob/CdePkg/CdeValidationPkg/README.md HOWTO: 1. clone the edk2-staging repository 2. checkout CdePkg 3. run LAUNCH.BAT 4. run build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -a IA32 5. run DBGEMU.BAT to start emulation (EmulatorPkg) 6. run build -a IA32 -a X64 -n 5 -t VS2015x86 -b DEBUG -p Vlv2TbltDevice= Pkg\PlatformPkgX64.dsc 7. update MinnowBoard with Build/Vlv2TbltDevicePkgX64\DEBUG_VS2015x86\FV= \VLV.fd Best regards, Kilian Kegel --_000_E92EE9817A31E24EB0585FDF735412F5B9DF1171ORSMSX113amrcor_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi= Kilian,

 

Th= anks for the contribution.  I have a couple quick comments.

 

  • Some files do not h= ave a file header at all.  Please update these with a proper file header
  • =
  • Some files have a B= SD 2-Clause license.  The preferred license for EDK II is BSD+P= atent and we prefer SPDX identifiers.  Will you be able to update to this license and header format?
  • The= re are binaries (.lib) files in this branch.  Source repos should not have binaries.  The preferred locations for binaries are GitHub release pages for binaries = build from a source tag or the edk2-non-osi repo.
  • Can you please summari= ze the differences between the copies of the EmulatorPkg and Vlv2TbltDevicePkg in your bra= nch and the versions of those packages in the edk2 and edk2-platforms repos= ?  Do you need help from those package maintainers to resolve the diffe= rences?

 

Th= anks,

 

Mi= ke

 

 

From: Kilian Kegel <kilian_kegel@outlook.com>
Sent: Wednesday, October 23, 2019 1:02 PM
To: devel@edk2.groups.io
Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Richardson= , Brian <brian.richardson@intel.com>
Subject: [staging/branch]: CdePkg - C Development Environment Packag= e

 

Hi UEFI community,<= /o:p>

 =

I’d like to introd= uce the CdePkg to edk2-staging.

 =

Some time ago I decided= to write my own ANSI C Library for UEFI Shell and POST.<= /p>

 

The UEFI Shell library = (“Torito C Library”) has been production-ready for more than on= e year.

The POST version of the= library (“CdeLib”) is not yet fully tested.<= /p>

 

I will be demonstrating= my verification procedure in the upcoming weeks on EDK2 STAGING  ht= tps://github.com/tianocore/edk2-staging/tree/CdePkg

 

Currently there are 3 examples implemented:

  1. <= span style=3D"mso-fareast-font-family:"Times New Roman";color:win= dowtext">argvc: https://github.com= /tianocore/edk2-staging/blob/CdePkg/CdeValidationPkg/HOSTED_ENV/argcv/main.= c#L57

argc/argv handling accor= ding to https://msdn.microsoft.com/en-us/library/a1y7w461.aspx

  1. <= span style=3D"mso-fareast-font-family:"Times New Roman";color:win= dowtext">systeminterfacePEI: https://github.com/tianocore/edk2-staging/blob/CdePkg/CdeValidationPkg/SYST= EM_IF/systeminterfacePEI/main.c#L57

demonstration, how = PeiServices and = FileHandle are passed into = main()

  1. <= span style=3D"mso-fareast-font-family:"Times New Roman";color:win= dowtext">systeminterfaceDXE: https://github.com/tianocore/edk2-staging/blob/CdePkg/CdeValidationPkg/SYST= EM_IF/systeminterfaceDXE/main.c#L57

demonstration, how SystemTable<= /span> and = ImageHandle are passed into = main()

 

Upcoming next demonstra= tion will be the = clock() function end of this week

 

The idea is to bring th= e ANSI C Library interface into POST drivers.

This will:

  1. ease portin= g tasks
  2. allow cross development
  3. allow developers t= o focus on their aims, because they aren’t forced to keep in mind a lot of addition= al info (e.g. RShiftU64)
  4. provide all intrisics to allow the compiler to be = a “C compiler”

(e.g. char bu= ffer[256] =3D { 1 };)=

 

What is CdePkg and Tori= to C Library?

  • CdePkg and = Torito C Library are a one man show / after work party, that is owned and written solely by= myself
  • CdePkg is a reference implementation only for Microsoft = C compiler
  • CdePkg is a feasibility study
  • <= li class=3D"xmsonormal" style=3D"color:black;mso-list:l0 level1 lfo3">CdePkg is th= e successor of Torito C, based on the same source code
  • CdePkg C = Development Environment is similar to  MdePkg Module Development Envir= onment

but guarantees  that the C compiler is always fully usable (all in= trinsics available) and the C90/C95 standard library is always available

 

What are the design goa= ls?

  • to rewr= ite the whole thing from scratch, without using any public source code from= GNU, BSD, Watcom
  • complet= eness: full blown C90 + C95 support, as lowest common denominator<= /o:p>
  • tailore= d for UEFI: small code size, for UEFI-POST-driver uses a C-Library-Driver, = that contains core/worker functions for realloc() =3D=3D  malloc() = and free(),

entire printf()-family, entire scanf()-family.

UEFI-POST-driver just uses small wrapper functions to run the C-Library= -Driver code.

  • stable, exa= ct, chipset independent TSC based clock() with CLOCKS_PER_SEC =3D=3D 1000
  • complete set of the Microsoft C-compiler intrinsic functions
  • ROM-abl= e! Runs with stack but w/o any static storage duration in .data segment, e.= g. for rand(), strtok(), tmpfile()

This is required= for early PEI before memory sizing, when PEI-images run directly out of fl= ash

  • Microso= ft (bug) compatible (as far as possible)
    1. use ori= ginal Microsoft header files for UEFI Shell Apps created in VS2019
    2. allow e= xpensive debugging tasks of ANSI C .EFI applications in Visual Studio in it= s Windows NT counter part
    3. to save= my lifetime writing a documentation https://github.com/tianocore/edk2-staging/tree/CdePkg/implemented.md#valida= tion-status
  • all the= above in one single C-Library CdeLib.lib

 =

CdePkg shall be adjusted to other compilers/tool chains t= oo, once it is feature-complete and accepted by the UEFI community.

As long as it is fo= r Microsoft VS2019 only.

 

CdePkg README.md is here:   http= s://github.com/tianocore/edk2-staging/tree/CdePkg#cdepkg

CdePkg HOWTO is here: https://github.com/tianocore/edk2-staging/blob/CdePkg/README.md#howt= o

CdeValidationPkg README.md is here: https://github.com/tianocore/edk2= -staging/blob/CdePkg/CdeValidationPkg/README.md

CdeValidationPkg HOWTO is here: https://github.com/tianocore/edk2-staging/blob/CdePkg/CdeValidationPkg/READ= ME.md

 

HOWTO:

  1. clone the edk2-staging repository
  2. checkout CdePkg
  3. run LAUNCH.BAT
  4. run build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -a IA32<= /span>
  5. run DBGEMU.BAT to start emulation (EmulatorPkg)
  6. run build -a IA32 -a X64 -n 5= -t VS2015x86 -b DEBUG -p Vlv2TbltDevicePkg\PlatformPkgX64.dsc
  7. update MinnowBoard with Build/Vlv2TbltDevicePkgX64\DEBUG_VS2= 015x86\FV\VLV.fd

 

Best regards,

Kilian Kegel

 

 

--_000_E92EE9817A31E24EB0585FDF735412F5B9DF1171ORSMSX113amrcor_--