Skip to content

uapi,posix: initial POSIX support for UAPI#99

Open
PThierry wants to merge 19 commits into
camelot-os:mainfrom
PThierry:uapi-for-posix
Open

uapi,posix: initial POSIX support for UAPI#99
PThierry wants to merge 19 commits into
camelot-os:mainfrom
PThierry:uapi-for-posix

Conversation

@PThierry

@PThierry PThierry commented Feb 21, 2026

Copy link
Copy Markdown
Contributor

UAPI crate for x86_64 sentry kernel emulation

  • Adding stubs for all syscalls in POSIX mode
  •  Support local syscalls using std directly
  •  Formalize and use local socket base communication for all syscalls that need effective response
  • Add local socket-listening server that uses local informations and dts so that it can serves syscall in POSIX mode as if it was the Sentry kernel. This server can be written, for example, in Python or Rust.
  • adding support so that emulator execute sample apps using uapi and allows exchanges
  •  adding gh workflow to run and execute the emulator as a e2e testing

By now, are excluded from this PR: HW-related manipulations, app capabilities (no restriction to start with) and SHM.

@PThierry PThierry added enhancement New feature or request test Test-related fix uapi Evolution of the uapi Rust library labels Feb 21, 2026
@PThierry PThierry requested review from a team and Copilot April 5, 2026 14:21
@PThierry PThierry added documentation Improvements or additions to documentation ci-cd CI/CD evolutions and fixes build-system build-system related fixes labels Apr 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds initial POSIX/Linux x86_64 support for the sentry-uapi crate by forwarding syscall requests to a local emulator daemon over gRPC, and introduces a Python-based emulator implementation plus end-to-end tests and CI wiring.

Changes:

  • Added a POSIX syscall backend (uapi/src/posix.rs) that forwards syscalls/exchange operations via gRPC to a local emulator daemon.
  • Added a new Python camelot.sentry-emulator tool (daemon, protocol helpers, CLI) with unit + integration/e2e tests and Meson integration.
  • Added sample Rust tasks/apps to exercise the emulator flow, plus a GitHub Actions workflow to run the emulator suite.

Reviewed changes

Copilot reviewed 37 out of 42 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
uapi/src/posix.rs New POSIX syscall backend forwarding syscalls/exchange over gRPC.
uapi/src/lib.rs Switches syscall implementation selection between POSIX vs non-POSIX targets; adjusts no_std handling.
uapi/src/exchange.rs Hooks exchange area copy operations to sync with the emulator daemon on Linux/x86_64.
uapi/src/arch/mod.rs Removes the x86_64 arch backend module from the build.
uapi/Cargo.toml Adds Linux/x86_64-only deps (tonic, tokio, prost) for POSIX mode.
uapi/Cargo.lock Updates lockfile for new Rust dependencies.
tools/sentry-emulator/tox.ini Adds tox envs for tests, mypy, build, and emulator-marked tests.
tools/sentry-emulator/tests/conftest.py Ensures local source-tree imports for pytest.
tools/sentry-emulator/tests/test_server.py Integration tests for gRPC server lifecycle and syscall behaviors.
tools/sentry-emulator/tests/test_protocol.py Unit tests for request deserialization/validation.
tools/sentry-emulator/tests/test_emulator.py E2E test launching emulator with sample Rust apps.
tools/sentry-emulator/tests/test_cli.py CLI validation tests for port and --start parsing/errors.
tools/sentry-emulator/src/camelot/__init__.py Introduces the camelot Python namespace package.
tools/sentry-emulator/src/camelot/sentry_emulator/__init__.py Exposes public Python API and version handling.
tools/sentry-emulator/src/camelot/sentry_emulator/__main__.py Enables python -m camelot.sentry_emulator entrypoint.
tools/sentry-emulator/src/camelot/sentry_emulator/cli.py CLI parser and daemon startup logic.
tools/sentry-emulator/src/camelot/sentry_emulator/dispatcher.py In-memory syscall bookkeeping for tests/diagnostics.
tools/sentry-emulator/src/camelot/sentry_emulator/protocol.py Request normalization + protocol validation.
tools/sentry-emulator/src/camelot/sentry_emulator/server.py Public server API shim re-exporting daemon/types.
tools/sentry-emulator/src/camelot/sentry_emulator/grpc/__init__.py Package marker for gRPC generated code.
tools/sentry-emulator/src/camelot/sentry_emulator/grpc/emulator_pb2.py Generated protobuf messages for emulator RPC.
tools/sentry-emulator/src/camelot/sentry_emulator/grpc/emulator_pb2_grpc.py Generated gRPC client/server bindings.
tools/sentry-emulator/src/camelot/sentry_emulator/emulator_server/__init__.py Internal module exports for emulator server components.
tools/sentry-emulator/src/camelot/sentry_emulator/emulator_server/constants.py Shared constants for status codes, exchange size, signal/event encoding.
tools/sentry-emulator/src/camelot/sentry_emulator/emulator_server/models.py Startup specs and runtime context models + --start parsing.
tools/sentry-emulator/src/camelot/sentry_emulator/emulator_server/daemon.py gRPC daemon lifecycle, context mgmt, alarms, exchange buffers, signal queueing.
tools/sentry-emulator/src/camelot/sentry_emulator/emulator_server/servicer.py gRPC Dispatch handler implementing syscall behaviors.
tools/sentry-emulator/sample-rust-app/Cargo.toml Adds sample Rust tasks/apps crate for emulator e2e validation.
tools/sentry-emulator/sample-rust-app/Cargo.lock Lockfile for the sample Rust app dependencies.
tools/sentry-emulator/sample-rust-app/src/lib.rs Sample task logic covering signals, alarm, random, cycle, and logging.
tools/sentry-emulator/sample-rust-app/src/bin/sample-app-one.rs Sender app binary entrypoint for e2e.
tools/sentry-emulator/sample-rust-app/src/bin/sample-app-two.rs Receiver app binary entrypoint for e2e.
tools/sentry-emulator/README.md Documents emulator features, usage, and sample tasks.
tools/sentry-emulator/pyproject.toml Python packaging, deps, scripts, pytest/mypy config.
tools/sentry-emulator/proto/emulator.proto Protobuf service/message definitions for emulator Dispatch.
tools/sentry-emulator/meson.build Meson targets for building the Python wheel and sample Rust apps.
tools/sentry-emulator/.gitignore Ignores Python and build artifacts plus sample Rust targets.
tools/meson.build Adds Meson option-driven emulator subdir and an e2e Meson test.
meson.options Adds with_emulator option toggle.
requirements.txt Adds Python build + gRPC/protobuf dependencies for CI/tooling.
REUSE.toml Adds additional REUSE annotations for local build/analysis artifacts.
.github/workflows/emulation.yml New CI workflow to build and run emulator e2e tests under Meson.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread uapi/src/lib.rs Outdated
Comment thread uapi/src/arch/mod.rs
Comment thread uapi/src/posix.rs
Comment thread uapi/src/posix.rs
Comment thread uapi/src/posix.rs
@PThierry PThierry marked this pull request as ready for review April 5, 2026 14:51
@PThierry PThierry requested a review from r3dlight as a code owner April 5, 2026 14:51
adding emulator-backed sleep() support
@PThierry PThierry moved this to In Progress in Sentry kernel roadmap Apr 11, 2026
@PThierry PThierry added this to the v0.6.0 milestone Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-system build-system related fixes ci-cd CI/CD evolutions and fixes documentation Improvements or additions to documentation enhancement New feature or request test Test-related fix uapi Evolution of the uapi Rust library

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants