riscv-privileged

riscv-privileged is a skill for Claude Code, Codex from mohitmishra786/low-level-dev-skills. It costs 86 tokens per session (2,041 once invoked), scanned A, original, MIT.

A guide to the privileged parts of the RISC-V processor architecture, including operating modes, interrupts, traps, control registers, and virtual memory.

In plain words
What is it for?
Use it when writing an operating-system kernel, hypervisor, firmware integration, trap handlers, interrupt support, page tables, or QEMU-based RISC-V tests.
Why use it?
It explains the low-level rules needed for software that runs close to the processor, where small mistakes can prevent a system from booting or handling faults correctly.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is make PLATFORM=generic FW_PAYLOAD_PATH=../kernel.elf FW_PAYLOAD_OFFSET=0x80200000.

Good fit Use it when writing an operating-system kernel, hypervisor, firmware integration, trap handlers, interrupt support, page tables, or QEMU-based RISC-V tests.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills
agentmods
npx agentmods add skills/mohitmishra786/low-level-dev-skills/riscv-privileged

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for riscv-privileged

README.md
[![agentmods](https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/riscv-privileged/github.svg)](https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/riscv-privileged)
Your own site
<a href="https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/riscv-privileged"><img src="https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/riscv-privileged/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for riscv-privileged

Your own site · 80×15
<a href="https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/riscv-privileged"><img src="https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/riscv-privileged.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 86 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,041 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00086 $0.02041
Opus 5.5 $0.00034 $0.00816
Sonnet 5.5 $0.00017 $0.00408
Haiku 4.5 $0.00009 $0.00204

Measured 14d ago against content hash aac34822fbf0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

riscv-privileged scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 14d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/platform/riscv-privileged/SKILL.md · 242 lines

How it starts

The opening of the file, as written. The whole thing — 242 lines — stays where its author put it; the contents beside it link to each section on GitHub.

RISC-V Privileged Architecture

Purpose

Guide agents through the RISC-V privileged specification: M/S/U privilege modes, CSR registers, trap handling, PLIC and CLINT interrupt controllers, OpenSBI firmware integration, Sv39/Sv48 page tables, and QEMU virt machine testing.

Triggers

  • Writing an OS kernel or hypervisor for RISC-V
  • Implementing trap handlers and context switch
  • Integrating OpenSBI for S-mode firmware services
  • Configuring interrupt controllers on QEMU virt or hardware
  • Setting up virtual memory with Sv39 or Sv48
  • Porting xv6-RISC-V or bare-metal firmware

Workflow

1. Privilege levels

RISC-V privilege stack
├── M-mode (Machine) — firmware, OpenSBI, most privileged
├── S-mode (Supervisor) — OS kernel
└── U-mode (User) — applications

Embedded (no S-mode): M + U only

2. Key CSRs

CSR Mode Purpose
mstatus / sstatus M/S Interrupt enable, privilege state
mtvec / stvec M/S Trap vector base address
mepc / sepc M/S Exception PC
mcause / scause M/S Trap cause code
mtval / stval M/S Faulting address/instruction
satp S Page table root (mode + PPN)
mie / sie M/S Interrupt enable bits
mip / sip M/S Interrupt pending bits
// Read CSR (GCC extended asm)
static inline uint64_t read_csr_satp(void) {
    uint64_t val;
    asm volatile("csrr %0, satp" : "=r"(val));
    return val;
}

// Write CSR
static inline void write_csr_stvec(void *handler) {
    asm volatile("csrw stvec, %0" :: "r"(handler));
}

3. Trap handling

Trap types
├── Synchronous exceptions — ecall, page fault, illegal insn
└── Asynchronous interrupts — timer, external, software
// scause encoding (top bit: 1=interrupt, 0=exception)
void handle_trap(uint64_t scause, uint64_t sepc, uint64_t stval) {
    if (scause & (1UL << 63)) {
        // Interrupt
        switch (scause & 0xff) {
        case 5:  // Supervisor timer interrupt
            timer_interrupt();
            break;
        case 9:  // Supervisor external interrupt
            external_interrupt();
            break;
        }
    } else {
        // Exception
        switch (scause) {
        case 8:   // ecall from U-mode
            handle_syscall();
            break;
        case 12:  // Instruction page fault
        case 13:  // Load page fault
        case 15:  // Store page fault
            handle_page_fault(stval, scause);
            break;
        }
    }
}

Read the full file on GitHub · 242 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 14d ago Changed · +2 lines aac34822fbf0
  2. 3mo ago First seen · 240 lines · 86 tokens per session scan A ac8af49dca34

Subscribe to this mod's changes

riscv-privileged is a skill published in the GitHub repository mohitmishra786/low-level-dev-skills (310 stars, last pushed 14d ago), licensed MIT. It adds 86 tokens to every session and 2,041 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

riscv-privileged compared with skills from other repositories

riscv-privileged next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
riscv-privilegedmohitmishra786/low-level-dev-skillsSkill31014d agoMITA86Claude Code, Codex
gke-ai-troubleshooting-tpu-dynamic-slices-monitoringgoogle/skillsSkill26ktodayApache-2.0A107Claude Code, Codex
gke-ai-troubleshooting-tpu-vbar-oomgoogle/skillsSkill26ktodayApache-2.0A125Claude Code, Codex
doca-flowNVIDIA/skillsSkill4.3ktodayApache-2.0A224Claude Code
diagnose-driver-installNVIDIA/deepopsSkill1.5k3d agoBSD-3-ClauseA47Claude Code, Codex
eidezhinkgit/embeddedskillsSkill831yesterdayMITA151Claude Code
gtrace-path-analysisautomateyournetwork/netclawSkill7393d agoApache-2.0A156Claude Code