OP-TEE (Open Portable Trusted Execution Environment) is a secure operating system that provides a Trusted Execution Environment (TEE) for ARM and RISC-V platforms. It runs in the secure world of a system-on-chip, isolated from the normal world (e.g., Linux). The OS includes a microkernel, cryptographic libraries (LibTomCrypt, Mbed TLS), hardware abstraction layers for crypto accelerators (CAAM, SE050, Hisilicon, etc.), device drivers (UART, GPIO, I2C, clocks, reset controllers, firewalls), and a framework for trusted applications (TAs) and pseudo TAs. It communicates with the normal world via SMC (Secure Monitor Call) or FF-A (Firmware Framework for Arm A-profile). The architecture is a monolithic kernel with modular driver registration using device tree and initcall macros. Key entry points include boot code (platform-specific main.c), SMC handlers (sm.c, thread_optee_smc.c), and system call handlers (arch_scall.c). Data flows involve secure storage (encrypted file system), cryptographic operations (symmetric/asymmetric ciphers, hashing, key derivation), and remote procedure calls (RPC) for I2C, RPMB, and other services. External dependencies include libfdt (device tree), qcbor (CBOR encoding), and softfloat (IEEE 754 floating-point emulation). The project supports a wide range of hardware platforms (NXP i.MX, STMicroelectronics STM32MP, Qualcomm, Xilinx Versal, Microchip SAMA5, etc.) and is actively maintained with frequent releases.
Asterinas is a production-grade, memory-safe operating system kernel written in Rust that aims to be Linux-compatible. It implements a framekernel architecture combining monolithic performance with microkernel-inspired separation, providing system call interfaces, device drivers, filesystems, networking, and process management. The project includes the OSDK (OS Development Kit) for building, running, and testing Rust kernels, and supports multiple architectures (x86-64, RISC-V, LoongArch) with varying tier levels. While it has strong research roots (evidenced by recent academic papers), its primary focus is on creating a usable OS that can run real-world applications via NixOS distribution.
TEESimulator is a system-level Android root tool that intercepts and replaces hardware-backed key attestation for selected apps. It injects native libraries into the keystore daemon (keystore2 on Android 12+, keystore on 10/11) via ptrace, hooks Binder transactions, and routes KeyMint requests to an in-process Rust TA that implements AOSP's kmr-ta with BoringSSL. A Kotlin daemon runs as root, manages profiles (keybox, mode, device identity, patch levels), harvests real device parameters, and provides a WebUI for configuration. The system supports two modes: patch (re-sign real attestation leaf) and generation (mint keys entirely in software). It is designed for Android 10-17, requires root, and is distributed as a Magisk/KernelSU/APatch module. The architecture is a multi-process, multi-language system: a Kotlin control daemon (app_process), native C++ interceptors (keymint, keystore), a Rust TA (teesim-km), and a JavaScript WebUI. Communication between daemon and interceptors uses a custom JSON-based protocol over Unix domain sockets. The daemon harvests real device attestation parameters, resolves per-app profiles, and pushes configuration to the interceptors. The interceptors use PLT hooks (AIBinder_transact, ioctl) to redirect KeyMint/Keystore calls for target apps to the local TA, while forwarding non-target calls to the real hardware. The codebase demonstrates high craftsmanship in its handling of Android internals, with careful version branching, RAII wrappers for ptrace, safe file I/O via base64 heredoc, and a schema-driven WebUI. However, it is heavily dependent on Android API internals and may require updates with each major Android release. The project is actively maintained with recent commits and responsive issue triage.