* [staging/branch]: CdePkg - C Development Environment Package
2019-09-17 13:11 ` [edk2-devel] " Igor Mammedov
@ 2019-09-17 14:38 ` Minnow Ware
0 siblings, 0 replies; 3+ messages in thread
From: Minnow Ware @ 2019-09-17 14:38 UTC (permalink / raw)
To: devel@edk2.groups.io; +Cc: michael.d.kinney@intel.com, Richardson, Brian
[-- Attachment #1: Type: text/plain, Size: 2611 bytes --]
Hi UEFI community,
I’d like to introduce the CdePkg to edk2-staging.
The package is not yet completed but ready to demonstrate it’s power, probably also for modernFW.
A couple of years ago, after an UEFI BIOS project on AMD platform I decided to write my own ANSI C Library for UEFI Shell and POST.
My design goals were:
1. to rewrite the whole thing from scratch, without using any public source code from GNU, BSD, Watcom or Intel EDK2 / tiano core
2. completeness: full blown C90 + C95 support, no C99, no non-specified extensions at all , e.g. itoa(), stricmp()...
3. small code size, for UEFI-POST-driver uses a C-Library-Driver, that contains core/worker functions for realloc() == malloc() and free(),
entire printf-family, entire scanf-family.
UEFI-POST-driver just uses small wrapper functions to run the C-Library-Driver code.
1. stable, exact, chipset independent (w/o ACPI timer) "clock()” with CLOCKS_PER_SEC == 1000
2. complete set of the Microsoft C-compiler intrinsic functions
3. ROM-able! 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 flash.
1. Microsoft bug compatible (as far as possible)
* to save my lifetime writing a documentation https://github.com/JoaquinConoBolillo/torito-C-Library/blob/master/implemented.md
* use original Microsoft header files for UEFI Shell Apps created in VS2017/19
* “debug”-mode for UEFI Shell executable in VS2017/19, that truly runs on Windows (that works
when using library functions only, no HW access, not UEFI-API use) to debug the library
itself – but this just links the same .OBJ module with the WinNT-EntryPoint instead of UEFI-EntryPoint
(The entry point module pulls in the appropriate OS-interface branch dispatcher)
1. all that in one single C-Library CdeLib.lib
The Readme.MD is here: https://github.com/MinnowWare/CdePkg#cdepkg
CdePkg shall be adjusted to other compilers/tool chains too, once it is feature complete and accepted by the UEFI community,
as long as it is for Microsoft VS2017/19 only.
The CdePkg is integrated into the “vUDK2018”-EDK2, which in turn runs in a MinnowBoard build.
It can be emulated in the Nt32Pkg, since EmulatorPkg in “vUDK2018” doesn’t support Windows…
I would like to move the “vUDK2018”-EDK2 to the edk2-staging branch CdePkg, but need to have access granted.
Can anyone kindly grant access rights to me?
Best Regards,
Kilian
[-- Attachment #2: Type: text/html, Size: 12701 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* [staging/branch]: CdePkg - C Development Environment Package
@ 2019-10-23 20:02 KILIAN_KEGEL
2019-10-23 22:06 ` Michael D Kinney
0 siblings, 1 reply; 3+ messages in thread
From: KILIAN_KEGEL @ 2019-10-23 20:02 UTC (permalink / raw)
To: devel@edk2.groups.io; +Cc: Kinney, Michael D, Richardson, Brian
[-- Attachment #1: Type: text/plain, Size: 4853 bytes --]
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 POST.
The UEFI Shell library (“Torito C Library”) has been production-ready for more 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/CdeValidationPkg/HOSTED_ENV/argcv/main.c#L57
argc/argv handling according to https://msdn.microsoft.com/en-us/library/a1y7w461.aspx
1. systeminterfacePEI: https://github.com/tianocore/edk2-staging/blob/CdePkg/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/CdePkg/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 to 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] = { 1 };)
What is CdePkg and Torito 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
* CdePkg is the successor of Torito C, based on the same source code
* CdePkg C Development Environment is similar to MdePkg Module Development 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 source code from GNU, BSD, Watcom
* completeness: full blown C90 + C95 support, as lowest common denominator
* tailored for UEFI: small code size, for UEFI-POST-driver uses a C-Library-Driver, that contains core/worker functions for realloc() == 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, exact, chipset independent TSC based clock() with CLOCKS_PER_SEC == 1000
* complete set of the Microsoft C-compiler intrinsic functions
* ROM-able! 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 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 Visual Studio in its Windows NT counter part
* to save my lifetime writing a documentation https://github.com/tianocore/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 feature-complete and accepted by the UEFI community.
As long as it is for Microsoft VS2019 only.
CdePkg README.md is here: <https://github.com/MinnowWare/CdePkg#cdepkg> https://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-staging/blob/CdePkg/CdeValidationPkg/README.md<https://github.com/tianocore/edk2-staging/blob/CdePkg/CdeValidationPkg/README.md#cdevalidationpkg>
CdeValidationPkg HOWTO is here: https://github.com/tianocore/edk2-staging/blob/CdePkg/CdeValidationPkg/README.md<https://github.com/tianocore/edk2-staging/blob/CdePkg/CdeValidationPkg/README.md#howto>
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 Vlv2TbltDevicePkg\PlatformPkgX64.dsc
7. update MinnowBoard with Build/Vlv2TbltDevicePkgX64\DEBUG_VS2015x86\FV\VLV.fd
Best regards,
Kilian Kegel
[-- Attachment #2: Type: text/html, Size: 24283 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [staging/branch]: CdePkg - C Development Environment Package
2019-10-23 20:02 [staging/branch]: CdePkg - C Development Environment Package KILIAN_KEGEL
@ 2019-10-23 22:06 ` Michael D Kinney
0 siblings, 0 replies; 3+ messages in thread
From: Michael D Kinney @ 2019-10-23 22:06 UTC (permalink / raw)
To: Kilian Kegel, devel@edk2.groups.io, Kinney, Michael D; +Cc: Richardson, Brian
[-- Attachment #1: Type: text/plain, Size: 6029 bytes --]
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 with a proper file header
* Some files have a BSD 2-Clause license. The preferred license for EDK II is BSD+Patent and we prefer SPDX identifiers. Will you be able to update 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 EmulatorPkg and Vlv2TbltDevicePkg in your branch and the versions of those packages in the edk2 and edk2-platforms repos? Do you need help from those package maintainers to resolve the differences?
Thanks,
Mike
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 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 POST.
The UEFI Shell library ("Torito C Library") has been production-ready for more 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/CdeValidationPkg/HOSTED_ENV/argcv/main.c#L57
argc/argv handling according to https://msdn.microsoft.com/en-us/library/a1y7w461.aspx
1. systeminterfacePEI: https://github.com/tianocore/edk2-staging/blob/CdePkg/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/CdePkg/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 to 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] = { 1 };)
What is CdePkg and Torito 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
* CdePkg is the successor of Torito C, based on the same source code
* CdePkg C Development Environment is similar to MdePkg Module Development 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 source code from GNU, BSD, Watcom
* completeness: full blown C90 + C95 support, as lowest common denominator
* tailored for UEFI: small code size, for UEFI-POST-driver uses a C-Library-Driver, that contains core/worker functions for realloc() == 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, exact, chipset independent TSC based clock() with CLOCKS_PER_SEC == 1000
* complete set of the Microsoft C-compiler intrinsic functions
* ROM-able! 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 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 Visual Studio in its Windows NT counter part
* to save my lifetime writing a documentation https://github.com/tianocore/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 feature-complete and accepted by the UEFI community.
As long as it is for Microsoft VS2019 only.
CdePkg README.md is here: <https://github.com/MinnowWare/CdePkg#cdepkg> https://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-staging/blob/CdePkg/CdeValidationPkg/README.md<https://github.com/tianocore/edk2-staging/blob/CdePkg/CdeValidationPkg/README.md#cdevalidationpkg>
CdeValidationPkg HOWTO is here: https://github.com/tianocore/edk2-staging/blob/CdePkg/CdeValidationPkg/README.md<https://github.com/tianocore/edk2-staging/blob/CdePkg/CdeValidationPkg/README.md#howto>
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 Vlv2TbltDevicePkg\PlatformPkgX64.dsc
7. update MinnowBoard with Build/Vlv2TbltDevicePkgX64\DEBUG_VS2015x86\FV\VLV.fd
Best regards,
Kilian Kegel
[-- Attachment #2: Type: text/html, Size: 70992 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-10-23 22:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-23 20:02 [staging/branch]: CdePkg - C Development Environment Package KILIAN_KEGEL
2019-10-23 22:06 ` Michael D Kinney
-- strict thread matches above, loose matches on Subject: below --
2019-09-05 13:08 [Qemu-devel] [edk2-rfc] [edk2-devel] CPU hotplug using SMM with QEMU+OVMF Laszlo Ersek
2019-09-05 15:49 ` [PATCH] q35: lpc: allow to lock down 128K RAM at default SMBASE address Igor Mammedov
2019-09-09 19:15 ` Laszlo Ersek
2019-09-10 15:58 ` Igor Mammedov
2019-09-11 17:30 ` Laszlo Ersek
2019-09-17 13:11 ` [edk2-devel] " Igor Mammedov
2019-09-17 14:38 ` [staging/branch]: CdePkg - C Development Environment Package Minnow Ware
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox