Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
086e674
feat(toolchain): add clang x86_64-unknown-nonos config and cc-nonos w…
senseix21 Jun 28, 2026
4115224
feat(toolchain): add x86_64-unknown-nonos rustc target spec
senseix21 Jun 28, 2026
90152b7
feat(relibc): add nonos raw-syscall layer
senseix21 Jun 28, 2026
9fd11a5
feat(relibc): add nonos platform backend stub + apply.sh graft
senseix21 Jun 28, 2026
8c72f1f
fix(relibc): include CARGO_TEST= in nonos config.mk block
senseix21 Jun 28, 2026
5cc1d4e
feat(relibc): nonos Pal backend — scaffold + 5 real MK_* methods
senseix21 Jun 28, 2026
bef2f7d
feat(relibc): nonos Pal fs + mem ENOSYS stubs
senseix21 Jun 28, 2026
20d38bf
feat(relibc): nonos Pal time + ids + proc ENOSYS stubs
senseix21 Jun 28, 2026
65566a9
feat(relibc): nonos Pal sub-trait stubs (socket/signal/epoll/ptrace)
senseix21 Jun 28, 2026
c99297a
fix(relibc): wrap nonos syscall asm in unsafe blocks
senseix21 Jun 28, 2026
199805f
feat(relibc): graft nonos sub-traits, Sync errno, json-target CARGOFLAGS
senseix21 Jun 28, 2026
8ec655d
feat(relibc): disable libc layout-check + wire objcopy for nonos
senseix21 Jun 28, 2026
9453ada
feat(relibc): reuse linux ABI defs for nonos headers
senseix21 Jun 28, 2026
211886e
feat(relibc): nonos arms for ioctl, TCB, and ld_so init
senseix21 Jun 28, 2026
8b9c614
fix(relibc): drop no_trace from nonos CARGOFLAGS
senseix21 Jun 28, 2026
1ac2497
feat(relibc): nonos crt0 synthesizes SysV initial stack
senseix21 Jun 28, 2026
e381488
feat(toolchain): assemble nonos C sysroot from relibc output
senseix21 Jun 28, 2026
84b379c
fix(toolchain): fix cc-nonos cfg for static-PIE ELF capsule build
senseix21 Jun 28, 2026
b5af81f
feat(capsule): add capsule_c_proof C capsule source and build wiring
senseix21 Jun 28, 2026
b295116
feat(capsule_c_proof): add kernel-side mirror, Cargo feature+profile,…
senseix21 Jun 29, 2026
28d2ee4
feat(test): add nonos-mk-cproof prod/boot/test targets
senseix21 Jun 29, 2026
aaae189
feat(relibc): TLS-less nonos startup + minimal crt0 for the C capsule
senseix21 Jun 29, 2026
1d78e5e
feat(capsule): c_proof Debug cap + unverified smoke spawn path
senseix21 Jun 29, 2026
6d9a6e1
feat(test): c_proof unverified smoketest profile + gate
senseix21 Jun 29, 2026
b412d81
feat(relibc): full nonos startup — no-op pthread::init, restore relib…
senseix21 Jun 29, 2026
07545ee
feat(capsule): add capsule_relibc_test userland source and Capsule.mk
senseix21 Jun 29, 2026
38ebecd
feat(kernel): add capsule_relibc_test kernel mirror and init wiring
senseix21 Jun 29, 2026
b3ed63e
feat(build): add nonos-capsule-relibc-test feature and smoke profile
senseix21 Jun 29, 2026
78f754e
feat(relibc): nonos time via MkTimeMillis
senseix21 Jun 29, 2026
d2a9701
feat(relibc): nonos getrandom + mem advisory no-ops
senseix21 Jun 29, 2026
39f3aeb
fix(relibc): declare rdi/rsi/rdx clobbered in nonos syscall wrappers
senseix21 Jun 29, 2026
6686f29
feat(relibc): map target_os=nonos to __nonos__ for cbindgen headers
senseix21 Jun 29, 2026
b2dc6b4
feat(relibc): add MK_IPC_CALL tag to lowlevel.rs
senseix21 Jun 29, 2026
179d0e9
feat(relibc): nonos vfs ipc_call helper + fd table
senseix21 Jun 29, 2026
bcc4bc9
feat(relibc): nonos write/close/read/dup2 via vfs IPC
senseix21 Jun 29, 2026
a408401
feat(relibc): nonos openat/fstatat/faccessat/mkdirat via vfs IPC
senseix21 Jun 29, 2026
4b6cce2
feat(relibc): nonos unlinkat/renameat2 via vfs IPC
senseix21 Jun 29, 2026
1ec8d77
fix(relibc): dup2 closes displaced vfs fd; tighten vfs response guards
senseix21 Jun 29, 2026
0795d8d
fix(relibc): futex no-op for single-threaded nonos
senseix21 Jun 29, 2026
3cf3a28
test(relibc): exercise fs (fopen/fwrite/fread) in the relibc-test gate
senseix21 Jun 29, 2026
9ff5b84
feat(relibc): nonos thread spawn via MkThreadSpawn
senseix21 Jun 29, 2026
4e3ab39
feat(relibc): nonos sched_yield/exit_thread/current_os_tid
senseix21 Jun 29, 2026
610afed
feat(vfs): OP_SEEK random-access offset over NOVF
senseix21 Jun 29, 2026
0775165
feat(vfs): pread/pwrite positional IO over NOVF
senseix21 Jun 29, 2026
5d785bb
feat(relibc): nonos lseek/pread/pwrite over vfs IPC
senseix21 Jun 29, 2026
9ef4f34
test(relibc): exercise lseek/pread/pwrite in the relibc-test gate
senseix21 Jun 29, 2026
5bde9bb
fix(relibc): nonos vfs client surfaces server errno before EIO guard
senseix21 Jun 29, 2026
8de07f7
feat(net-sockets): O_NONBLOCK flag ops (SETFLAGS/GETFLAGS)
senseix21 Jun 29, 2026
60bc293
feat(net-sockets): surface rx-empty as E_WOULD_BLOCK for non-blocking…
senseix21 Jun 29, 2026
633ab60
feat(net-sockets): OP_SETTIMEOUT + server-side timed recv (SO_RCVTIMEO)
senseix21 Jun 29, 2026
8f08d0b
feat(net-sockets): per-handle rx stash drained by recv
senseix21 Jun 29, 2026
0735ca3
feat(net-sockets): OP_POLL readiness via rx-stash probe + TCP state
senseix21 Jun 29, 2026
fa55c84
feat(relibc): nonos socket runtime + socket()/close over NSKT
senseix21 Jun 29, 2026
6d21a57
feat(relibc): nonos connect() over NSKT (EINPROGRESS for non-blocking)
senseix21 Jun 29, 2026
ed4a8a5
feat(relibc): nonos socket send/recv + read/write dispatch over NSKT
senseix21 Jun 29, 2026
747fd29
feat(relibc): nonos fcntl O_NONBLOCK for sockets over NSKT
senseix21 Jun 29, 2026
44adce5
feat(relibc): nonos epoll registry + epoll_create1/epoll_ctl
senseix21 Jun 29, 2026
2d104c1
feat(relibc): nonos epoll_pwait over net.sockets OP_POLL
senseix21 Jun 30, 2026
1e6cadb
feat(cnet): capsule_c_net exerciser + microkernel-cnet profile wiring
senseix21 Jun 30, 2026
6ed470e
feat(cnet): connect-retry + nonos-mk-cnet-smoke-test gate
senseix21 Jun 30, 2026
7b0a2a6
fix(net-sockets): free rx-stash on socket close
senseix21 Jun 30, 2026
eddc421
fix(relibc): epoll_pwait rejects non-positive maxevents
senseix21 Jun 30, 2026
4f676d0
feat(netsurf): add nsfb_probe C syscall + surface ABI layer
senseix21 Jun 30, 2026
7f13b26
feat(netsurf): add nsfb_probe compositor NCMP framing
senseix21 Jun 30, 2026
cba0101
feat(netsurf): add nsfb_probe lifecycle + build manifest
senseix21 Jun 30, 2026
df2c3d8
feat(netsurf): add capsule_nsfb_probe kernel mirror scaffold
senseix21 Jun 30, 2026
6609dbe
feat(netsurf): add nsfb_probe unverified smoke spawn path
senseix21 Jun 30, 2026
1892851
feat(netsurf): spawn nsfb_probe after the driver fleet
senseix21 Jun 30, 2026
be57e60
feat(netsurf): add nsfb-probe capsule flag and boot profiles
senseix21 Jun 30, 2026
b269bf6
feat(netsurf): retry compositor acquisition in nsfb_probe
senseix21 Jun 30, 2026
5d109ec
feat(netsurf): wire nsfbprobe smoke make targets
senseix21 Jun 30, 2026
75ef006
feat(netsurf): hardening — static asserts on surface_descriptor ABI l…
senseix21 Jun 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,6 @@ CONTEXT.md
.continue/
.superpowers/


