Introduction
EfiPy2 is python 3 library, is original designed for UEFI shell application. Static data strcuture in EfiPy2 are also suitable being used in OS environmrnt if user can read low layer data, for example PCIe configuration space and complex registers in CPU.
While import EfiPy2 in OS environment, the global data gBS, gST, gRT and gImage are set as fake value to them. That is only static data structure can be apply to Python application and EFI protocol are disabled.
In Windows/Linux system, user can import EfiPy2 without ModuleNotFoundError exception. Thus user Python application can import data structure in EfiPy2.MdePkg.Indusctry and EfiPy2.MdePkg.Register properly. With suitable modifying corepy package, it can also work on EDK2 and Linux system, too.
The conclusion for current stats...
EfiPy2 is full support in UEFI environment.
In Linux system, Python application can import EfiPy2 and corepy. And application can launch corepy code
% PYTHONPATH=$EfiPy2Path python3
In Windows system, Python application can import EfiPy2
X:\>set PYTHONPATH=%EfiPy2Path%
X:\>python
There are two samples for above condition
1. CpuIdBasic.py
This application leverage corepy excuting cpuid instruction to fetch CPUID data in both UEFI and Linux system.
2. MsrBasic.py
It can be launched in both Linux and UEFI
No comments:
Post a Comment