Extending concurrent separation logic to the hardware level to verify the xv6 OS kernel on RISC-V with AI agents
M. Frans Kaashoek, Nickolai Zeldovich
Key points
From the paper's conclusion- As a case study, we verify the xv6 OS kernel (6,593 lines of C and assembly code), which provides a traditional Unix system call interface (processes, file system, file descriptors, and preemptive scheduling) and has substantial internal concurrency (multi-core support with fine-grained locking, shared memory, interrupts, DMA, etc.).
Abstract
MachCSL is a framework for verifying systems software, such as an OS kernel, on top of low-level semantics of a RISC-V computer, based on the Sail RISC-V semantics. The key idea behind MachCSL is to adapt concurrent separation logic, based on Iris, to reasoning about low-level hardware execution at the sub-instruction level: page-table translation, TLB, privilege levels, configuration registers, instruction fetch/decode/execute, traps and interrupts, DMA, shared memory, power failures, etc. Reasoning at this level of detail ensures that the system software correctly manages all of the hardware details. Verifying software at this low level of abstraction is tedious, but LLM-based agents are capable of reasoning about such low-level details. As a case study, we verify the xv6 OS kernel (6,593 lines of C and assembly code), which provides a traditional Unix system call interface (processes, file system, file descriptors, and preemptive scheduling) and has substantial internal concurrency (multi-core support with fine-grained locking, shared memory, interrupts, DMA, etc.). In the verification process, we uncovered nine bugs in the xv6 implementation, as well as one bug in the Sail RISC-V semantics. The verification effort took us 77 days, including the time to develop the MachCSL framework.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Formalizing the Linux eBPF Core ISA: A Mechanized Operational Semantics and Its Real-World ApplicationsProceedings of the ACM on Programming Languages · 2026
- Automated Multi-Line Bug Repair Using Model Checker Aided LLMs: A Case Study on RISC-V ProcessorsarXiv · 2026
- Interrupt-Aware Static Detection of Deadlocks in Rust Operating SystemsarXiv · 2026
- Ring-0 by Default: Agents as Operating Systems (AaOS)arXiv · 2026
- An Agentic OS Kernel for Flexible and Enhanced SemanticsarXiv · 2026
- A Relational Separation Logic for Effect HandlersProceedings of the ACM on Programming Languages · 2026