Technical guide for kernel-level development and debugging.
Install
mkdir -p .claude/skills/kernel-development && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10226" && unzip -o skill.zip -d .claude/skills/kernel-development && rm skill.zipInstalls to .claude/skills/kernel-development
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Guide for modifying and debugging the Nanvix kernel architecture and kernel-call paths. Use this when asked about kernel internals or kernel implementation changes.Key capabilities
- →Modify kernel modules
- →Debug hardware abstractions
- →Understand IPC implementations
- →Change dispatch logic
How it works
Provides architectural guidance for the Nanvix microkernel, a #![no_std] Rust binary.
Inputs & outputs
When to use kernel-development
- →Modify kernel modules
- →Debug memory management paths
- →Understand IPC implementations
- →Change kernel-call dispatch logic
About this skill
Kernel Development
Use this skill when the user asks about developing, modifying, or debugging the Nanvix microkernel.
The kernel is a #![no_std] Rust binary targeting x86 (32-bit) and lives in src/kernel/.
Architecture Overview
The kernel is a freestanding binary (#![no_std],
#![no_main]) that runs in ring 0 on x86. Entry point is
src/kernel/src/kmain.rs.
Key Modules
| Module | Path | Purpose |
|---|---|---|
hal | src/kernel/src/hal/ | Hardware Abstraction. |
mm | src/kernel/src/mm/ | Memory Management. |
pm | src/kernel/src/pm/ | Process Management. |
ipc | src/kernel/src/ipc/ | IPC (mailboxes). |
event | src/kernel/src/event/ | Event subsystem. |
io | src/kernel/src/io/ | I/O subsystem. |
kcall | src/kernel/src/kcall/ | Kernel call dispatch. |
kargs | src/kernel/src/kargs.rs | Boot args parsing. |
kimage | src/kernel/src/kimage.rs | Kernel image mgmt. |
klog | src/kernel/src/klog.rs | Kernel logging. |
kpanic | src/kernel/src/kpanic.rs | Panic handler. |
uart | src/kernel/src/uart.rs | UART serial driver. |
Machine Configurations
The kernel supports multiple machine types via Cargo feature flags:
microvm(default) — Lightweight VM for KVM.
Virtual Memory Layout
KERNEL_BASE_RAWtoKPOOL_BASE_RAW— Kernel binary.KPOOL_BASE_RAWtoUSER_BASE_RAW— Kernel pool.USER_BASE_RAWtoUSER_MMAP_BASE_RAW— User binary.USER_MMAP_BASE_RAWtoUSER_LIBS_BASE_RAW— Mapped.USER_LIBS_BASE_RAWtoUSER_HEAP_BASE_RAW— Libs.USER_HEAP_BASE_RAWtoUSER_HEAP_END_RAW— Heap.USER_STACK_TOP_RAWtoUSER_STACK_BASE_RAW— Stack.
Building the Kernel
./z build -- kernel
The kernel uses a custom Cargo target
(build/targets/x86-kernel.json) and custom linker scripts
(build/kernel/). Kernel builds disable sccache to avoid
issues with compiler_builtins.
Key Dependencies
The kernel depends on workspace libraries:
arch— Architecture abstractions.bitmap— Bitmap data structure.config— Compile-time configuration.type-safe— Type-safe wrappers.raw-array— Fixed-size arrays.slab— Slab allocator.sys— System-level types (kcall, IPC, MM, PM).
Coding Rules (Kernel-Specific)
- All kernel code is
#![no_std]— onlycoreandallocare available. - No
panic!,unwrap(), orexpect()in production kernel code. - Use explicit type annotations everywhere.
- Prefix imports with
::. - Minimize
unsafeblocks and document safety invariants. - Log errors with
error!macro before returningErr. - Use kernel-specific Cargo commands:
KERNEL_CARGO_BUILD_CMD. - Kernel configuration is in
build/kernel_config.toml.
Kernel Calls (System Calls)
Kernel calls are dispatched through
src/kernel/src/kcall/dispatcher.rs. Each subsystem (PM,
MM, IPC, Event, IO) registers its own kernel call handlers
in its respective kcall/ subdirectory.
When not to use it
- →User-space application development
Prerequisites
Limitations
- →No standard library available
- →Strict coding rules for safety
How it compares
Specifically tailored for microkernel development and low-level hardware abstraction.
Compared to similar skills
kernel-development side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| kernel-development (this skill) | 0 | 3mo | Review | Advanced |
| coding | 0 | 6mo | No flags | Advanced |
| cellar | 0 | 4mo | Review | Intermediate |
| deepwiki-rs | 25 | 9mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by nanvix
View all by nanvix →You might also like
coding
ricardoquesada
coding — an agent skill by ricardoquesada.
cellar
Quafadas
Look up the public API of any JVM dependency (Scala 3, Scala 2, Java) from the terminal. Returns type signatures, members, docstrings, and source code as Markdown.
deepwiki-rs
sopaco
AI-powered Rust documentation generation engine for comprehensive codebase analysis, C4 architecture diagrams, and automated technical documentation. Use when Claude needs to analyze source code, understand software architecture, generate technical specs, or create professional documentation from any programming language.
arm-cortex-expert
sickn33
Senior embedded software engineer specializing in firmware and driver development for ARM Cortex-M microcontrollers (Teensy, STM32, nRF52, SAMD). Decades of experience writing reliable, optimized, and maintainable embedded code with deep expertise in memory barriers, DMA/cache coherency, interrupt-driven I/O, and peripheral drivers.
memory-safety-patterns
sickn33
Implement memory-safe programming with RAII, ownership, smart pointers, and resource management across Rust, C++, and C. Use when writing safe systems code, managing resources, or preventing memory bugs.
debug-cli
antinomyhq
Use when users need to debug, modify, or extend the code-forge application's CLI commands, argument parsing, or CLI behavior. This includes adding new commands, fixing CLI bugs, updating command options, or troubleshooting CLI-related issues.