Git Product home page Git Product logo

trustzone-m-rs's Introduction

PROJECT MOVED

This project has been moved to cpdt/trustzone-m-rs: https://gitee.com/cpdt/trustzone-m-rs .

trustzone-m-rs

ARM TrustZone-M example application in Rust, both secure world side and non-secure world side; projects are modified from generated result of cortex-m-quickstart.

This project is based on guide Writing secure applications using Rust and TrustZone-M, Version 1.0 by ARM, (c) 2022 Arm Limited.

Features

This project illustrates how to:

  • Write and run TrustZone-M application in Rust
  • Enter Non-Secure entry function in Secure World
  • Handle secure faults
  • Call secure function in Non-Secure World (using veneers.o)
  • Check permission in secure functions with pointers

Run

You need to install rustc target, using:

rustup target add thumbv8m.main-none-eabi

Additionally, you should check if your computer have arm-none-eabi-ld installed by arm-none-eabi-ld --version 2. This special ARM linker is used on veneer generation; veneer is an important media where non-secure applications get a list of supported functions provided by secure world side.

Clone repository and run:

git clone [email protected]:IoTS-P/trustzone-m-rs.git
cd trustzone-m-rs
cargo qemu

You'll get the following results:

    Finished dev [unoptimized + debuginfo] target(s) in 0.05s
     Running `target\debug\xtask.exe qemu`
xtask: make application and run in QEMU
    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
Hello from Secure World!
Hello from Non-Secure World!
secure function called!
secure function with pointers called!
Permission denied
secure function with pointers called!
Permission accepted
Return value: 0
Non-Secure World callback function called!
Program SUCCESS, exit Non-Secure World!

The program should finish without any error.

trustzone-m-rs's People

Contributors

luojia65 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.