From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (EUR01-HE1-obe.outbound.protection.outlook.com [40.92.65.22]) by mx.groups.io with SMTP id smtpd.web10.1997.1571860940585680957 for ; Wed, 23 Oct 2019 13:02:21 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@outlook.com header.s=selector1 header.b=VIIi0mJo; spf=pass (domain: outlook.com, ip: 40.92.65.22, mailfrom: kilian_kegel@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S3WPaEM5P2++jtsLSUaGJDaQBFbxJaNRABzzpu5iQ/PxVnKpzB5qozDIh8MNk9oIkINppZ4OgAtcjlxggfevxQLkpx2sGxUKUfMhP9wlvppdiIAt/ZRSdhUR1DILwTlRCT363Mtjnx2oT7s8WgKYeTi/qvs1zSxz4iOByX9ULqVqVVbLb3zDfAsOSYe0j8iUErep/EZ88kddbApjvEKYT0AG/G3E7Md8f8JTqX3W/5UzrXcUOUnODwpvLyARrBjjBF0iGoHOEXbCypJnhnZEarxuzbL5yZ6uKyERKVKmXL7QQ53gR1PcCVGL5UgSYK6niTBhL0ncy84YUZZ2F8aQ3Q== 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:X-MS-Exchange-SenderADCheck; bh=CukG5zbeNYIJjBOlw1z4xoKSQOYyhl8K0nibtco9Wkc=; b=bWIhSeJx2tDCy/0wasrAIkDzZXQXTQ0ebfu+VXEFBB5O4AxJUjnGXsP/gD0THmPICauj90xVSorQRsPTWGBhxNCzoYg4kZFc9W1sUoFY/D0+tqW6wi6oFxG1Mlnr01pzJOSJKQLHvIPOMvJbE9OdVJeqdA4IGdk6xhG7a0XDG1zidBDQLTF/EzJN9Tq43wZQkG68uXZCypgLVij9zngPOWpEKMrSxIMt0aavlRxLerGKnNr4OYsMbjNU51aFSo86/E4CBMCFAidYvhJxNmkmKAufGhpoLJb9s4pv7KmXXfTa8HpmMNMljeM7IljejkvaGCktyvyQawVvVTN0W9MQ3w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CukG5zbeNYIJjBOlw1z4xoKSQOYyhl8K0nibtco9Wkc=; b=VIIi0mJo7yt4Mrb+pzmmd5o/jHjLbHhbVgYujKUHAqrCoh5AAjNuA/J/4VVxPucufeY9GiR9ePAmScHlC/N89jXxltR3jnKXil8YeLbpBulgpJ+l6HPbM+03PzvA06mMuqqc42dDbRJ3/4u9wE0nZZDIpDfNI/QUl2Ma8qYnxTX4GjhuRIMXLQzJ2MvPtZTHlLQ/GGzp7889+oBo0oaZIOttC1Vos36h13/3CbcaflnL/cHSmz1GL4SzZNxz5wcL40Rskr61CjeU7nAs9DfY5uHSlXuLa+a4kNZlVVBLtyY3vpQGLV/F2A0UNWHAt63lybZ59Cvvc8Bc21oj+qbX+Q== Received: from DB5EUR01FT052.eop-EUR01.prod.protection.outlook.com (10.152.4.56) by DB5EUR01HT234.eop-EUR01.prod.protection.outlook.com (10.152.5.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.20; Wed, 23 Oct 2019 20:02:18 +0000 Received: from VI1PR0502MB3968.eurprd05.prod.outlook.com (10.152.4.60) by DB5EUR01FT052.mail.protection.outlook.com (10.152.5.248) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.20 via Frontend Transport; Wed, 23 Oct 2019 20:02:18 +0000 Received: from VI1PR0502MB3968.eurprd05.prod.outlook.com ([fe80::d1ae:fb86:1c1a:b74]) by VI1PR0502MB3968.eurprd05.prod.outlook.com ([fe80::d1ae:fb86:1c1a:b74%5]) with mapi id 15.20.2387.019; Wed, 23 Oct 2019 20:02:18 +0000 From: KILIAN_KEGEL@OUTLOOK.COM To: "devel@edk2.groups.io" CC: "Kinney, Michael D" , "Richardson, Brian" Subject: [staging/branch]: CdePkg - C Development Environment Package Thread-Topic: [staging/branch]: CdePkg - C Development Environment Package Thread-Index: AQHViYyegTYkDl4hFEuX1YcR9g4AEQ== Date: Wed, 23 Oct 2019 20:02:17 +0000 Message-ID: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:61CC7D68FBC47B9999AF72247E7C1BD9C53575BC5B298BCB6BEB99729C2801E2;UpperCasedChecksum:226E96AA79FA5957D95EE714A9BBF980582B9077552F46D3B43F9F1DB6B8FD33;SizeAsReceived:6782;Count:42 x-tmn: [FEMH7+qA8c4R6SafaNPaJxyCa3wJi+/n] x-ms-publictraffictype: Email x-incomingheadercount: 42 x-eopattributedmessage: 0 x-ms-traffictypediagnostic: DB5EUR01HT234: x-ms-exchange-purlcount: 11 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: r4ltumwxwqaHyUOBjjt0gFDm8361JuEPBaBxjkldz1DSZxptG510FrDFR7fGKZFn4rCr3lkmNO7LhcN/uAyL9zzDS//WOQA65xcqNuN7b1MCkguo1DBTUJKobD6erbFmL/BNkHVRzx8S/N/8ea6HrH3b28geke4YI9ypesYXOFDi9YtFpVdHlESL6opOmky9mJe2ePEyfnKZTCuGorfBckQCcJZ0IfB9I0cxZU5Q6fQ= x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 2698896d-6a8a-432a-377e-08d757f3e838 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Oct 2019 20:02:17.9573 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5EUR01HT234 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_VI1PR0502MB3968B7310367A43D8341D263EB6B0VI1PR0502MB3968_" --_000_VI1PR0502MB3968B7310367A43D8341D263EB6B0VI1PR0502MB3968_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hi UEFI community, I=92d 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 (=93Torito C Library=94) has been production-ready f= or more than one year. The POST version of the library (=93CdeLib=94) 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=92t forced= to keep in mind a lot of additional info (e.g. RShiftU64) 4. provide all intrisics to allow the compiler to be a =93C compiler=94 (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_VI1PR0502MB3968B7310367A43D8341D263EB6B0VI1PR0502MB3968_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable

Hi UEFI community,<= /o:p>

 =

I=92d like to introduce = 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 = (=93Torito C Library=94) has been production-ready for more than one year.<= o:p>

The POST version of the= library (=93CdeLib=94) is not yet fully tested.

 

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"color:windowtext">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"color:windowtext">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"color:windowtext">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= porting tasks
  2. allow cross development
  3. allow develop= ers to focus on their aims, because they aren=92t forced to keep in mind a lot= of additional info (e.g. RShiftU64)
  4. provide all intrisics to allow the compiler to be a =93C compiler=94

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

 

What is CdePkg and Tori= to C Library?

  • CdeP= kg 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
  • 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 rewrite the whole thing from scratch, without using any public source co= de from GNU, BSD, Watcom
  • completeness: full blown C90 + C95 support, as lowest common denominato= r
  • tailored for UEFI: small code size, for UEFI-POST-driver uses a C-Library-D= river, 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= -Driver code.

  • stab= le, exact, chipset independent TSC based clock() = with CLOCKS_PER_SEC =3D=3D 1000
  • complete set of the Mi= crosoft C-compiler intrinsic functions
  • ROM-able! Runs with stack but w/o any static storage duration in .data segm= ent, e.g. for rand(), strtok(), t= mpfile()

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

  • Microsoft (bug) compatible (as far as possible)
    1. use original Microsoft header files for UEFI Shell Apps created in VS2019 <= o:p>
    2. allow expensive debugging tasks of ANSI C .EFI applications in Visual Studi= o in its 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:   https://github.com/tianocor= e/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. clon= e 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_VI1PR0502MB3968B7310367A43D8341D263EB6B0VI1PR0502MB3968_--