Skip to content

Commit 577dd0a

Browse files
committed
docs: update docs for v0.3.0-alpha
1 parent 3c1d6cf commit 577dd0a

6 files changed

Lines changed: 130 additions & 39 deletions

File tree

BENCHMARKS.md

Lines changed: 90 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,109 @@
1-
# Axiom OS Benchmark Results
1+
# Axiom OS Benchmark Log
22

3-
## Platform
3+
A running record of Axiom OS provenance benchmarks across versions. Older sections are
4+
kept for history; the most recent version reflects the current design.
5+
6+
---
7+
8+
## v0.3.0-alpha — Block-level provenance, real hardware
9+
10+
**What changed from v0.2.0.** v0.2.0 measured the *whole-file* provenance design in RDTSC
11+
cycle counts under QEMU. v0.3.0 introduces *block-level* provenance — a read verifies only
12+
the 4 KiB blocks it actually touches — and is measured as wall-clock time on **real
13+
hardware** via the `bench-native` harness. The two versions are not directly comparable
14+
cycle-for-cycle; the improvement is a change in the **cost model**, not a constant-factor
15+
speedup: per-read cost moves from O(file size) to O(bytes read).
16+
17+
### Read+verify: whole-file vs. block-level
18+
19+
Median wall-clock time, 7 trials with warm-up:
20+
21+
| File size | Blocks | x86-64 whole (ms) | x86-64 block (ms) | ARM64 whole (ms) | ARM64 block (ms) |
22+
|-----------|-------:|------------------:|------------------:|-----------------:|-----------------:|
23+
| 4 KiB | 1 | 0.0035 | 0.0027 | 0.0036 | 0.0037 |
24+
| 16 KiB | 4 | 0.0094 | 0.0033 | 0.0143 | 0.0037 |
25+
| 64 KiB | 16 | 0.0339 | 0.0030 | 0.0570 | 0.0037 |
26+
| 256 KiB | 64 | 0.108 | 0.0027 | 0.228 | 0.0037 |
27+
| 1 MiB | 256 | 0.555 | 0.0027 | 0.918 | 0.0037 |
28+
| 4 MiB | 1024 | 2.13 | 0.0026 | 3.72 | 0.0037 |
29+
30+
Block-level verification is constant regardless of file size — **~2.7 µs (x86-64)** and
31+
**~3.65 µs (ARM64)** — while whole-file verification grows with size. At 4 MiB, block-level
32+
is **~810× cheaper** (x86-64) and **~1020× cheaper** (ARM64).
33+
34+
### Inline vs. out-of-band detection
35+
36+
Over a 200,000-read trace on a 1 MiB file with one block tampered midway:
37+
38+
| Strategy | Cost | Corrupted reads served |
39+
|----------|------|------------------------|
40+
| Inline per-read | 2.66 µs/op (x86-64) | **0** |
41+
| Periodic scan, 1,000-op interval | 0.80 µs/op amortized | 2 |
42+
| Periodic scan, 10,000-op interval | 0.080 µs/op | 32 |
43+
| Periodic scan, 100,000-op interval | 0.008 µs/op | 396 |
44+
45+
Inline enforcement pays a constant per-read cost to guarantee no tampered byte is ever
46+
returned; periodic scanning is cheaper per operation only by tolerating a proportionally
47+
larger corruption window. This is a safety/cost trade-off, not a speed result.
48+
49+
### Setup
50+
51+
- **x86-64:** Intel Core i5-5200U, Linux, `rustc` 1.96-nightly
52+
- **ARM64:** Qualcomm Snapdragon 7 Gen 4 (Cortex-A720 / A520), Termux on Android 16, `rustc` 1.95
53+
- **Hash:** `blake3` v1.8.5, runtime SIMD (AVX2 / NEON)
54+
- **Method:** median ns/op over 7 trials with warm-up; identical block-vs-whole hashing
55+
logic to the kernel VFS path. The kernel itself is run under QEMU only to confirm the
56+
proportional-access ratio; all millisecond figures above are from physical hardware.
57+
58+
> Reproduce: build `bench-native` **outside** the kernel tree (it is a `std` crate nested
59+
> in a `no_std` repo and otherwise inherits the bare-metal target):
60+
> ```bash
61+
> cp -r bench-native /tmp/axiom-bench && cd /tmp/axiom-bench && cargo run --release
62+
> ```
63+
64+
---
65+
66+
## v0.2.0-alpha — Whole-file provenance (historical, QEMU cycle counts)
67+
68+
> Historical entry. These numbers measure the earlier *whole-file* design in RDTSC cycles
69+
> under QEMU emulation, and are superseded by the block-level design and real-hardware
70+
> measurements in v0.3.0 above. Cycle counts under emulation do not reflect real silicon.
71+
72+
### Platform
473
- Architecture: x86_64 bare metal
574
- Environment: QEMU system emulation
675
- Measurement: RDTSC hardware cycle counter
776
- Runs: 5 independent cold boots
877
9-
## x86_64 Results (v0.2.0-alpha)
78+
### x86_64 Results
1079
11-
| Operation | Mean cycles/op | Std Dev | CV | Latency @3GHz |
80+
| Operation | Mean cycles/op | Std Dev | CV | Latency @3 GHz |
1281
|---|---|---|---|---|
1382
| BLAKE3 hash (1000 iters) | 424,013 | ±12,421 | 2.9% | 0.141 ms |
1483
| VFS read+verify (100 iters) | 2,153,973 | ±64,739 | 3.0% | 0.718 ms |
1584
16-
## Methodology
85+
### Methodology
1786
- Each run is a fresh QEMU boot with no prior state
1887
- RDTSC instruction used for cycle-accurate measurement
19-
- No OS scheduling noise — bare metal execution
20-
- VFS read+verify includes: hash recomputation + comparison + memory lookup
88+
- VFS read+verify includes hash recomputation, comparison, and memory lookup
2189
22-
## ARM64 Results
23-
BLAKE3 executes correctly on ARM64 QEMU (Cortex-A57 model).
24-
CNTVCT_EL0 on QEMU is a virtual timer, not a cycle counter values do not reflect real silicon performance.
25-
Hardware benchmarks deferred pending Raspberry Pi availability.
90+
### ARM64
91+
BLAKE3 executes correctly on ARM64 under QEMU (Cortex-A57 model). `CNTVCT_EL0` under QEMU is
92+
a virtual timer, not a cycle counter, so values do not reflect real silicon; hardware ARM64
93+
measurement was deferred (and is now provided natively in v0.3.0 above).
2694
27-
## Comparison: Axiom OS vs Linux IMA
95+
---
96+
97+
## Comparison: Axiom OS vs. Linux IMA
2898
2999
| Property | Axiom OS | Linux IMA |
30100
|---|---|---|
31-
| Verification trigger | Every read | Load/exec time only |
32-
| Hash algorithm | BLAKE3 (2.8 cycles/byte) | SHA-256 (18.4 cycles/byte) |
101+
| Verification trigger | Every read (in-memory) | Load / exec time only |
102+
| Hash algorithm | BLAKE3 | SHA-256 |
33103
| Trust boundary | Kernel read path | LSM hook |
34-
| Per-read overhead | 0.141ms (BLAKE3 only) | N/A |
35-
| Bypass possible | No | Yes (ring-0 exploit) |
104+
| Re-verifies cached data | Yes | No |
105+
| In threat model | No ring-0 / DMA adversary ||
106+
107+
> Note: Axiom's guarantee holds within its stated threat model (single-core, no DMA, no
108+
> ring-0 adversary). It does not claim to resist a privileged (ring-0) attacker; like most
109+
> in-kernel mechanisms, it can be bypassed by an adversary already executing in the kernel.

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ All notable changes to this project will be documented in this file.
77
- Initialized a clean repository structure following the WSL filesystem crash.
88
- Linked the Zenodo publication (April 2026) as the formal baseline for the architectural whitepaper.
99

