-
Notifications
You must be signed in to change notification settings - Fork 0
Software architecture document
thetaDEM edited this page Feb 17, 2026
·
5 revisions
Version: 0.1
Date: 2025-10-19
Authors: Daniil Smolin
- Daniil Smolin (DEMest) — docs, kernel implementation, project managment.
- Yuri Pivkin (alwenwhy) - kernel implementation, general decisions.
- Viktor Tumilevich (ViktorTum) - development on LicheePie 4A.
- Maxim Tokarev (Rakdat) - docs, development.
- Build the bootstrap pipeline up to stage1/stage2 via CLI:
make all,make clean. - Run on QEMU virt:
make qemu, UART0 output must confirm successful boot (e.g., “Stage1 OK”, “ENTER MAIN”). - Verify reproducibility of artifacts: SHA256 hashing and comparison of results from independent rebuilds (double compilation / “divorce bootstrap”).
- Keep hardware execution on Lichee Pi 4A as an explicit target (roadmap), influencing platform separation in build/deploy.
- Reproducibility: deterministic build, SHA256 verification.
- Portability (host): Linux x86_64 / WSL2.
- Portability (target): RISC‑V rv64.
- Performance: fast boot/run in QEMU (minimal overhead).
- Security/Trust: transparent trust chain, minimum opaque dependencies, logs/hashes for audit.
- Separate the pipeline into stages (stage0/stage1/stage2) with clear inputs/outputs.
- Fix entry point and document memory map.
- Provide one consistent flow: build → image → run → verify driven from Make/CLI.
- Prefer Make + C/ASM, minimal dependencies.
- Primary debugging platform: QEMU; real hardware testing later per schedule/roadmap.
The project is a trusted bootstrap pipeline for RISC‑V; therefore, “security” here is primarily about artifact integrity, reproducibility, and build environment control, rather than multi-user sessions.
- Source code (stage1/stage2, linker scripts, Makefile).
- Build artifacts (
stage*.elf,stage*.bin), memory map documents, build logs. - The trust chain: which exact inputs/tools produced a given binary artifact.
- Developer: builds and runs artifacts, changes sources. // (todo) - CI system: performs automated build + verify on commits (optional but recommended).
- Release maintainer: approves updates of “known-good” hashes or tagged releases.
- One unified configuration for all targets.
- Platform variable + platform-specific configs.
-
Build: Makefile +
riscv64-unknown-elf-gcc/ldproducestage*.elf. - Image: ELF → BIN conversion, fixed entry point (0x08048000), memory map extraction/documentation.
-
Run:
make qemuruns QEMU virt and exposes UART0 logs; hardware run path prepared via platform selection. - Verify: SHA256 hashing, compare artifacts across rebuilds (reproducibility check).
Minimal flow:
Sources → stage1.elf → stage1.bin → QEMU UART0 → SHA256/compare
- Emulator target: QEMU virt, UART0 115200 8N1 (console in terminal).
- Hardware target: Lichee Pi 4A (planned/roadmap; affects PLATFORM split).
- Memory map + entry point: fixed entry; memory layout documented.
- Hash verification: SHA256 for artifacts; “verify” scenario supports determinism checks.
-
Build configuration: environment variables such as
RISCVPREFIXandPLATFORMto keep builds reproducible across machines.
- Target ISA: RISC‑V rv64.
-
Toolchain:
riscv64-unknown-elf-gcc(+ binutils). -
Emulator:
qemu-system-riscv64(virt machine). - Host OS: Linux x86_64 / WSL2.