wire / wire-format / multiboot-header
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.
aka: Multiboot header (bootloader protocol)
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.
| field | size | meaning |
|---|---|---|
| Magic | 4 bytes | 0x1BADB002 (Multiboot 1) or 0xE85250D6 (Multiboot 2). |
| Flags | 4 bytes | Bit 0: page align, bit 1: memory info, bit 2: video mode, bit 16: address fields present. |
| Checksum | 4 bytes | magic + flags + checksum = 0 (mod 2^32). |
| Header address | 4 bytes (optional) | Physical address of the multiboot header (if flags bit 16 set). |
| Load address | 4 bytes (optional) | Physical address to load the kernel. |
| Load end address | 4 bytes (optional) | End of the loaded data. |
| BSS end address | 4 bytes (optional) | End of BSS (uninitialized data). Kernel zeros this region. |
| Entry address | 4 bytes (optional) | Entry point of the kernel (EIP to jump to). |
| Mode type | 4 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
agent: curl -H 'accept: application/json' wire.phall.io/wire-format/multiboot-header
or /wire-format/multiboot-header.json