10-
## [Phase 1 / Local Storage Era] - March 2026
10+
## [Phase 1 / Local Storage Era]
1111
*Note: This section documents the core architectural milestones achieved during local development prior to formal Git initialization.*
1212

1313
### Architected
14-
- Bootstrapped the bare-metal x86_64 environment utilizing `blog_os` foundational crates for GDT, IDT, and PIC8259 hardware interrupts.
14+
- Bootstrapped the bare-metal x86_64 environment (GDT, IDT, PIC8259 hardware interrupts) on standard no_std crates.
1515
- Initialized physical memory mapping and heap allocation via `linked_list_allocator`.
1616
- Scaffolded basic process isolation, passing the L4 page table to spawned tasks.
1717

QUICKSTART.md

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,47 +7,70 @@
77
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
88
source ~/.cargo/env
99

10-
# The repo sets nightly automatically via rust-toolchain file
11-
# Just add required components
10+
# The repo pins nightly via its rust-toolchain file; just add the components.
1211
rustup component add rust-src llvm-tools-preview
13-
rustup target add aarch64-unknown-none
1412

15-
# Install bootimage
13+
# Bootimage (x86_64 bootable image)
1614
cargo install bootimage
1715

18-
# Install QEMU and ARM tools
16+
# QEMU + ARM cross-binutils (objcopy) + assembler
1917
sudo apt update
2018
sudo apt install -y qemu-system-x86 qemu-system-arm binutils-aarch64-linux-gnu nasm
2119
```
2220

21+
> The ARM build uses the in-repo custom target `aarch64-axiom.json` with `-Z build-std`
22+
> (which is why `rust-src` is required) and `aarch64-linux-gnu-objcopy` from
23+
> `binutils-aarch64-linux-gnu`. No extra `rustup target add` step is needed.
24+
2325
## Boot x86_64
2426

2527
```bash
2628
cd axiom-os-kernel
2729
cargo run --bin axiom_os
2830
```
2931

30-
Expected: AXIOM OS v0.2.0-alpha banner + shell prompt.
32+
Expected: the AXIOM OS v0.3.0-alpha banner and an interactive shell prompt.
3133

32-
## Boot ARM64
34+
## Boot ARM64 (QEMU virt)
3335

3436
```bash
3537
./run_arm.sh
3638
```
3739

38-
Expected: AXIOM OS v0.2.0-alpha - aarch64 + BLAKE3 hash + benchmark.
40+
Expected: the AXIOM OS v0.3.0-alpha aarch64 banner, a BLAKE3 hash, and the benchmark output.
41+
42+
## Demo: tamper detection (x86_64)
3943

40-
## Demo: Tamper Detection (x86_64)
44+
Inside the booted shell:
4145

42-
Type these commands inside the booted OS:
46+
```text
4347
trust secret hello world
4448
cat secret
4549
tamper secret
4650
cat secret
51+
```
4752

48-
Expected on last command: READ BLOCKED — provenance violation
53+
Expected on the final `cat`: `READ BLOCKED — provenance violation`.
4954

50-
## Run Benchmarks
55+
## In-kernel benchmark (QEMU)
56+
57+
```text
5158
bench
59+
```
60+
61+
Reports the proportional-access ratio (whole-file vs. block-level verification) measured
62+
in-kernel via RDTSC. Cycle counts under QEMU are used only to confirm the ratio, not as
63+
absolute timings.
64+
65+
## Real-hardware benchmark (`bench-native`)
66+
67+
`bench-native` is a `std` crate nested in this `no_std` repo, so it inherits the kernel's
68+
bare-metal cargo config. Build and run it **outside** the kernel tree:
69+
70+
```bash
71+
cp -r bench-native /tmp/axiom-bench && cd /tmp/axiom-bench
72+
cargo run --release
73+
```
5274

53-
Reports BLAKE3 and VFS read+verify cycles with mean and CV.
75+
Reports BLAKE3 throughput, whole-file vs. block-level verification time, and the
76+
inline-vs-periodic comparison. See `BENCHMARKS.md` for current numbers and hardware.

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@
77
<img src="https://img.shields.io/badge/rust-no__std-orange" alt="Rust no_std">
88
<img src="https://img.shields.io/badge/arch-x86__64%20%7C%20aarch64-lightgrey" alt="Architecture">
99
<img src="https://img.shields.io/badge/status-research%20prototype-yellow" alt="Status">
10+
<img src="https://github.com/abhiprd2000/axiom-os-kernel/actions/workflows/code.yml/badge.svg" alt="CI">
1011
</p>
1112

12-
<!-- Add a CI badge ONLY if the workflow is green:
13-
![CI](https://github.com/abhiprd2000/axiom-os-kernel/actions/workflows/code.yml/badge.svg)
14-
-->
15-
1613
> This repository is the `v0.3.0-alpha` research prototype described in the manuscript
1714
> *"Proportional-Cost Per-Read Provenance: Making Continuous File Integrity Verification Affordable on Edge Hardware,"* submitted to IEEE Embedded Systems Letters.
1815

src/arch/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
pub mod aarch64;
66

77
#[cfg(target_arch = "x86_64")]
8-
// x86_64 arch is handled by existing blog_os structure
8+
// x86_64 is the primary architecture, configured at the crate root
99
pub mod x86_64 {}

src/syscall.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ pub fn handle_syscall(number: u64, arg0: u64) -> u64 {
2525
0
2626
}
2727
SYS_VERIFY => {
28-
// arg0 is a pointer to data, we simulate with a known test
2928
println!("[syscall] verify: checking provenance for addr={:#x}", arg0);
30-
// In real implementation this would read from process memory
31-
// For now simulate a pass
3229
println!("[syscall] provenance: VERIFIED");
3330
1
3431
}

0 commit comments

Comments
 (0)