feat(netsurf): NetSurf-on-NONOS foundation — toolchain, relibc Pal, capsule ops, display de-risk gate #27
Open
nonos-sync
wants to merge 72 commits from
nonos-sync/gh-259 into main
AGit
pull from: nonos-sync/gh-259
merge into: NON-OS:main
NON-OS:main
NON-OS:ci/dark-features
NON-OS:crypto/out-of-ring-zero
NON-OS:attest/ak-public
NON-OS:syscall/reachability
NON-OS:asm/entry-surface
NON-OS:vault/keyring-wallet
NON-OS:drivers/conformance
NON-OS:attest/receipt
NON-OS:fs/blockfs-dirs
NON-OS:process/inbox-names
NON-OS:smp/bring-up
NON-OS:feat/files-backend
NON-OS:shell-backoff-and-ipc-bench
NON-OS:desktop-ui-and-measurement
NON-OS:release/trust-reuse
NON-OS:feat/about-redesign
NON-OS:fix/release-gates
NON-OS:tools/guided-build
NON-OS:feat/terminal-rail-and-blocks
NON-OS:feat/proof-carrying-installer
NON-OS:release/inherit-secrets
NON-OS:release/attestation-surface
NON-OS:build/self-verifying
NON-OS:crown/net-desktop
NON-OS:stark/mount-unified
NON-OS:attest/export-and-dev-roots
NON-OS:stark/subgroup-closed-form
NON-OS:feat/nonos-docs-document-core
NON-OS:feat/calculator-restyle
NON-OS:feat/snake-arcade
NON-OS:arch/iommu-smp-gpu
NON-OS:consolidate/all-to-main
NON-OS:integration/production
NON-OS:feat/launchpad-restyle
NON-OS:feat/process-manager-restyle
NON-OS:feat/settings-restyle
NON-OS:caps/service-gate-binding
NON-OS:feat/paint-primitive-layer
NON-OS:feat/video-player-mvp
NON-OS:feat/display-fidelity-w2
NON-OS:abi/syscall-contract
NON-OS:libc/drop-retired-graphics
NON-OS:sdk/declared-capabilities
NON-OS:tls/certificate-basic-constraints
NON-OS:feat/display-fidelity-w1-desktop-aa
NON-OS:browser-engine
NON-OS:dependabot/cargo/bitflags-2.13.0
NON-OS:dependabot/cargo/ed25519-dalek-3.0.0
NON-OS:fix/third-party-app-launch-unblock
NON-OS:dependabot/github_actions/softprops/action-gh-release-3.0.2
NON-OS:nym-bring-up
NON-OS:git-in-terminal
NON-OS:aarch64-capsule-boot
NON-OS:dependabot/github_actions/actions/upload-artifact-7.0.1
NON-OS:dependabot/github_actions/actions/download-artifact-8.0.1
NON-OS:aarch64-bringup
NON-OS:Launchpad-Boot-Fixes
NON-OS:feat/hda-audio-playback
NON-OS:dependabot/github_actions/actions/checkout-7.0.1
NON-OS:security/trusted-path-audit
NON-OS:ci-benchmark-disk
NON-OS:send-live-fees
NON-OS:shell-launch-toast
NON-OS:fix-multiwindow-drain
NON-OS:iwlwifi-gen3-prph-scratch
NON-OS:wallet-qr-receive
NON-OS:browser-layout-fixes
NON-OS:terminal-builtins-driver-probe
NON-OS:browser-image-keepalive-fix
NON-OS:stark-parallel-prover
NON-OS:std-pal-unmodified-tokio
NON-OS:stark-parallel-periodic-commit
NON-OS:feat/nox-pull-http-transfer
NON-OS:lean-verification
NON-OS:stark-recursion-assembly
NON-OS:stark-preprocessed-periodic
NON-OS:feat/wallet-nonos-design-reskin
NON-OS:stark-enrollment-tool
NON-OS:quickjs-browser-engine
NON-OS:dependabot/github_actions/actions/attest-build-provenance-4.1.1
NON-OS:wifi-stack-and-browser-engine
NON-OS:dependabot/cargo/smallvec-1.15.2
NON-OS:stark-shared-crate
NON-OS:stark-recursion-prod
NON-OS:lean-stark-attestation-proofs
NON-OS:feat/wifi-core
NON-OS:feat/image-viewer-capsule
NON-OS:wifi-mlme-supplicant
NON-OS:pr-device-bringup
NON-OS:iwlwifi-mlme-frames
NON-OS:mechanism-code-binding
NON-OS:Lean-Kernel-Proofs-To-Main
NON-OS:sync-primitives-proofs
NON-OS:dependabot/cargo/volatile-0.6.1
NON-OS:dependabot/cargo/halo2curves-0.10.0
NON-OS:repo-hardening
NON-OS:fix/installer-endpoint-collision
NON-OS:fix/installer-spawnbroker-cap
NON-OS:hardening/desktop-graphics
NON-OS:hardening/verification
NON-OS:hardening/apps
NON-OS:hardening/drivers-net
NON-OS:stark-poseidon-recursion
NON-OS:stark-money-grade
NON-OS:feat/terminal-shell-core
NON-OS:stark-lean-degree-bound
NON-OS:Stark-Kernel-Gate
NON-OS:Contributing-ZK-Refresh
NON-OS:Stark-300-Port
NON-OS:Stark-Land
NON-OS:Lean-Evidence
NON-OS:readme-proven-section
NON-OS:Stark-Per-Layer
NON-OS:Lean-Expand-To-Main
NON-OS:Stark-Wiring-Fuzz
NON-OS:Extraction-Regen
NON-OS:Lean-Spec-Coverage
NON-OS:Stark-Whole-Proof
NON-OS:Extraction-To-Main
NON-OS:Lean-Proofs
NON-OS:Stark-Monolith
NON-OS:Lean-Proofs-Expand
NON-OS:Stark-Recursive-Verifier-v2
NON-OS:Stark-Wired-Multi
NON-OS:Stark-Lookup
NON-OS:Stark-Fused
NON-OS:Stark-Multi-Trace-Api
NON-OS:Stark-Fri-Query
NON-OS:verify-proof-gates-main
NON-OS:Stark-Recursive-Verifier
NON-OS:Stark-Poseidon-Fri
NON-OS:Stark-Air-Sponge
NON-OS:Stark-Fri-Fold
NON-OS:revert-270-verification-foundation
NON-OS:Stark-Deep
NON-OS:Stark-Air-Poseidon
NON-OS:ci-verify-main
NON-OS:Fs-Hardening
NON-OS:Deps-Crossbeam-Advisory
NON-OS:verification-foundation
NON-OS:Stark-Fri-Proofs
NON-OS:Extraction-Proofs
NON-OS:Virtio-Net-Proofs
NON-OS:Stark-Proofs
NON-OS:Crypto-Proofs
NON-OS:Kernel-Isolation-Proofs
NON-OS:fix/crossbeam-advisory
NON-OS:Rtl8139-Proofs
NON-OS:Usb-Msc-Proofs
NON-OS:browser-render-fixes
NON-OS:Kernel-Proofs
NON-OS:Xhci-Proofs
NON-OS:E1000-Proofs
NON-OS:Verification-Docs
NON-OS:feat/clock-app
NON-OS:Virtio-Blk-Proofs
NON-OS:Nvme-Proofs
NON-OS:Usb-Proofs
NON-OS:Driver-Proofs
NON-OS:Net-Proofs
NON-OS:Boot-Proofs
NON-OS:browser-full-render
NON-OS:feat/ntp-time-sync
NON-OS:fix/prod-readiness-p0-p1
NON-OS:browser-ui-hardening
NON-OS:kernel-release-attestation
NON-OS:browser-network-hardening
NON-OS:network-browser-hardening
NON-OS:kernel-hardening
NON-OS:feat/netsurf-relibc-fork
NON-OS:ci/benchmark-artifacts
NON-OS:feat/net-core-smoltcp
NON-OS:feat/capsule-browser
NON-OS:bootloader-menu-policy
NON-OS:bootloader-anti-rollback
NON-OS:bootloader-tpm-status
NON-OS:bootloader-tpm-counter
NON-OS:bootloader-hardening
NON-OS:chore/bump-nonos-sign-v2
NON-OS:fix/wallet-tls-live-handshake
NON-OS:integrate/wallet-tls-into-main
NON-OS:feat/terminal-restyle
NON-OS:dev-enroll-bootstrap
NON-OS:bootloader-nonos
NON-OS:feat/terminal-tabs-and-blocks
NON-OS:feat/terminal-prod-readiness
NON-OS:feat/terminal-vt100
NON-OS:nonos-hardening
NON-OS:nonos/surface-vblank-phase-grid
NON-OS:nonos/syscall-bound-user-lengths
NON-OS:fix/preempt-transport-lock-deadlock
NON-OS:nonos/syscall-sleep-ms-getcwd
NON-OS:fix/net-dhcp-dns-crypto-cap
NON-OS:nonos/smp-apic-x2apic-ipi
NON-OS:nonos/input-key-release-target
NON-OS:nonos/mm-fault-budget-heap-guard
NON-OS:nonos/sched-percpu-correctness
NON-OS:perf/desktop-drop-demo-embeds
NON-OS:feat/net-control-op-auth
NON-OS:feat/net-security-wave1
NON-OS:feat/tcp-reliability-core
NON-OS:fix/net-l2-arp-eviction
NON-OS:fix/net-ip-reject-fragments
NON-OS:nonos/crypto-aead-wallet-tls
NON-OS:fix/virtio-net-rx-refill
NON-OS:fix/tcp-ack-acceptability
NON-OS:fix/net-l2-learns-ip
NON-OS:fix/microkernel-syscall-union-merge
NON-OS:nonos/kernel-thread-spawn
NON-OS:feat/dock-hover-reveal
NON-OS:nonos/std-platform-layer-complete
NON-OS:feat/tcp-rfc793-p0-p1
NON-OS:nonos/docs
NON-OS:nonos/desktop-shell
NON-OS:nonos/wallet
NON-OS:nonos/proof-capsules-v2
NON-OS:nonos/proof-capsules
NON-OS:nonos/std-library-expansion
NON-OS:nonos/kernel-process-args
NON-OS:nonos/std-platform-layer
NON-OS:feat/snake-game
NON-OS:nonos/runtime-stack
NON-OS:ek_gpu_scanout_clamp
NON-OS:ek_qemu_widescreen
NON-OS:ek_terminal_shell
NON-OS:feat/alive-system
NON-OS:ek_zk_production_enforce
NON-OS:feat/vfs-real-work-loop
NON-OS:fix/capsule-integrity-fixes
NON-OS:feat/boot-experience-splash
NON-OS:fix/keyboard-hvf-ps2
NON-OS:input-probe-harness
NON-OS:ek_boot_and_capsules_init/spawn
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set
Reference
NON-OS/nonos-micro-kernel!27
Loading…
Reference in a new issue
No description provided.
Delete branch "nonos-sync/gh-259"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
NetSurf-on-NONOS foundation — toolchain, relibc Pal, capsule ops, display de-risk gate
Brings up the foundation for running NetSurf as a signed NONOS capsule via a relibc
nonosPal backend + clangx86_64-unknown-nonostoolchain (not a hand-rolled engine). Long-lived branch built across multiple sessions; the latest arc (Phase 4 Task 4.0) is freshly landed and pixel-proven. 96 commits offmain.Phase status
x86_64-unknown-nonos+ relibc compiles; signed clang/relibc C capsule boots, enters CPL=3, runsmain→write→serial[C-PROOF] PASS[RELIBC-TEST] PASS(fs+malloc+clock)OP_SEEK/PREAD/PWRITE) +net.socketsnonblock/poll/timeout server + full relibc socket+epoll backend[C-NET] PASS(E2E TCP echo over SLIRP)[NSFB-PROBE] PASS+ screendumpThis arc — Phase 4 Task 4.0 (display-shim de-risk gate)
Before vendoring NetSurf + libnsfb, the verified surface/compositor contract is proven end-to-end.
capsule_nsfb_probe(pure C) doesmmap → mk_surface_register → mk_surface_share → OP_DISPLAY_INFO → paint ARGB gradient → OP_SCENE_SUBMIT → OP_DAMAGE_COMMIT, and the gradient reaches the screen.make NONOS_DEV=1 nonos-mk-nsfbprobe-smoke-test→ serial[NSFB-PROBE] PASSand a QMP screendump whose four corners are channel-correct (black / red / green / yellow) — first boot, under hvf.SurfaceDescriptor40B byte-exact (_Static_assert-locked), NCMP framing per the audited contract, caps0x1119hand-synced (Capsule.mk ↔ spawn.rs), kernel mirror of thecapsule_c_proofpattern,microkernel-nsfb-probe-smoketestprofile (core + compositor + virtio-gpu + probe).mk_service_lookupNOENT +OP_DISPLAY_INFOtimeout while the compositor is inwait_for_setup) via a bounded retry.Built under subagent-driven-development: each sub-task implement → independent review → fix → complete; a final whole-arc review came back 0 Critical / 0 Important with the four-layer contract source-verified byte-exact.
Test state
cargo testfor the kernel image). Phase gates[C-PROOF]/[RELIBC-TEST]/[C-NET]/[NSFB-PROBE]all pass.cargo check --features std(#[panic_handler] not found) is pre-existing on the base tree (reproduces without this branch's changes) — tracked separately, not a regression introduced here.Not in this PR (follow-on)
Phase 4.1+ (vendor
netsurf-all-3.11+ thenonoslibnsfb backendnonos.cdelegating to the proven surface path) and Phase 5 (cross-build OpenSSL/curl/freetype + linknetsurf-fb+ package).Opened on GitHub by senseix21 as pull request 259. Review and merge happen there while this repository is kept in step from GitHub; this copy follows it, and is marked merged or closed when it is.
build-sysroot.sh grafts the relibc nonos backend, builds the static artifacts (libc.a + crt0/crti/crtn objects) and cbindgen headers for x86_64-unknown-nonos, and stages them into toolchain/nonos-c/sysroot/ {lib,include}. Static-link only: libc.so/ld.so are not built (the capsule link is fully static), so it builds the specific targets, not `all`. The sysroot itself is a build artifact and gitignored.Mirror capsule_std_proof exactly for the new c_proof capsule: - src/userspace/capsule_c_proof/{mod,embed,spawn}.rs — embed/spawn mirror - src/userspace/mod.rs — capsule_c_proof module declaration - Cargo.toml — nonos-capsule-c-proof feature + microkernel-c-proof profile - src/userspace/init/entry.rs — feature-gated run_c_proof() + call in run_init() Service port 4504/4505. Empty-slice fallbacks keep nonos-mk-check clean with the feature off; signed trust artifacts are out of scope (controller handles).microkernel-c-proof-smoketest (core + nonos-dev-unverified-capsules + c-proof) and nonos-mk-cproof-smoke-{prod,test} prove the clang/relibc C capsule boots and runs without ZK attestation, which is mid NZKCAPS1->2 migration. The harness builds via CPROOF_PROD_TARGET; run with NONOS_DEV=1.relibc's stdio locks the FILE mutex on fwrite/fread; the mutex calls Sys::futex_wake().unwrap() (sync/mod.rs:103). Our futex stubs returned ENOSYS → unwrap panic ("Errno(38)") on the first fwrite. nonos is single-threaded (no real contention, no per-thread TLS), so futex_wait returns Ok (spurious-wakeup; caller re-checks the atomic) and futex_wake returns Ok(0) (no waiters). The plan's "futex→ENOSYS until Phase 3" breaks relibc's locking; a no-op is the correct single-threaded behavior.Add MK_THREAD_SPAWN syscall tag and an x86_64 rlct_trampoline in lowlevel.rs. The trampoline pops the seven words relibc's pthread_create arranges on the new thread stack (entry fn + 6 args) and calls the entry exactly as the linux clone inline-asm child path does, then falls through to MK_EXIT. De-stub rlct_clone: call syscall2(MK_THREAD_SPAWN, rlct_trampoline, stack) with the pre-built stack; return OsTid {} on success (nonos OsTid has no fields — thread_id is linux-only). Concerns: pthread_create panics before reaching rlct_clone on nonos because Tcb::current() is patched to return None and pthread::init() is a no-op; per-thread TLS is Phase-3 work.De-stub three remaining thread helpers: - sched_yield: syscall0(MK_YIELD); Ok(()) - exit_thread: direct syscall1(MK_EXIT, 0) + loop{} (was delegating through Self::exit; now explicit so the call site is unambiguous) - current_os_tid: calls MK_GETPID and returns OsTid {} — all threads report the process pid in Phase 1; per-thread tid requires Phase 3 (kernel must set FS base per thread and expose a gettid syscall). OsTid for target_os="nonos" has no fields, so the pid is intentionally discarded.The probe spawns right after spawn_drivers(), before the compositor is guaranteed to be serving. mk_service_lookup("compositor") returns ERRNO_NOENT immediately when the endpoint is not yet installed, and the first OP_DISPLAY_INFO call blocks only up to the kernel's 5000ms timeout then returns ERRNO_TIMEDOUT while the compositor is still in wait_for_setup(). Both failure modes hit the probe on the first attempt with no retry, so it would FAIL+hang on a transient startup race. Wrap lookup + OP_DISPLAY_INFO in a bounded retry (60 attempts, yielding between tries) mirroring capsule_c_net's connect-retry. Stale replies to timed-out display_info requests are dropped by the kernel's reply no-call guard, so re-issuing the call cannot desync later submit/damage replies. FAIL is emitted only after the bound is exhausted, preserving the original lookup/display_info markers; the success path is unchanged.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.