ArturR0k3r/AkiraOS
GitHub: ArturR0k3r/AkiraOS
一个基于 Zephyr 与 WebAssembly 沙盒的嵌入式安全平台,通过能力守卫与免烧录 OTA 解决受限设备安全隔离与快速迭代问题。
Stars: 34 | Forks: 5
# AkiraOS
**WebAssembly 运行时,适用于微控制器**
每个应用程序都是一个沙盒化的 `.wasm` 模块。通过空中部署。不需要固件烧录。
[](https://github.com/ArturR0k3r/AkiraOS/releases)
[](https://zephyrproject.org)
[](https://github.com/bytecodealliance/wasm-micro-runtime)
[](LICENSE)
[](https://certification.oshwa.org/md000003.html)
[](https://github.com/ArturR0k3r/AkiraOS/stargazers)
[**快速开始**](#quick-start) · [**架构**](#architecture) · [**AkiraSDK**](#wasm-app-development) · [**硬件**](#supported-hardware) · [**文档**](https://docs.akiraos.dev)
## 什么是 AkiraOS?
AkiraOS 是一个基于 Zephyr 的嵌入式操作系统,可在微控制器上运行**沙盒化的 WebAssembly 应用程序**。
核心思想是将操作系统与应用程序分离。固件保持稳定。应用程序是 `.wasm` 二进制文件——隔离、可移植,且无需触碰操作系统即可通过空中部署更新。
```
Your App (C/C++/Python) → compile → app.wasm → SecureDeploy → runs on device
OS unchanged
```
**这很重要:**
- 在不进行固件烧录周期的情况下更新应用程序
- 一个二进制文件可在 ESP32-S3、nRF5x 或 STM32 上运行——无需重新编译
- 应用程序崩溃?运行时在边界处捕获它。设备保持运行。
- 每个应用程序仅获得其明确请求的硬件访问权限
## 架构
```
┌─────────────────────────────────────────────────────┐
│ USER SPACE — WASM Apps │
│ [app1.wasm] [app2.wasm] [your_app.wasm] │
│ 50KB–200KB per app · max 8 installed · 2 running │
└──────────────────────┬──────────────────────────────┘
│ capability-checked calls
┌──────────────────────▼──────────────────────────────┐
│ AKIRAZ RUNTIME │
│ App Manager · Capability Guard · Native Bridge │
│ UI Framework (32 widgets) · Shell · 18 API modules │
│ WAMR: interpreter (1x) or AOT (10–50x perf) │
└──────────┬──────────────────────┬───────────────────┘
│ │
┌──────────▼──────────┐ ┌───────▼───────────────────┐
│ CONNECTIVITY │ │ ZEPHYR RTOS │
│ HTTP · OTA │ │ Scheduler · Network Stack │
│ BLE · AkiraMesh │ │ Drivers · LittleFS │
└─────────────────────┘ └────────────────────────────┘
```
**能力守卫** — 每个原生 API 调用都经过内联权限检查(约 60 纳秒开销)。应用程序在清单中声明所需的能力。没有能力 = 无法访问。就是这样。
```
{
"name": "my_sensor_app",
"capabilities": ["gpio.read", "display.write", "sensor.read"]
}
```
完整的架构文档 → [docs.akiraos.dev/architecture](https://docs.akiraos.dev/architecture)
## 快速开始
### 先决条件
- Linux 或 WSL2(Ubuntu 20.04+)
- Python 3.8+
- `west` — `pip install west`
### 1 — 克隆
```
mkdir akira-workspace && cd akira-workspace
git clone --recurse-submodules https://github.com/ArturR0k3r/AkiraOS.git
cd AkiraOS
west init -l . && cd .. && west update
```
### 2 — 安装 Zephyr SDK
```
cd ~
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.17.4/zephyr-sdk-0.17.4_linux-x86_64.tar.xz
tar xvf zephyr-sdk-0.17.4_linux-x86_64.tar.xz
cd zephyr-sdk-0.17.4 && ./setup.sh
```
### 3 — 构建并运行
```
cd akira-workspace/AkiraOS
# 在主机上运行 - 无需硬件
./build.sh
# 构建并刷写至 ESP32-S3
cd .. && west blobs fetch hal_espressif && cd AkiraOS
./build.sh -b esp32s3_devkitm_esp32s3_procpu -r a
west espmonitor
```
完整设置指南 → [QUICKSTART.md](QUICKSTART.md)
## WASM 应用程序开发
安装 [WASI SDK](https://github.com/WebAssembly/wasi-sdk/releases),然后:
```
# 构建您的第一个应用
cd AkiraSDK/wasm_apps/hello_world
../../build_wasm_app.sh -o hello_world.wasm main.c
# 通过 WiFi 部署到运行设备 - 无需重新刷写
curl -X POST -F "file=@hello_world.wasm" http://
**如果 AkiraOS 对您有用 — 一个 ⭐ 可以帮助他人找到它。**
[GitHub 上星标](https://github.com/ArturR0k3r/AkiraOS) · [关注更新](https://t.me/theguywithpen) · [文档](https://docs.akiraos.dev)
*Apache 2.0 · 版权 © 2026 PenEngineering S.R.L · [商业许可可用](COMMERCIAL.md)*