# nonos C sysroot (build artifact of toolchain/nonos-c/build-sysroot.sh)
toolchain/nonos-c/sysroot/
75 changes: 75 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ sched = []
# below maps 1:1 to a capsule directory under `userland/`.
nonos-capsule-proof-io = []
nonos-capsule-std-proof = []
nonos-capsule-c-proof = []
nonos-capsule-relibc-test = []
nonos-capsule-c-net = []
nonos-capsule-nsfb-probe = []
nonos-capsule-ripgrep = []
nonos-capsule-ramfs = []
nonos-capsule-wallpaper = []
Expand Down Expand Up @@ -212,6 +216,77 @@ microkernel-ramfs = [
"nonos-capsule-ramfs",
]

microkernel-c-proof = [
"microkernel-core",
"nonos-production",
"nonos-capsule-proof-io",
"nonos-capsule-c-proof",
]

# Temporary unverified boot proof of the clang/relibc C capsule: spawns
# c_proof via the legacy unverified path (no ZK attestation) while the
# capsule-attestation NZKCAPS2 migration is owned elsewhere. Superseded by
# microkernel-c-proof once a valid c_proof trailer is available.
microkernel-c-proof-smoketest = [
"microkernel-core",
"nonos-dev-unverified-capsules",
"nonos-capsule-c-proof",
]

