os-dev-scratch

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

A step-by-step guide to building a small operating system from the bootloader to running programs. It covers CPU setup, interrupts, virtual memory, basic device drivers, context switching, and testing with QEMU, a virtual machine emulator.

In plain words
What is it for?
Learning OS fundamentals, creating a minimal x86-64 or RISC-V kernel, writing memory and device-management code, and booting it in QEMU.
Why use it?
It makes the sequence from powering on a computer to running a kernel understandable and provides a controlled way to test low-level code.

Skill for Claude CodeCodex

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

Good fit Learning OS fundamentals, creating a minimal x86-64 or RISC-V kernel, writing memory and device-management code, and booting it in QEMU.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mohitmishra786/low-level-dev-skills/os-dev-scratch
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add mohitmishra786/low-level-dev-skills --skill os-dev-scratch
Clone the repo
git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills

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 os-dev-scratch

README.md
[![agentmods](https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/os-dev-scratch/github.svg)](https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/os-dev-scratch)
Your own site
<a href="https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/os-dev-scratch"><img src="https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/os-dev-scratch/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 os-dev-scratch

Your own site · 80×15
<a href="https://agentmods.dev/skills/mohitmishra786/low-level-dev-skills/os-dev-scratch"><img src="https://agentmods.dev/badge/skills/mohitmishra786/low-level-dev-skills/os-dev-scratch.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,121 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.02121
Opus 5 $0.00043 $0.01060
Sonnet 5 $0.00017 $0.00424
Haiku 4.5 $0.00009 $0.00212

Measured 8d ago against content hash a4b519bfedf9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

os-dev-scratch 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 8d 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/kernel/os-dev-scratch/SKILL.md · 250 lines

How it starts

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

OS Development from Scratch

Purpose

Guide agents through building a minimal operating system from scratch: bootloader stages (BIOS/GRUB vs UEFI/limine), 64-bit long mode setup with GDT and page tables, IDT and interrupt handlers, PIC/APIC configuration, basic keyboard and serial drivers, physical and virtual memory managers, context switching, with xv6-RISC-V as a reference architecture.

When to Use

  • Learning how an OS boots from power-on to main()
  • Implementing protected/long mode transitions on x86-64
  • Writing a physical memory allocator (bitmap) and page table manager
  • Handling timer, keyboard, and page fault interrupts
  • Testing with QEMU -kernel and cross-compiler x86_64-elf-gcc
  • Porting concepts from xv6 to a custom x86 or RISC-V kernel

Workflow

1. Boot stages overview

BIOS path (legacy)
├── BIOS POST
├── MBR (512 bytes) → boot sector loads stage2
├── GRUB/multiboot → loads kernel ELF
└── kernel entry (_start)

UEFI path (modern)
├── UEFI firmware
├── EFI bootloader (limine, systemd-boot)
├── Loads kernel + initrd from ESP
└── kernel entry (handoff with memory map)

2. Toolchain setup

# Cross-compiler for bare metal
brew install x86_64-elf-gcc x86_64-elf-binutils   # macOS
# or build from source / apt install gcc-x86-64-elf

x86_64-elf-gcc --version

# QEMU for testing
qemu-system-x86_64 --version

Linker script essentials:

/* linker.ld */
ENTRY(_start)
SECTIONS {
    . = 0x100000;          /* 1MB — typical kernel load address */
    .text : { *(.text .text.*) }
    .rodata : { *(.rodata .rodata.*) }
    .data : { *(.data .data.*) }
    .bss : { *(.bss .bss.*) }
}
x86_64-elf-gcc -ffreestanding -nostdlib -c kernel.c -o kernel.o
x86_64-elf-ld -T linker.ld kernel.o -o kernel.elf

3. Multiboot/limine boot

# QEMU direct kernel boot (no disk)
qemu-system-x86_64 \
  -kernel kernel.elf \
  -serial stdio \
  -m 128M \
  -no-reboot -no-shutdown

# With limine (UEFI)
qemu-system-x86_64 \
  -bios /usr/share/ovmf/OVMF.fd \
  -drive file=disk.img,format=raw \
  -serial stdio

Read the full file on GitHub · 250 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. 8d ago First seen · 250 lines · 86 tokens per session scan A a4b519bfedf9

Subscribe to this mod's changes

os-dev-scratch is a skill published in the GitHub repository mohitmishra786/low-level-dev-skills (203 stars, last pushed 2mo ago), licensed MIT. It adds 86 tokens to every session and 2,121 once invoked, about $0.0004 per session on Opus 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.