Giter Site home page Giter Site logo

tpm2-uefi's Introduction

Introduction

A guide for building UEFI application to interact with TPM 2.0.

Table of Contents

Prerequisites

  • A Ubuntu machine (Ubuntu 20.04.2 LTS) for cross-compilation
  • A 64-bit PC with TPM 2.0 and UEFI

Create USB Bootable with UEFI Shell (64-bit)

  1. Format your media as FAT32
  2. Create directory structure /efi/boot in your media
  3. Download the UEFI shell binary ([2]) and rename the it to Bootx64.efi
  4. Copy the binary to /efi/boot
  5. Insert the media to your PC and configure the UEFI to boot from it
  6. Eventually, you will see the UEFI shell

Build UEFI Applications

$ sudo apt install build-essential uuid-dev iasl git nasm python-is-python3

$ git clone -b edk2-stable202202 https://github.com/tianocore/edk2 ~/edk2
$ cd ~/edk2
$ git submodule update --init

# Compile build tools
$ cd ~/edk2
$ make -C BaseTools
$ . edksetup.sh BaseTools

# Setup build shell environment
$ cd ~/edk2
$ export EDK_TOOLS_PATH=~/edk2/BaseTools
$ . edksetup.sh BaseTools

Build Hello World:

$ cd ~/edk2
$ build -p MdeModulePkg/MdeModulePkg.dsc -t GCC5 -a X64 -n $(nproc)
$ ls Build/MdeModule/DEBUG_*/*/HelloWorld.efi

Copy the HelloWorld.efi to the media you created and execute it in the UEFI shell.

Build Custom UEFI Application

For demonstration purpose, reuse the HelloWorld example and apply this patch.

References

[1] https://github.com/tianocore/edk2/
[2] https://github.com/tianocore/edk2/blob/UDK2018/ShellBinPkg/UefiShell/X64/Shell.efi

License

This project is licensed under the MIT License - see the LICENSE file for details.

tpm2-uefi's People

Contributors

wxleong avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.