# Phase-4 framebuffer probe (verified path). Brings up the compositor
# and the virtio-gpu driver so a real framebuffer exists, then spawns
# nsfb_probe which registers a surface, reads OP_DISPLAY_INFO, paints a
# gradient, and presents it.
microkernel-nsfb-probe = [
"microkernel-core",
"nonos-production",
"nonos-capsule-proof-io",
"nonos-capsule-compositor",
"nonos-capsule-driver-virtio-gpu",
"nonos-capsule-nsfb-probe",
]

# Unverified smoke build of the framebuffer probe: spawns nsfb_probe via
# the legacy path while the NZKCAPS2 migration is owned elsewhere. The
# compositor + virtio-gpu carry real ZK trailers that the always-on
# transparent verifier would reject, so `nonos-zk-rollout` keeps a stale
# trailer non-fatal — the same reason the cnet/relibc smoketests set it.
microkernel-nsfb-probe-smoketest = [
"microkernel-core",
"nonos-dev-unverified-capsules",
"nonos-zk-rollout",
"nonos-capsule-compositor",
"nonos-capsule-driver-virtio-gpu",
"nonos-capsule-nsfb-probe",
]

microkernel-relibc-test-smoketest = [
"microkernel-core",
"nonos-dev-unverified-capsules",
"nonos-zk-rollout",
"nonos-capsule-proof-io",
"nonos-capsule-ramfs",
"nonos-capsule-vfs",
"nonos-capsule-relibc-test",
]

microkernel-cnet-smoketest = [
"microkernel-core",
"nonos-dev-unverified-capsules",
"nonos-zk-rollout",
"nonos-capsule-proof-io",
"nonos-capsule-driver-virtio-net",
"nonos-capsule-net-l2",
"nonos-capsule-net-ip",
"nonos-capsule-net-udp",
"nonos-capsule-net-dhcp",
"nonos-capsule-net-tcp",
"nonos-capsule-net-dns",
"nonos-capsule-net-sockets",
"nonos-capsule-net-nym",
"nonos-capsule-c-net",
]

