ME TEE Library is a C library to access CSE/CSME/GSC firmware via a mei interface. ME TEE provides a single cross-platform API to access to MEI devices on Linux and Windows. MEI TEE API simplify connection and communication with the mei device, and firmware status registers retrieval.
ME TEE library uses CMake for both Linux and Windows builds.
From the "Developer Command Prompt for VS 2019" with C compiler and CMake component installed:
cd <srcdir>
build
directory: mkdir build
cmake -G "Visual Studio 16 2019" -A <build_arch> <srcdir>
from the build
directory (best to set build_arch to Win32)cmake --build . --config Release --target package -j <nproc>
from the build
directory to build an archive with all executables and libraries, nproc is the number of parallel threads in compilation, best to set to number of processor threads availableBy default, CMake links with dynamic runtime (/MD), set BUILD_MSVC_RUNTIME_STATIC to ON to link with static runtime (/MT):
cmake -G "Visual Studio 16 2019" -A <build_arch> -DBUILD_MSVC_RUNTIME_STATIC=ON <srcdir>
build
directorycmake <srcdir>
from the build
directorymake -j$(nproc) package
from the build
directory to build .deb and .rpm packages and .tgz archiveME TEE library also supports Meson for both Linux and Windows builds.
meson setup build/
meson configure -Dbuildtype=debug/release build
ninja -v -C build/
In order to use Visual Studio project meson requires to run under Visual Studio Command Prompt. In case of Visual Studio 2019, you can use either "x64 Native Tools Command Prompt for VS 2019" or under powershell enter VisualStudio DevShell and then just continue with the general setup
$installPath = &"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -version 16.0 -property installationpath
Import-Module (Join-Path $installPath "Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
Enter-VsDevShell -VsInstallPath $installPath -SkipAutomaticLocation
The library supports multithreading but is not thread-safe. Every thread should either initialize and use its own handle or a locking mechanism should be implemented by the caller to ensure that only one thread uses the handle at any time. The only exception is ability to call Disconnect to exit from read blocked on another thread.