一键导入
daemon-development
// Guide for developing and debugging Nanvix daemons, including guest daemons and host linuxd behavior. Use this when asked about daemon architecture or daemon changes.
// Guide for developing and debugging Nanvix daemons, including guest daemons and host linuxd behavior. Use this when asked about daemon architecture or daemon changes.
Guide for Nanvix CI and GitHub Actions workflow behavior, including local pipeline execution and matrix coverage. Use this when asked about CI checks, workflow failures, or release flow.
Guide for developing, building, and running Nanvix user-space applications across supported runtimes and languages. Use this when asked about guest app implementation or execution.
Guide for creating and modifying Nanvix libraries under src/libs, including guest no_std and host std crates. Use this when asked about library architecture or crate changes.
Guide for modifying and debugging the Nanvix kernel architecture and kernel-call paths. Use this when asked about kernel internals or kernel implementation changes.
Guide for writing, running, and debugging Nanvix unit, integration, and system tests in Rust and C/C++. Use this when asked about test implementation or failures.
Guide for running Nanvix tests with z. Use this when asked to run unit tests, integration tests, or the full test suite.
| name | daemon-development |
| description | Guide for developing and debugging Nanvix daemons, including guest daemons and host linuxd behavior. Use this when asked about daemon architecture or daemon changes. |
Use this skill when the user asks about developing, modifying, or debugging system daemons in Nanvix. Daemons are long-running system services that run in user-space and provide core OS functionality.
| Daemon | Path | Target | Purpose |
|---|---|---|---|
memd | src/daemons/memd/ | Guest | Memory management. |
procd | src/daemons/procd/ | Guest | Process management. |
linuxd | src/daemons/linuxd/ | Host | L2 VM management. |
memd, procd)Guest daemons are #![no_std], #![no_main] Rust binaries that run inside the Nanvix microkernel
environment. They communicate with the kernel through kernel calls (sys::kcall) and handle system
events/messages.
memd)sys::kcall::pm::terminate() and sys::kcall::event::resume().procd)linuxd)std support.build/linuxd_config.toml.microvm machine.# Build all daemons as part of the full build.
./z build -- all
# Guest daemons: GUEST_CARGO_BUILD_CMD.
# Host daemons (linuxd): HOST_CARGO_BUILD_CMD.
Create directory at src/daemons/<name>/.
Add Cargo.toml:
[package]
name = "<name>"
version.workspace = true
license-file.workspace = true
authors.workspace = true
edition.workspace = true
[[bin]]
name = "<name>"
path = "src/main.rs"
[dependencies]
sys = { workspace = true }
syslog = { workspace = true }
# Additional dependencies as needed.
Create src/main.rs with:
// Copyright(c) The Maintainers of Nanvix.
// Licensed under the MIT License.
#![no_std]
#![no_main]
extern crate alloc;
// Daemon implementation.
Add the crate to the workspace members in root
Cargo.toml.
Add the daemon name to ALL_GUEST_DAEMONS in the
Makefile.
#![no_std] and #![no_main].sys::kcall::*) for system interactions.SystemMessage structures.error! before returning.syslog crate for logging within guest daemons.