Hi UEFI community,
I’d like to inform you about an update in the
CdePkg branch of edk2-staging.
https://github.com/tianocore/edk2-staging/tree/CdePkg#cdepkg
The goal of the CdePkg is to provide an
ANSI C Interface for UEFI POST drivers,
that enables BIOS engineers to (more) easily port standard C programs or libraries
(e.g. the openSSL library, already done) to POST drivers.
Furthermore the ANSI C Interface is
disseminated widely, also it’s bugs and pitfalls are known very well
by a broad range of IT professionals and may help to be better supportable by the open source initiative
compared to the proprietary interface that is available today in Tianocore UEFI.
Now the ANSI C function clock()
is introduced for PEI and DXE.
Currently there are 4 examples implemented:
argc/argv handling according to
https://msdn.microsoft.com/en-us/library/a1y7w461.aspx
demonstration, how
PeiServices and
FileHandle are passed into
main()
demonstration, how
SystemTable and
ImageHandle are passed into
main()
ANSI C LIBRARY functions:
for PEI and DXE phase. It provides TSC based, millisecond precise, exact and chipset independent
clock() function.
(NOTE: in emulation mode the TSC nominal frequency is supposed to be 1GHz)
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/clock?view=vs-2019
Best Regards,
Kilian
From: Kilian Kegel
Sent: Wednesday, October 23, 2019 10:03 PM
To: devel@edk2.groups.io
Cc: Kinney, Michael D;
Richardson, Brian
Subject: [edk2-devel] [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:
argc/argv handling according to https://msdn.microsoft.com/en-us/library/a1y7w461.aspx
demonstration, how
PeiServices and
FileHandle are passed into
main()
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:
(e.g.
char buffer[256] = { 1 };)
What is CdePkg and Torito C Library?
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?
entire
printf()-family,
entire
scanf()-family.
UEFI-POST-driver just uses small wrapper functions to run the C-Library-Driver code.
This is required for early PEI before memory sizing, when PEI-images run directly out of flash
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/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
CdeValidationPkg
HOWTO is here:
https://github.com/tianocore/edk2-staging/blob/CdePkg/CdeValidationPkg/README.md
HOWTO:
build -p EmulatorPkg\EmulatorPkg.dsc -t VS2015x86 -a IA32
run DBGEMU.BAT
to start emulation (EmulatorPkg)
run build -a IA32 -a X64 -n 5 -t VS2015x86 -b DEBUG -p Vlv2TbltDevicePkg\PlatformPkgX64.dsc
update MinnowBoard with Build/Vlv2TbltDevicePkgX64\DEBUG_VS2015x86\FV\VLV.fd
Best regards,
Kilian Kegel