osdev-memory-management

Implements physical/virtual memory allocators for OS kernels, including bitmap, buddy, slab, kmalloc/kfree, and memory map parsing.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a complete reference and practical guidance for implementing physical and virtual memory allocation in OS kernels, eliminating common pitfalls like allocating reserved regions, fragmentation, and incorrect alignment.

Core Features & Use Cases

  • Memory map parsing: how to parse Multiboot and UEFI memory maps and mark usable versus reserved regions.
  • Physical frame allocators: implementations and trade-offs for bitmap, stack, and buddy allocators with hinting and region marking strategies.
  • Kernel heap designs: slab allocator internals, size-class bins for kmalloc/kfree, and coalescing strategies for general-purpose heaps.
  • Use Case: implement a 4KB-aligned physical frame allocator, add a slab-backed cache for frequent kernel objects, and provide a kmalloc/kfree front-end for variable-size kernel allocations.

Quick Start

Use the osdev-memory-management skill to design a bitmap-based physical frame allocator and a slab-backed kernel heap for a hobby kernel.

Frequently Asked Questions about osdev-memory-management

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

FAQPage Schema
How do I implement a page-aligned physical frame allocator for an OS kernel?▼

To implement a page-aligned physical frame allocator, you can use a bitmap, stack, or buddy system to track 4KB-aligned frames and ensure contiguous allocation for DMA while marking usable versus reserved regions.

What is the best way to parse Multiboot and UEFI memory maps in kernel development?▼

Parsing Multiboot and UEFI memory maps involves reading firmware-provided structures to distinguish usable RAM from reserved regions, preventing the kernel from allocating reserved memory and avoiding fragmentation issues.

How does a slab allocator work for a kernel heap?▼

A slab allocator manages a kernel heap by using size-class bins and dedicated slab caches for frequent fixed-size kernel objects, providing efficient kmalloc and kfree operations with coalescing strategies for variable-size allocations.

What are the trade-offs between bitmap, stack, and buddy allocators for physical memory management?▼

Bitmap allocators offer simplicity, stack allocators provide fast LIFO allocation, and buddy allocators enable efficient coalescing of contiguous blocks, with each requiring different metadata and hinting strategies for frame management.

When do I need contiguous allocation and safety checks in a kernel memory allocator?▼

Contiguous allocation and safety checks are required for DMA operations and page-aligned frame management, ensuring that allocation metadata verifies alignment and prevents overlapping or reserved region access.