microkernel-keyring = [
"microkernel-core",
"nonos-production",
Expand Down
70 changes: 70 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,10 @@ nonos-mk-trust-policy: $(NONOS_TRUST_ANCHOR_POLICY_BIN)
# nonos-mk-check-<slug>-keys assert publisher seeds + pubs exist
include userland/capsule_proof_io/Capsule.mk
include userland/capsule_std_proof/Capsule.mk
include userland/capsule_c_proof/Capsule.mk
include userland/capsule_relibc_test/Capsule.mk
include userland/capsule_c_net/Capsule.mk
include userland/capsule_nsfb_probe/Capsule.mk
include userland/capsule_ripgrep/Capsule.mk
include userland/capsule_ramfs/Capsule.mk
include userland/capsule_keyring/Capsule.mk
Expand Down Expand Up @@ -809,6 +813,72 @@ nonos-mk-std-proof-prod: $(proof-io_ARTIFACTS) $(std-proof_ARTIFACTS) nonos-mk-c
$(CARGO) build $(KERNEL_BUILD_FLAGS) \
--no-default-features --features microkernel-proof-io,nonos-capsule-std-proof

.PHONY: nonos-mk-cproof-prod nonos-mk-boot-cproof nonos-mk-cproof-test
nonos-mk-cproof-prod: $(proof-io_ARTIFACTS) $(c-proof_ARTIFACTS) \
nonos-mk-check-deps nonos-mk-ensure-signing-key
@echo "Building kernel (microkernel-c-proof)..."
@$(SDK_FLAGS) NONOS_SIGNING_KEY=$(KERNEL_SIGNING_KEY) \
RUSTUP_TOOLCHAIN=$(TOOLCHAIN) \
$(CARGO) build $(KERNEL_BUILD_FLAGS) \
--no-default-features --features microkernel-c-proof

nonos-mk-boot-cproof:
@./tests/boot/cproof.sh

nonos-mk-cproof-test: nonos-mk-boot-cproof

.PHONY: nonos-mk-cproof-smoke-prod nonos-mk-cproof-smoke-test
nonos-mk-cproof-smoke-prod: $(c-proof_ARTIFACTS) \
nonos-mk-check-deps nonos-mk-ensure-signing-key
@echo "Building kernel (microkernel-c-proof-smoketest, unverified)..."
@$(SDK_FLAGS) NONOS_SIGNING_KEY=$(KERNEL_SIGNING_KEY) \
RUSTUP_TOOLCHAIN=$(TOOLCHAIN) \
$(CARGO) build $(KERNEL_BUILD_FLAGS) \
--no-default-features --features microkernel-c-proof-smoketest

nonos-mk-cproof-smoke-test:
@CPROOF_PROD_TARGET=nonos-mk-cproof-smoke-prod ./tests/boot/cproof.sh

.PHONY: nonos-mk-relibc-smoke-prod nonos-mk-relibc-smoke-test
nonos-mk-relibc-smoke-prod: $(relibc-test_ARTIFACTS) \
nonos-mk-check-deps nonos-mk-ensure-signing-key
@echo "Building kernel (microkernel-relibc-test-smoketest, unverified)..."
@$(SDK_FLAGS) NONOS_SIGNING_KEY=$(KERNEL_SIGNING_KEY) \
RUSTUP_TOOLCHAIN=$(TOOLCHAIN) \
$(CARGO) build $(KERNEL_BUILD_FLAGS) \
--no-default-features --features microkernel-relibc-test-smoketest

nonos-mk-relibc-smoke-test:
@CPROOF_PROD_TARGET=nonos-mk-relibc-smoke-prod ./tests/boot/relibc.sh

.PHONY: nonos-mk-cnet-smoke-prod nonos-mk-cnet-smoke-test
nonos-mk-cnet-smoke-prod: $(proof-io_ARTIFACTS) $(driver-virtio-net_ARTIFACTS) \
$(net-l2_ARTIFACTS) $(net-ip_ARTIFACTS) $(net-udp_ARTIFACTS) \
$(net-dhcp_ARTIFACTS) $(net-tcp_ARTIFACTS) $(net-dns_ARTIFACTS) \
$(net-sockets_ARTIFACTS) $(net-nym_ARTIFACTS) $(c-net_ARTIFACTS) \
nonos-mk-check-deps nonos-mk-ensure-signing-key
@echo "Building kernel (microkernel-cnet-smoketest, unverified)..."
@$(SDK_FLAGS) NONOS_SIGNING_KEY=$(KERNEL_SIGNING_KEY) \
RUSTUP_TOOLCHAIN=$(TOOLCHAIN) \
$(CARGO) build $(KERNEL_BUILD_FLAGS) \
--no-default-features --features microkernel-cnet-smoketest

nonos-mk-cnet-smoke-test:
@CNET_PROD_TARGET=nonos-mk-cnet-smoke-prod ./tests/boot/cnet.sh

.PHONY: nonos-mk-nsfbprobe-smoke-prod nonos-mk-nsfbprobe-smoke-test
nonos-mk-nsfbprobe-smoke-prod: $(compositor_ARTIFACTS) \
$(driver-virtio-gpu_ARTIFACTS) $(nsfb-probe_ARTIFACTS) \
nonos-mk-check-deps nonos-mk-ensure-signing-key
@echo "Building kernel (microkernel-nsfb-probe-smoketest, unverified)..."
@$(SDK_FLAGS) NONOS_SIGNING_KEY=$(KERNEL_SIGNING_KEY) \
RUSTUP_TOOLCHAIN=$(TOOLCHAIN) \
$(CARGO) build $(KERNEL_BUILD_FLAGS) \
--no-default-features --features microkernel-nsfb-probe-smoketest

nonos-mk-nsfbprobe-smoke-test:
@NSFBPROBE_PROD_TARGET=nonos-mk-nsfbprobe-smoke-prod ./tests/boot/nsfbprobe.sh

nonos-mk-ramfs-prod: $(proof-io_ARTIFACTS) $(ramfs_ARTIFACTS) \
nonos-mk-check-deps nonos-mk-ensure-signing-key
@echo "Building kernel (microkernel-ramfs)..."
Expand Down
2 changes: 1 addition & 1 deletion nonos-mk
44 changes: 44 additions & 0 deletions src/userspace/capsule_c_net/embed.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// NONOS Operating System
// Copyright (C) 2026 NONOS Contributors
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#[cfg(feature = "nonos-capsule-c-net")]
pub(crate) const C_NET_ELF: &[u8] = include_bytes!(
"../../../userland/capsule_c_net/target/x86_64-nonos-user/release/c_net"
);

#[cfg(feature = "nonos-capsule-c-net")]
pub(crate) const C_NET_NONOS_ID_CERT_BYTES: &[u8] =
include_bytes!("../../../nonos-data/trust/capsules/c_net.nonos_id_cert.bin");

#[cfg(feature = "nonos-capsule-c-net")]
pub(crate) const C_NET_MANIFEST_BYTES: &[u8] =
include_bytes!("../../../nonos-data/trust/capsules/c_net.manifest.bin");

#[cfg(feature = "nonos-capsule-c-net")]
pub(crate) const C_NET_ATTESTATION_BYTES: &[u8] =
include_bytes!("../../../nonos-data/trust/capsules/c_net.zk_trailer.bin");

#[cfg(not(feature = "nonos-capsule-c-net"))]
pub(crate) const C_NET_ELF: &[u8] = &[];

#[cfg(not(feature = "nonos-capsule-c-net"))]
pub(crate) const C_NET_NONOS_ID_CERT_BYTES: &[u8] = &[];

#[cfg(not(feature = "nonos-capsule-c-net"))]
pub(crate) const C_NET_MANIFEST_BYTES: &[u8] = &[];

#[cfg(not(feature = "nonos-capsule-c-net"))]
pub(crate) const C_NET_ATTESTATION_BYTES: &[u8] = &[];
20 changes: 20 additions & 0 deletions src/userspace/capsule_c_net/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// NONOS Operating System
// Copyright (C) 2026 NONOS Contributors
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

mod embed;
mod spawn;

pub use spawn::spawn_c_net_capsule;
84 changes: 84 additions & 0 deletions src/userspace/capsule_c_net/spawn.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
// NONOS Operating System
// Copyright (C) 2026 NONOS Contributors
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

use super::embed::C_NET_ELF;
#[cfg(not(feature = "nonos-dev-unverified-capsules"))]
use super::embed::{
C_NET_ATTESTATION_BYTES, C_NET_MANIFEST_BYTES, C_NET_NONOS_ID_CERT_BYTES,
};
use crate::capabilities::Capability;
use crate::kernel_core::process_spawn::capsule_spawn::{self, SpawnError};
#[cfg(not(feature = "nonos-dev-unverified-capsules"))]
use crate::kernel_core::process_spawn::capsule_spawn::CapsuleSpecVerified;
#[cfg(feature = "nonos-dev-unverified-capsules")]
use crate::kernel_core::process_spawn::capsule_spawn::CapsuleSpec;
#[cfg(not(feature = "nonos-dev-unverified-capsules"))]
use crate::security::nonos_id_cert::IdCertVerifyError;
#[cfg(not(feature = "nonos-dev-unverified-capsules"))]
use crate::security::nonos_trust_anchor::{
decode as decode_trust_anchor, BAKED_TRUST_ANCHOR_POLICY,
};

const SERVICE_NAME: &str = "c_net";
const SERVICE_PORT: u32 = 4508;
const REPLY_INBOX: &str = "endpoint.c_net.reply";
const REPLY_PORT: u32 = 4509;
#[cfg(not(feature = "nonos-dev-unverified-capsules"))]
const TARGET_TRIPLE: &str = "x86_64-nonos-user";

fn requested_caps() -> u64 {
Capability::CoreExec.bit()
| Capability::IPC.bit()
| Capability::Memory.bit()
| Capability::Debug.bit()
}

#[cfg(not(feature = "nonos-dev-unverified-capsules"))]
pub fn spawn_c_net_capsule() -> Result<(), SpawnError> {
let trust_anchor = decode_trust_anchor(BAKED_TRUST_ANCHOR_POLICY)
.map_err(|_| SpawnError::NonosIdCertRejected(IdCertVerifyError::TrustAnchorPolicy))?;

let spec = CapsuleSpecVerified {
name: SERVICE_NAME,
service_port: SERVICE_PORT,
reply_inbox: REPLY_INBOX,
reply_port: REPLY_PORT,
elf: C_NET_ELF,
nonos_id_cert_bytes: C_NET_NONOS_ID_CERT_BYTES,
manifest_bytes: C_NET_MANIFEST_BYTES,
attestation_trailer: C_NET_ATTESTATION_BYTES,
target_triple: TARGET_TRIPLE,
requested_caps: requested_caps(),
debug_tag: b"",
};
capsule_spawn::spawn_verified(&spec, &trust_anchor, None)?;
Ok(())
}

#[cfg(feature = "nonos-dev-unverified-capsules")]
pub fn spawn_c_net_capsule() -> Result<(), SpawnError> {
let spec = CapsuleSpec {
name: SERVICE_NAME,
service_port: SERVICE_PORT,
reply_inbox: REPLY_INBOX,
reply_port: REPLY_PORT,
elf: C_NET_ELF,
caps_bits: requested_caps(),
debug_tag: b"",
};
capsule_spawn::spawn(&spec)?;
Ok(())
}
44 changes: 44 additions & 0 deletions src/userspace/capsule_c_proof/embed.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// NONOS Operating System
// Copyright (C) 2026 NONOS Contributors
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#[cfg(feature = "nonos-capsule-c-proof")]
pub(crate) const C_PROOF_ELF: &[u8] = include_bytes!(
"../../../userland/capsule_c_proof/target/x86_64-nonos-user/release/c_proof"
);

#[cfg(feature = "nonos-capsule-c-proof")]
pub(crate) const C_PROOF_NONOS_ID_CERT_BYTES: &[u8] =
include_bytes!("../../../nonos-data/trust/capsules/c_proof.nonos_id_cert.bin");

#[cfg(feature = "nonos-capsule-c-proof")]
pub(crate) const C_PROOF_MANIFEST_BYTES: &[u8] =
include_bytes!("../../../nonos-data/trust/capsules/c_proof.manifest.bin");

#[cfg(feature = "nonos-capsule-c-proof")]
pub(crate) const C_PROOF_ATTESTATION_BYTES: &[u8] =
include_bytes!("../../../nonos-data/trust/capsules/c_proof.zk_trailer.bin");

#[cfg(not(feature = "nonos-capsule-c-proof"))]
pub(crate) const C_PROOF_ELF: &[u8] = &[];

#[cfg(not(feature = "nonos-capsule-c-proof"))]
pub(crate) const C_PROOF_NONOS_ID_CERT_BYTES: &[u8] = &[];

#[cfg(not(feature = "nonos-capsule-c-proof"))]
pub(crate) const C_PROOF_MANIFEST_BYTES: &[u8] = &[];

#[cfg(not(feature = "nonos-capsule-c-proof"))]
pub(crate) const C_PROOF_ATTESTATION_BYTES: &[u8] = &[];
20 changes: 20 additions & 0 deletions src/userspace/capsule_c_proof/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// NONOS Operating System
// Copyright (C) 2026 NONOS Contributors
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

mod embed;
mod spawn;

pub use spawn::spawn_c_proof_capsule;
Loading