wire / wire-format / multiboot-header

Multiboot header (bootloader protocol)

The Multiboot specification defines a header that bootloaders (GRUB, etc.) look for in the first 8KB of a kernel image. Header: magic (0x1BADB002), flags (32 bits), checksum (32 bits, magic + flags + checksum = 0). Optional fields depending on flags: header_addr, load_addr, load_end_addr, bss_end_addr, entry_addr. Multiboot2 uses magic 0xE85250D6.

wire-format kind wire-format status standard verification verified tier B wire-format@1

aka: Multiboot header (bootloader protocol)

wire format

spec: Multiboot specification (GNU)

The Multiboot specification defines a header that bootloaders (GRUB, etc.) look for in the first 8KB of a kernel image. Header: magic (0x1BADB002), flags (32 bits), checksum (32 bits, magic + flags + checksum = 0). Optional fields depending on flags: header_addr, load_addr, load_end_addr, bss_end_addr, entry_addr. Multiboot2 uses magic 0xE85250D6.

fieldsizemeaning
Magic4 bytes0x1BADB002 (Multiboot 1) or 0xE85250D6 (Multiboot 2).
Flags4 bytesBit 0: page align, bit 1: memory info, bit 2: video mode, bit 16: address fields present.
Checksum4 bytesmagic + flags + checksum = 0 (mod 2^32).
Header address4 bytes (optional)Physical address of the multiboot header (if flags bit 16 set).
Load address4 bytes (optional)Physical address to load the kernel.
Load end address4 bytes (optional)End of the loaded data.
BSS end address4 bytes (optional)End of BSS (uninitialized data). Kernel zeros this region.
Entry address4 bytes (optional)Entry point of the kernel (EIP to jump to).
Mode type4 bytes (Multiboot 2)0 = protected mode (32-bit), 1 = long mode (64-bit).

example:

02 b0 ad 1b 03 00 00 00 fb 4f 54 e4

Multiboot 1 header: magic 0x1BADB002, flags 3, checksum


provenance

agent: curl -H 'accept: application/json' wire.phall.io/wire-format/multiboot-header or /wire-format/multiboot-header.json