OS development from scratch skill for bootloader through context switching.

MITAuto-check passed

Install Os Dev Scratch

skills CLI
$ npx skills add mohitmishra786/low-level-dev-skills --skill os-dev-scratch -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install mohitmishra786/low-level-dev-skills os-dev-scratch --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/kernel/os-dev-scratch .claude/skills/os-dev-scratch && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
os-dev-scratch
GitHub stars
253
Token cost
~1.7k tokens
SKILL.md length
293 words
Files
1
Skills in repo
138
Repo updated
First seen
Licence
MIT

At a glance

OS development from scratch skill for bootloader through context switching.

  • Works in 10 steps: Boot stages overview → Toolchain setup → Multiboot/limine boot → …
  • Building a minimal x86-64 OS
  • SKILL.md covers Purpose, When to Use, Workflow and Common Problems, plus 1 more section
  • Calls brew, git and make; reaches github.com

What it does

Os Dev Scratch is an agent skill from mohitmishra786/low-level-dev-skills. OS development from scratch skill for bootloader through context switching. Use when building a minimal x86-64 OS, setting up GDT/IDT/page tables, writing keyboard/serial drivers, or using QEMU for kernel boot. Activates on queries about bootloader, long mode, page tables, IDT, PIC/APIC, xv6, or x8664-elf-gcc.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: A curated suite of AI agent skills for systems and low-level programming with C/C++, Rust, and Zig toolchains, covering compilers, debuggers, profilers, build systems…. The licence is MIT.

When your agent uses it

  • Building a minimal x86-64 OS
  • Setting up GDT/IDT/page tables
  • Writing keyboard/serial drivers
  • Using QEMU for kernel boot

Example prompts

  • “/os-dev-scratch”

Workflow steps

10 steps, taken from the step headings in SKILL.md.

  1. Boot stages overview
  2. Toolchain setup
  3. Multiboot/limine boot
  4. Long mode setup
  5. IDT and interrupt handlers
  6. PIC and APIC
  7. Serial and keyboard drivers
  8. Physical memory manager
  9. Context switching
  10. xv6-RISC-V reference

What it can do on your machine

Read from SKILL.md and the folder at commit bdc5847. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • brew
    • git
    • make

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Os Dev Scratch loads about 1.7k tokens when it runs. Until then it costs about 82 tokens; SKILL.md has 293 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~82
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from mohitmishra786/low-level-dev-skills at commit bdc5847, republished under its MIT licence (© mohitmishra786). 293 words, ~1,738 tokens.

