qemu-board-modeling
Skill57 starsChanged 4 months agoMITView on GitHub
Use for QEMU board, SoC, machine, memory map, boot path, FDT/ACPI, and IRQ topology modeling with qtest-backed verification of machine creation, memory maps, and representative device wiring.
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- qemu-agent-feedbackSkill
- qemu-boot-runSkill
- qemu-buildSkill
- qemu-debugSkill
- qemu-imageSkill
- qemu-kernel-buildSkill
- qemu-linux-bootSkill
- qemu-model-verificationSkill
- qemu-peripheral-modelingSkill
- qemu-qtestSkill
- qemu-register-extractionSkill
- qemu-rst-documentationSkill
- qemu-tcg-backendSkill
- qemu-tcg-frontendSkill
- qemu-uboot-buildSkill
- qemu-workflowSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 24
Before changing source or mutable artifacts, record the workspace root, revision, git status --short, pre-existing changes, goal, scope, …
- Very specific: line 31
Keep QEMU builds under source-root builds/build-<target>/.
- Distinctive: line 48
Use boot or workload evidence only as a supplemental integration gate and state exactly what it proves.
- Very specific: line 75
If board work requires a new peripheral register bank, implement it in a device .c file.
- Very specific: line 118
add a new tests/qtest/<board-or-soc>-test.c case, or extend the closest existing board qtest.
- Distinctive: line 122
verify reset-visible state when qtest can observe it.
- Distinctive: line 123
test one representative interrupt/device wiring path when practical.
- Very specific: line 124
run the narrow Meson qtest name from the matching builds/build-<target>/ directory.
- Very specific: line 128
If a board change cannot be covered by qtest, record the technical reason and replacement evidence in audit.md.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
QEMU Board and Machine Modeling
Audit workflow
For non-trivial workspace writes, use a stable
.oh-my-qemu/<task-slug>/ directory and create only needed entries:
.oh-my-qemu/<task-slug>/
├── audit.md # Baseline, scope, decisions, evidence, verification, and gaps
├── commands.md # Redacted commands, working directories, and results
├── logs/ # Decisive build, test, runtime, or diagnostic logs
├── scripts/ # Temporary scripts, probes, parsers, and harnesses
└── output/ # Generated deliverables, dependencies, and non-QEMU binariesBefore changing source or mutable artifacts, record the workspace root,
revision, git status --short, pre-existing changes, goal, scope, and
acceptance checks in audit.md. Log exact redacted commands and results in
commands.md; record revisions, configurations, tool versions, and hashes when
they affect reproducibility. Separate observations from inferences and edit
source only when requested.
Keep QEMU builds under source-root builds/build-<target>/; put third-party
dependencies and non-QEMU binaries in task output/. Before writing audit
artifacts or configuring QEMU in a Git worktree, add .agents/,
.oh-my-qemu/, and builds/ to the repository-local file from
git rev-parse --git-path info/exclude; preserve existing entries and avoid
duplicates. Never stage or commit those directories. At handoff, verify them
absent from git status --short. Report the task directory and unresolved gaps.
Workflow
- Freeze the board contract, allowed paths, and observable acceptance checks.
- Inspect the current machine, nearby boards, tests, boot ABI, and authoritative hardware sources before changing code.
- Work in small reviewable source-change rounds and record each round's paths,
verification, review result, and gaps in
audit.md. - Build the affected target and add or extend board qtests for machine creation, memory-map probes, and representative IRQ/device wiring.
- Use boot or workload evidence only as a supplemental integration gate and state exactly what it proves.
QEMU upstream boundary
QEMU's official GitLab and mailing lists are upstream project channels. A
patch becomes an upstream contribution when sent to the mailing-list recipients
selected through MAINTAINERS; do not prepare or send agent-generated patches
for that submission. Local branches, commits, patch files, pushes, and pull
requests are not by themselves QEMU upstream contributions. Perform those Git
actions only when requested and follow the workspace's Git policy.
Board contract
A board model is topology and boot policy. A peripheral model is behavior.
The board should define:
- CPU type/count and reset state;
- RAM/ROM/MMIO/alias/unimplemented regions;
- interrupt controller graph and source numbers;
- clock/reset/bus wiring;
- firmware, direct-kernel, initrd, DTB/FDT, or ACPI boot policy;
- optional devices and user-visible machine properties.
The board should not emulate device register semantics.
If board work requires a new peripheral register bank, implement it in a
device .c file. Record the framework decision by applying policy present in
the target QEMU workspace first, compatible explicit user direction second, and
a clear maintained nearby subsystem convention third, stopping at the first
decisive input. Select RegisterInfo or justified manual MMIO callbacks, and
default to RegisterInfo when none decides. Keep register offsets, field
macros, backing storage, framework tables, and register-local callbacks out of
board files and headers.
Required plan facts
Record these before implementation:
- compatibility target: board/SoC revision and intended firmware/SDK;
- closest upstream QEMU reference board;
- memory-map table with symbolic name, base, size, owner, IRQ, and type;
- boot ABI: entry point, reset vector, FDT pointer, privilege mode, RAM base;
- interrupt graph: CPU local interrupts, global controller contexts, cascades, MSI/PCI routing;
- known unimplemented regions and why they are safe for the workload.
Realize order
Use dependency order:
- machine/SoC state;
- CPUs/harts;
- root memory, RAM, ROM;
- interrupt controllers and timers;
- CPU interrupt inputs;
- always-present devices;
- MMIO maps and IRQ/clock/reset wiring;
- optional devices;
- firmware/kernel/initrd/DTB loading;
- reset vector and reset hooks.
Boot helper rule
Reuse architecture helpers before hand-rolling boot code. For example, RISC-V boards should prefer existing reset-vector and direct-kernel helpers unless the real hardware requires a custom ROM path. If firmware intentionally receives no FDT, model that intentionally instead of generating a fake one.
qtest verification requirement
Board-modeling work must be verified through focused qtests, not only through boot smoke. For every new board, SoC, memory-map change, reset-vector change, or IRQ topology change:
- add a new
tests/qtest/<board-or-soc>-test.ccase, or extend the closest existing board qtest; - register it in
tests/qtest/meson.buildunder the correct architecture bucket; - instantiate the machine with the minimal arguments required for the board;
- probe key RAM/ROM/MMIO/unimplemented bases from the memory-map table;
- verify reset-visible state when qtest can observe it;
- test one representative interrupt/device wiring path when practical;
- run the narrow Meson qtest name from the matching
builds/build-<target>/directory; - store the command, result, and log path under
.oh-my-qemu/<task-slug>/.
If a board change cannot be covered by qtest, record the technical reason and replacement evidence in audit.md. A firmware boot log is supplemental evidence, not a substitute for qtest coverage.
Also build the target binary. When firmware compatibility is in scope, record
image hashes and capture the boot console under
.oh-my-qemu/<task-slug>/logs/.
Anti-patterns
- Magic constants scattered through realize code.
- Device register behavior in board files.
- Fake FDT nodes for devices not actually modeled.
- Boot success caused only by globally ignoring invalid accesses.
- Adding many devices before CPU, timer, IRQ, and boot spine are proven.
Upstream references
- QEMU code provenance and AI policy:
docs/devel/code-provenance.rst. - QEMU source layout:
docs/devel/codebase.rst. - GDB/debugging:
docs/system/gdb.rst.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

