Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Limine Protocol

This document describes the Limine v3 boot protocol interface used by the Kyronix kernel. It is the child of Boot.

Overview

The Kyronix kernel uses the Limine v3 boot protocol to obtain boot-time information from the bootloader. The protocol uses a request/response mechanism where the kernel declares requests in a special ELF section (.limine_requests), and the bootloader populates the response fields before jumping to the kernel entry point.

Request Types

RequestStructurePurpose
LIMINE_FRAMEBUFFER_REQUESTlimine_framebuffer_responseLinear framebuffer information
LIMINE_MEMMAP_REQUESTlimine_memmap_responsePhysical memory map
LIMINE_HHDM_REQUESTlimine_hhdm_responseHigher Half Direct Map offset
LIMINE_MODULE_REQUESTlimine_module_responseBootloader modules (initrd)
LIMINE_KERNEL_ADDRESS_REQUESTlimine_kernel_address_responseKernel physical/virtual addresses
LIMINE_RSDP_REQUESTlimine_rsdp_responseACPI RSDP physical address
LIMINE_SMP_REQUESTlimine_smp_responseSMP CPU information

Memory Map Types

TypeValueDescription
LIMINE_MEMMAP_USABLE0Available for kernel use
LIMINE_MEMMAP_RESERVED1Reserved by hardware/firmware
LIMINE_MEMMAP_ACPI_RECLAIMABLE2Usable after ACPI parsing
LIMINE_MEMMAP_ACPI_NVS3ACPI NVS memory (must not reclaim)
LIMINE_MEMMAP_BAD_MEMORY4Defective memory region
LIMINE_MEMMAP_BOOTLOADER_RECLAIMABLE5Usable after bootloader exits
LIMINE_MEMMAP_KERNEL_AND_MODULES6Kernel and module images
LIMINE_MEMMAP_FRAMEBUFFER7Linear framebuffer memory

HHDM Response

The limine_hhdm_response provides the offset field, which is the base address of the Higher Half Direct Map. All physical addresses can be converted to virtual via phys_to_virt(phys) = phys + g_hhdm_offset.

Kernel Address Response

The limine_kernel_address_response provides physical_base and virtual_base, used to compute the physical end of the kernel image for PMM initialization.

Module Response

The limine_module_response provides an array of limine_file structures. Kyronix uses the first module as the initrd (CPIO archive).

SMP Response

The limine_smp_response provides cpu_count and an array of limine_smp_info structures. Each entry contains processor_id, lapic_id, and goto_address (trampoline entry point for APs).

Request Declaration

Requests are declared as static volatile structures bracketed by LIMINE_REQUESTS_START_MARKER and LIMINE_REQUESTS_END_MARKER. The base revision is set via LIMINE_BASE_REVISION(3).

LIMINE_REQUESTS_START_MARKER;

LIMINE_BASE_REVISION(3);

static volatile struct limine_memmap_request mmap_req = {
    .id = LIMINE_MEMMAP_REQUEST,
    .revision = 0,
    .response = NULL,
};

LIMINE_REQUESTS_END_MARKER;

IMPORTANT: The response field must be initialized to NULL. The bootloader sets it to a valid pointer if the request is fulfilled.

Last reviewed: 2026-07-22