Download SKILL.mdSave it as .claude/skills/os-dev-scratch/SKILL.md (or your agent's skills folder).
name
os-dev-scratch
description
OS development from scratch skill for bootloader through context switching. Use when building a minimal x86-64 OS, setting up GDT/IDT/page tables, writing keyboard/serial drivers, or using QEMU for kernel boot. Activates on queries about bootloader, long mode, page tables, IDT, PIC/APIC, xv6, or x86_64-elf-gcc.

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
bash
# 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:

ld
/* linker.ld */
ENTRY(_start)
SECTIONS {
    . = 0x100000;          /* 1MB — typical kernel load address */
    .text : { *(.text .text.*) }
    .rodata : { *(.rodata .rodata.*) }
    .data : { *(.data .data.*) }
    .bss : { *(.bss .bss.*) }
}
bash
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
bash
# 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
4. Long mode setup
Protected mode (32-bit) → enable PAE → setup 4-level page tables → enable long mode
c
// Minimal GDT entry (64-bit flat segments)
struct gdt_entry {
    uint16_t limit_low;
    uint16_t base_low;
    uint8_t  base_mid;
    uint8_t  access;
    uint8_t  granularity;
    uint8_t  base_high;
} __attribute__((packed));

// Page table setup (4KB pages, identity map first 1GB)
uint64_t pml4[512] __attribute__((aligned(4096)));
uint64_t pdpt[512] __attribute__((aligned(4096)));
uint64_t pd[512] __attribute__((aligned(4096)));

void setup_paging(void) {
    for (int i = 0; i < 512; i++)
        pd[i] = (i * 0x200000) | 0x83;  // 2MB huge pages
    pdpt[0] = (uint64_t)pd | 0x03;
    pml4[0] = (uint64_t)pdpt | 0x03;
    __asm__ volatile("mov %0, %%cr3" :: "r"(pml4));
}
5. IDT and interrupt handlers
c
struct idt_entry {
    uint16_t offset_low;
    uint16_t selector;
    uint8_t  ist;
    uint8_t  type_attr;
    uint16_t offset_mid;
    uint32_t offset_high;
    uint32_t zero;
} __attribute__((packed));

// ISR stub (assembly) → common handler → dispatch by vector
void interrupt_handler(struct trap_frame *frame) {
    if (frame->vector == 14)  // page fault
        handle_page_fault(frame->cr2, frame->error_code);
    else if (frame->vector == 33)  // keyboard IRQ remapped
        keyboard_handler();
}
bash
# Test page fault
# QEMU monitor: info registers
6. PIC and APIC
c
// Legacy PIC remapping (8259)
// Remap IRQ 0-15 to vectors 32-47
outb(0x20, 0x11); outb(0xA0, 0x11);
outb(0x21, 0x20); outb(0xA1, 0x28);  // vector offsets
// ...

// Modern: use APIC/IOAPIC (ACPI MADT parsing)
// LAPIC timer for preemption
7. Serial and keyboard drivers
c
// COM1 serial (0x3F8)
void serial_putc(char c) {
    while ((inb(0x3F8 + 5) & 0x20) == 0);
    outb(0x3F8, c);
}

// PS/2 keyboard scancode → ASCII lookup table
void keyboard_handler(void) {
    uint8_t scancode = inb(0x60);
    char c = scancode_to_ascii[scancode];
    if (c) serial_putc(c);
    outb(0x20, 0x20);  // EOI to PIC
}
bash
qemu-system-x86_64 -kernel kernel.elf -serial stdio
# printk output appears in terminal
8. Physical memory manager
c
// Bitmap allocator over usable RAM regions
// From multiboot memory map or UEFI memory map
#define PAGE_SIZE 4096
uint8_t *frame_bitmap;
uint64_t total_frames;

uint64_t alloc_frame(void) {
    for (uint64_t i = 0; i < total_frames; i++) {
        if (!test_bit(frame_bitmap, i)) {
            set_bit(frame_bitmap, i);
            return i * PAGE_SIZE;
        }
    }
    return 0;  // OOM
}
9. Context switching
c
struct context {
    uint64_t rax, rbx, rcx, rdx, rsi, rdi, rbp, rsp;
    uint64_t r8, r9, r10, r11, r12, r13, r14, r15;
    uint64_t rip;
};

void switch_context(struct context *old, struct context *new);
// Assembly: save callee-saved regs to old, restore from new, ret to new->rip

Cooperative scheduling first; add timer IRQ preemption later.

10. xv6-RISC-V reference
bash
git clone https://github.com/mit-pdos/xv6-riscv
cd xv6-riscv && make qemu
xv6 componentx86 equivalent
kernel/vm.cPage table management
kernel/trap.cIDT/interrupt dispatch
kernel/proc.cContext switch, scheduler
kernel/plic.cPIC/APIC interrupt controller
user/usys.plSystem call stubs

Common Problems

SymptomCauseFix
Triple fault on bootInvalid GDT/IDT or stackSet up stack before enabling interrupts
QEMU black screenNo serial output configured-serial stdio; early serial_init
Page fault in kernelUnmapped addressIdentity-map kernel; check CR3
IRQ never firesPIC mask or IDT not loadedlidt; unmask IRQ in PIC
Timer doesn't tickLAPIC not initializedParse ACPI; calibrate LAPIC timer
Linker relocation errorWrong load addressMatch linker.ld with bootloader expectation
  • skills/low-level-programming/assembly-x86 — x86-64 assembly for ISR stubs
  • skills/low-level-programming/assembly-riscv — xv6-RISC-V reference ISA
  • skills/platform/riscv-privileged — RISC-V trap handling and page tables
  • skills/virtualization/qemu-kvm — QEMU flags for kernel development
  • skills/kernel/kernel-internals — Linux implementation of these concepts
  • skills/low-level-programming/linux-kernel-modules — graduate to Linux once basics work

© mohitmishra786, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/kernel/os-dev-scratch of mohitmishra786/low-level-dev-skills.

Open the folder on GitHubat commit bdc5847

Compare with similar skills

Os Dev Scratch next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Os Dev Scratch compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Os Dev Scratch this skillmohitmishra786/low-level-dev-skills253—~1.7kAutomated safety check: PassMIT
Implementing Ransomware Kill Switch Detectionmukul975/Anthropic-Cybersecurity-Skills34k—~2.4kAutomated safety check: PassApache-2.0
Wiki SwitchAr9av/obsidian-wiki3.5k—~1.3kAutomated safety check: PassMIT
Switch Personaopenakita/openakita2k—~286Automated safety check: PassAGPL-3.0
Kermt Pretrain ScratchNVIDIA/skills3.5k1 repos~2.4kAutomated safety check: PassApache-2.0
Bio Isoform SwitchingFreedomIntelligence/OpenClaw-Medical-Skills3.1k—~1.5kAutomated safety check: PassNone

Similar skills

  • Implementing Ransomware Kill Switch Detection

    mukul975/Anthropic-Cybersecurity-Skills

    Analyzes ransomware kill switch mechanisms, including mutex-based execution guards, domain-based kill switches (e.g.

    34k GitHub stars~2.4k tokensUpdated 1 mo ago
    DevOps & CloudAuto-check passed
  • Wiki Switch

    Ar9av/obsidian-wiki

    List, create, or switch named Obsidian wiki vault profiles under the global config directory.

    3.5k GitHub stars~1.3k tokensUpdated today
    Knowledge ManagementAuto-check passed
  • Switch Persona

    openakita/openakita

    Switch Agent persona preset. An agent skill from openakita/openakita.

    2k GitHub stars~286 tokensUpdated 14 days ago
    Agent WorkflowsAuto-check passed
  • Official

    Pretrain a fresh KERMT model from scratch on a user-provided corpus.

    3.5k GitHub starsUsed in 1 repo~2.4k tokens
    AI & LLM EngineeringAuto-check passed
  • Bio Isoform Switching

    FreedomIntelligence/OpenClaw-Medical-Skills

    Analyzes isoform switching events and functional consequences using IsoformSwitchAnalyzeR.

    3.1k GitHub stars~1.5k tokensUpdated 2 mo ago
    Research & ScienceAuto-check passed
  • Credit From Scratch

    mohitagw15856/pm-claude-skills

    Summarise what Credit From Scratch does in one line. An agent skill from mohitagw15856/pm-claude-skills.

    1.4k GitHub stars~264 tokensUpdated today
    Auto-check passed

More from mohitmishra786/low-level-dev-skills

All 138 skills in this repo
  • ARM and AArch64 Assembly

    mohitmishra786/low-level-dev-skills

    Guides reading and writing AArch64 and ARM Thumb assembly: compiler output, inline asm, registers, the AAPCS calling convention and NEON or SVE basics.

    253 GitHub stars~1.9k tokensUpdated 3 mo ago
    Auto-check passed
  • RISC-V Assembly Guide

    mohitmishra786/low-level-dev-skills

    Reference for RISC-V assembly on RV32 and RV64: register names and calling convention, extension naming, GCC and Clang inline asm, and QEMU with GDB debugging.

    253 GitHub stars~1.8k tokensUpdated 3 mo ago
    Auto-check passed
  • x86-64 Assembly Reference

    mohitmishra786/low-level-dev-skills

    Explains x86-64 registers, the System V AMD64 calling convention, and how to read compiler-generated or inline assembly.

    253 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Bazel for C and C++

    mohitmishra786/low-level-dev-skills

    Guides your agent through Bazel for C/C++ projects: BUILD files, Bzlmod dependencies, toolchain registration, remote execution, dependency queries and sandbox debugging.

    253 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Binary Hardening

    mohitmishra786/low-level-dev-skills

    Binary hardening skill for security-hardened C/C++ builds. An agent skill from mohitmishra786/low-level-dev-skills.

    253 GitHub stars~2k tokensUpdated 3 mo ago
    Auto-check passed
  • Binutils

    mohitmishra786/low-level-dev-skills

    GNU binutils skill for binary manipulation and analysis. An agent skill from mohitmishra786/low-level-dev-skills.

    253 GitHub stars~1.2k tokensUpdated 3 mo ago
    Auto-check passed

Questions about Os Dev Scratch

What does Os Dev Scratch do?

OS development from scratch skill for bootloader through context switching. Os Dev Scratch is an agent skill from mohitmishra786/low-level-dev-skills. OS development from scratch skill for bootloader through context switching.

When should I use Os Dev Scratch?

Os Dev Scratch fits situations like: building a minimal x86-64 OS; setting up GDT/IDT/page tables; writing keyboard/serial drivers; using QEMU for kernel boot.

How do I install Os Dev Scratch in Claude Code?

Run `npx skills add mohitmishra786/low-level-dev-skills --skill os-dev-scratch -a claude-code`. Or copy the skill folder (skills/kernel/os-dev-scratch in mohitmishra786/low-level-dev-skills) into .claude/skills/os-dev-scratch in your project. Claude Code loads it when a task matches its description.

How do I install Os Dev Scratch in Codex?

Run `npx skills add mohitmishra786/low-level-dev-skills --skill os-dev-scratch -a codex`. Or copy the skill folder (skills/kernel/os-dev-scratch in mohitmishra786/low-level-dev-skills) into .agents/skills/os-dev-scratch in your project. Codex loads it when a task matches its description.

Can I use Os Dev Scratch in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mohitmishra786/low-level-dev-skills --skill os-dev-scratch -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/os-dev-scratch, .gemini/skills/os-dev-scratch, .github/skills/os-dev-scratch and .opencode/skills/os-dev-scratch in your project.

What does Os Dev Scratch need to run?

Going by SKILL.md and its folder, Os Dev Scratch needs the command-line tools its instructions call (brew, git and make).

Does Os Dev Scratch access the network?

SKILL.md names 1 domain. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Os Dev Scratch safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Os Dev Scratch use?

Os Dev Scratch is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Os Dev Scratch use?

About 1.7k tokens (SKILL.md is roughly 7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Os Dev Scratch?

Skills that share tags, products or a category with Os Dev Scratch: Implementing Ransomware Kill Switch Detection (mukul975/Anthropic-Cybersecurity-Skills, 34k stars), Wiki Switch (Ar9av/obsidian-wiki, 3.5k stars), Switch Persona (openakita/openakita, 2k stars) and Kermt Pretrain Scratch (NVIDIA/skills, 3.5k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Os Dev Scratch?

mohitmishra786 (a GitHub user) maintains it in mohitmishra786/low-level-dev-skills, which has 253 GitHub stars. The repository holds 138 skills in this directory. The repository was last updated on June 27, 2026.

Source: mohitmishra786/low-level-dev-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.