A demo for pure rust based td-shim.
It is derived from https://github.com/jyao1/edk2-staging/tree/TdShim/TdShimPkg.
tdx-tdcall impl two ways:
you can edit Cargo.toml -> features -> default to enable or disable. See
- tdx call
default = []
- tdx emulate
default = ["use_tdx_emulation"]
- Install RUST
please use nightly-2021-08-20.
1.1. Intall xbuild
cargo install cargo-xbuild
Please reinstall cargo-xbuild, after you update the rust toolchain.
- Install NASM
Please make sure nasm can be found in PATH.
- Install LLVM
Please make sure clang can be found in PATH.
Set env:
set CC=clang
set AR=llvm-ar
cargo xbuild -p rust-tdshim --target x86_64-unknown-uefi --release
pushd rust-td-payload
cargo xbuild --target x86_64-unknown-uefi --release
popd
cargo run -p rust-td-tool -- target/x86_64-unknown-uefi/release/ResetVector.bin target/x86_64-unknown-uefi/release/rust-tdshim.efi target/x86_64-unknown-uefi/release/rust-td-payload.efi target/x86_64-unknown-uefi/release/final.bin
pushd rust-td-payload
cargo xbuild --target target.json --release
popd
cargo run -p rust-td-tool -- target/x86_64-unknown-uefi/release/ResetVector.bin target/x86_64-unknown-uefi/release/rust-tdshim.efi target/target//release/rust-td-payload target/x86_64-unknown-uefi/release/final.bin
REF: https://github.com/tianocore/edk2-staging/tree/TDVF
./launch-rust-td.sh
- install pre-commit
- run
pre-commit install
- when you run
git commit
, pre-commit will do check-code things.
This package is only the sample code to show the concept. It does not have a full validation such as robustness functional test and fuzzing test. It does not meet the production quality yet. Any codes including the API definition, the libary and the drivers are subject to change.