osdev-toolchain

Set up cross-compilation toolchains and debug bare-metal kernels with QEMU and GDB.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/Maelwalser/claude-config --skill osdev-toolchain
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: osdev-toolchain
Source: https://github.com/Maelwalser/claude-config/tree/main/skills/osdev-toolchain
Command: npx skills add https://github.com/Maelwalser/claude-config --skill osdev-toolchain

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill removes the uncertainty and friction of bare-metal OS development by documenting how to build and use cross-compilers, author linker scripts, integrate assembly and C, and debug kernel images with emulators so developers avoid host-tool mismatches and linking/runtime errors.

Core Features & Use Cases

  • Cross-compiler build and verification: step-by-step instructions to build binutils, GCC (or use Clang), and optional GDB for common targets like i686-elf, x86_64-elf, arm-none-eabi, aarch64-none-elf, and riscv64-unknown-elf.
  • Linker script and symbol guidance: templates and annotated examples for 32-bit, 64-bit higher-half, and embedded MEMORY layouts plus guidance on VMA vs LMA and KEEP usage.
  • Assembly and build system patterns: NASM vs GAS differences, calling conventions, Makefile templates for out-of-tree builds, and ISO/ISO+QEMU workflows for building and running kernels.
  • Emulator debugging workflows: QEMU flags, GDB remote workflows, .gdbinit suggestions, and Bochs vs QEMU tradeoffs for deep x86 debugging.
  • Use Case: Prepare a freestanding kernel project, build a cross-toolchain, link with a custom linker script, and debug kernel entry and paging issues in QEMU with a GDB connection.

Quick Start

Use the osdev-toolchain guide to build an i686-elf cross-compiler, produce a kernel.elf with the provided Makefile template, and launch it in QEMU for interactive debugging.

Frequently Asked Questions about osdev-toolchain

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a cross-compiler for i686-elf or x86_64 bare-metal kernel development?

Build a bare-metal cross-compiler by configuring binutils and GCC with a target triple like i686-elf or x86_64-elf. This generates a freestanding toolchain that avoids host-system linking mismatches when compiling kernel images.

What's the best way to debug a freestanding kernel image using QEMU and GDB?

Debug a freestanding kernel by launching the image in QEMU with specific debugging flags and connecting GDB remotely. This workflow enables interactive inspection of kernel entry points, paging structures, and early boot execution.

How do I write a linker script for a higher-half x86_64 kernel?

Write a higher-half linker script by defining MEMORY layouts and managing VMA versus LMA addresses. This ensures the kernel loads and executes correctly at its intended virtual memory address rather than the physical load location.

Do I need a custom Makefile to integrate NASM assembly with C in an OS project?

Integrating NASM assembly with C requires a custom Makefile to handle NASM vs GAS syntax differences and calling conventions. This orchestrates out-of-tree builds and produces a combined kernel ELF image.

Why does my bare-metal kernel link against host system libraries instead of freestanding code?

Bare-metal kernels link against host libraries when using the system compiler instead of a cross-compiler. Building a dedicated freestanding toolchain with a target triple like arm-none-eabi isolates kernel dependencies and resolves linking errors.

When should I use Bochs instead of QEMU for x86 kernel debugging?

Use Bochs instead of QEMU for x86 kernel debugging when you need deeper hardware-level emulation accuracy. Bochs provides tradeoffs favoring strict x86 instruction debugging, while QEMU offers faster execution and broader architecture support like ARM and RISC-V.