Previous: , Up: Specification   [Contents][Index]


3.6 Boot information

3.6.1 Boot information format

Upon entry to the operating system, the EBX register contains the physical address of a Multiboot2 information data structure, through which the boot loader communicates vital information to the operating system. The operating system can use or ignore any parts of the structure as it chooses; all information passed by the boot loader is advisory only.

The Multiboot2 information structure and its related substructures may be placed anywhere in memory by the boot loader (with the exception of the memory reserved for the kernel and boot modules, of course). It is the operating system’s responsibility to avoid overwriting this memory until it is done using it.

3.6.2 Basic tags structure

Boot information consists of fixed part and a series of tags. Its start is 8-bytes aligned. Fixed part is as following:

        +-------------------+
u32     | total_size        |
u32     | reserved          |
        +-------------------+

total_size’ contains the total size of boot information including this field and terminating tag in bytes

reserved’ is always set to zero and must be ignored by OS image

Every tag begins with following fields:

        +-------------------+
u32     | type              |
u32     | size              |
        +-------------------+

type’ contains an identifier of contents of the rest of the tag. ‘size’ contains the size of tag including header fields but not including padding. Tags follow one another padded when necessary in order for each tag to start at 8-bytes aligned address. Tags are terminated by a tag of type ‘0’ and size ‘8’.

3.6.3 Basic memory information

        +-------------------+
u32     | type = 4          |
u32     | size = 16         |
u32     | mem_lower         |
u32     | mem_upper         |
        +-------------------+

mem_lower’ and ‘mem_upper’ indicate the amount of lower and upper memory, respectively, in kilobytes. Lower memory starts at address 0, and upper memory starts at address 1 megabyte. The maximum possible value for lower memory is 640 kilobytes. The value returned for upper memory is maximally the address of the first upper memory hole minus 1 megabyte. It is not guaranteed to be this value.

This tag may not be provided by some boot loaders on EFI platforms if EFI boot services are enabled and available for the loaded image (EFI boot services not terminated tag exists in Multiboot2 information structure).

3.6.4 BIOS Boot device

        +-------------------+
u32     | type = 5          |
u32     | size = 20         |
u32     | biosdev           |
u32     | partition         |
u32     | sub_parition      |
        +-------------------+

This tag indicates which BIOS disk device the boot loader loaded the OS image from. If the OS image was not loaded from a BIOS disk, then this tag must not be present. The operating system may use this field as a hint for determining its own root device, but is not required to.

The ‘biosdev’ contains the BIOS drive number as understood by the BIOS INT 0x13 low-level disk interface: e.g. 0x00 for the first floppy disk or 0x80 for the first hard disk.

The three remaining bytes specify the boot partition. ‘partition’ specifies the top-level partition number, ‘sub_partition’ specifies a sub-partition in the top-level partition, etc. Partition numbers always start from zero. Unused partition bytes must be set to 0xFFFFFFFF. For example, if the disk is partitioned using a simple one-level DOS partitioning scheme, then ‘partition’ contains the DOS partition number, and ‘sub_partition’ if 0xFFFFFF. As another example, if a disk is partitioned first into DOS partitions, and then one of those DOS partitions is subdivided into several BSD partitions using BSD’s disklabel strategy, then ‘partition’ contains the DOS partition number and ‘sub_partition’ contains the BSD sub-partition within that DOS partition.

DOS extended partitions are indicated as partition numbers starting from 4 and increasing, rather than as nested sub-partitions, even though the underlying disk layout of extended partitions is hierarchical in nature. For example, if the boot loader boots from the second extended partition on a disk partitioned in conventional DOS style, then ‘partition’ will be 5, and ‘sub_partiton’ will be 0xFFFFFFFF.

3.6.5 Boot command line

        +-------------------+
u32     | type = 1          |
u32     | size              |
u8[n]   | string            |
        +-------------------+

string’ contains command line. The command line is a normal C-style zero-terminated UTF-8 string.

3.6.6 Modules

        +-------------------+
u32     | type = 3          |
u32     | size              |
u32     | mod_start         |
u32     | mod_end           |
u8[n]   | string            |   
        +-------------------+

This tag indicates to the kernel what boot module was loaded along with the kernel image, and where it can be found.

The ‘mod_start’ and ‘mod_end’ contain the start and end physical addresses of the boot module itself. The ‘string’ field provides an arbitrary string to be associated with that particular boot module; it is a zero-terminated UTF-8 string, just like the kernel command line. Typically the string might be a command line (e.g. if the operating system treats boot modules as executable programs), or a pathname (e.g. if the operating system treats boot modules as files in a file system), but its exact use is specific to the operating system.

One tag appears per module. This tag type may appear multiple times.

3.6.7 ELF-Symbols

        +-------------------+
u32     | type = 9          |
u32     | size              |
u16     | num               |
u16     | entsize           |
u16     | shndx             |
u16     | reserved          |
varies  | section headers   |
        +-------------------+

This tag contains section header table from an ELF kernel, the size of each entry, number of entries, and the string table used as the index of names. They correspond to the ‘shdr_*’ entries (‘shdr_num’, etc.) in the Executable and Linkable Format (ELF) specification in the program header. All sections are loaded, and the physical address fields of the ELF section header then refer to where the sections are in memory (refer to the i386 ELF documentation for details as to how to read the section header(s)).

3.6.8 Memory map

This tag provides memory map.

        +-------------------+
u32     | type = 6          |
u32     | size              |
u32     | entry_size        |
u32     | entry_version     |
varies  | entries           |
        +-------------------+

entry_size’ contains the size of one entry so that in future new fields may be added to it. It’s guaranteed to be a multiple of 8. ‘entry_version’ is currently set at ‘0’. Future versions will increment this field. Future version are guranteed to be backward compatible with older format. Each entry has the following structure:

        +-------------------+
u64     | base_addr         |
u64     | length            |
u32     | type              |
u32     | reserved          |
        +-------------------+

size’ contains the size of current entry including this field itself. It may be bigger than 24 bytes in future versions but is guaranteed to be ‘base_addr’ is the starting physical address. ‘length’ is the size of the memory region in bytes. ‘type’ is the variety of address range represented, where a value of 1 indicates available RAM, value of 3 indicates usable memory holding ACPI information, value of 4 indicates reserved memory which needs to be preserved on hibernation, value of 5 indicates a memory which is occupied by defective RAM modules and all other values currently indicated a reserved area. ‘reserved’ is set to ‘0’ by bootloader and must be ignored by the OS image.

The map provided is guaranteed to list all standard RAM that should be available for normal use. This type however includes the regions occupied by kernel, mbi, segments and modules. Kernel must take care not to overwrite these regions.

This tag may not be provided by some boot loaders on EFI platforms if EFI boot services are enabled and available for the loaded image (EFI boot services not terminated tag exists in Multiboot2 information structure).

3.6.9 Boot loader name

        +-------------------+
u32     | type = 2          |
u32     | size              |
u8[n]   | string            |
        +-------------------+

string’ contains the name of a boot loader booting the kernel. The name is a normal C-style UTF-8 zero-terminated string.

3.6.10 APM table

The tag type 10 contains APM table

        +----------------------+
u32     | type = 10            |
u32     | size = 28            |
u16     | version              |
u16     | cseg                 |
u32     | offset               |
u16     | cseg_16              |
u16     | dseg                 |
u16     | flags                |
u16     | cseg_len             |
u16     | cseg_16_len          |
u16     | dseg_len             |
        +----------------------+

The fields ‘version’, ‘cseg’, ‘offset’, ‘cseg_16’, ‘dseg’, ‘flags’, ‘cseg_len’, ‘cseg_16_len’, ‘dseg_len’ indicate the version number, the protected mode 32-bit code segment, the offset of the entry point, the protected mode 16-bit code segment, the protected mode 16-bit data segment, the flags, the length of the protected mode 32-bit code segment, the length of the protected mode 16-bit code segment, and the length of the protected mode 16-bit data segment, respectively. Only the field ‘offset’ is 4 bytes, and the others are 2 bytes. See Advanced Power Management (APM) BIOS Interface Specification, for more information.

3.6.11 VBE info

        +-------------------+
u32     | type = 7          |
u32     | size = 784        |
u16     | vbe_mode          |
u16     | vbe_interface_seg |
u16     | vbe_interface_off |
u16     | vbe_interface_len |
u8[512] | vbe_control_info  |
u8[256] | vbe_mode_info     |
        +-------------------+

The fields ‘vbe_control_info’ and ‘vbe_mode_info’ contain VBE control information returned by the VBE Function 00h and VBE mode information returned by the VBE Function 01h, respectively.

The field ‘vbe_mode’ indicates current video mode in the format specified in VBE 3.0.

The rest fields ‘vbe_interface_seg’, ‘vbe_interface_off’, and ‘vbe_interface_len’ contain the table of a protected mode interface defined in VBE 2.0+. If this information is not available, those fields contain zero. Note that VBE 3.0 defines another protected mode interface which is incompatible with the old one. If you want to use the new protected mode interface, you will have to find the table yourself.

3.6.12 Framebuffer info

        +--------------------+
u32     | type = 8           |
u32     | size               |
u64     | framebuffer_addr   |
u32     | framebuffer_pitch  |
u32     | framebuffer_width  |
u32     | framebuffer_height |
u8      | framebuffer_bpp    |
u8      | framebuffer_type   |
u8      | reserved           |
varies  | color_info         |
        +--------------------+

The field ‘framebuffer_addr’ contains framebuffer physical address. This field is 64-bit wide but bootloader should set it under 4GiB if possible for compatibility with payloads which aren’t aware of PAE or amd64. The field ‘framebuffer_pitch’ contains pitch in bytes. The fields ‘framebuffer_width’, ‘framebuffer_height’ contain framebuffer dimensions in pixels. The field ‘framebuffer_bpp’ contains number of bits per pixel. ‘reserved’ always contains 0 in current version of specification and must be ignored by OS image. If ‘framebuffer_type’ is set to 0 it means indexed color. In this case color_info is defined as follows:

        +----------------------------------+
u32     | framebuffer_palette_num_colors   |
varies  | framebuffer_palette              |
        +----------------------------------+

framebuffer_palette’ is an array of colour descriptors. Each colour descriptor has following structure:

        +-------------+
u8      | red_value   |
u8      | green_value |
u8      | blue_value  |
        +-------------+

If ‘framebuffer_type’ is set to ‘1’ it means direct RGB color. Then color_type is defined as follows:

       +----------------------------------+
u8     | framebuffer_red_field_position   |
u8     | framebuffer_red_mask_size        |
u8     | framebuffer_green_field_position |
u8     | framebuffer_green_mask_size      |
u8     | framebuffer_blue_field_position  |
u8     | framebuffer_blue_mask_size       |
       +----------------------------------+

If ‘framebuffer_type’ is set to ‘2’ it means EGA text. In this case ‘framebuffer_width’ and ‘framebuffer_height’ are expressed in characters and not in pixels. ‘framebuffer_bpp’ is equal 16 (16 bits per character) and ‘framebuffer_pitch’ is expressed in bytes per text line. All further values of ‘framebuffer_type’ are reserved for future expansion

3.6.13 EFI 32-bit system table pointer

        +-------------------+
u32     | type = 11         |
u32     | size = 12         |
u32     | pointer           |
        +-------------------+

This tag contains pointer to i386 EFI system table.

3.6.14 EFI 64-bit system table pointer

        +-------------------+
u32     | type = 12         |
u32     | size = 16         |
u64     | pointer           |
        +-------------------+

This tag contains pointer to amd64 EFI system table.

3.6.15 SMBIOS tables

        +-------------------+
u32     | type = 13         |
u32     | size              |
u8      | major             |
u8      | minor             |
u8[6]   | reserved          |
        | smbios tables     |
        +-------------------+

This tag contains a copy of SMBIOS tables as well as their version.

3.6.16 ACPI old RSDP

        +-------------------+
u32     | type = 14         |
u32     | size              |
        | copy of RSDPv1    |
        +-------------------+

This tag contains a copy of RSDP as defined per ACPI 1.0 specification.

3.6.17 ACPI new RSDP

        +-------------------+
u32     | type = 15         |
u32     | size              |
        | copy of RSDPv2    |
        +-------------------+

This tag contains a copy of RSDP as defined per ACPI 2.0 or later specification.

3.6.18 Networking information

        +-------------------+
u32     | type = 16         |
u32     | size              |
        | DHCP ACK          |
        +-------------------+

This tag contains network information in the format specified as DHCP. It may be either a real DHCP reply or just the configuration info in the same format. This tag appears once per card.

3.6.19 EFI memory map

        +-------------------+
u32     | type = 17         |
u32     | size              |
u32     | descriptor size   |
u32     | descriptor version|
        | EFI memory map    |
        +-------------------+

This tag contains EFI memory map as per EFI specification.

This tag may not be provided by some boot loaders on EFI platforms if EFI boot services are enabled and available for the loaded image (EFI boot services not terminated tag exists in Multiboot2 information structure).

3.6.20 EFI boot services not terminated

        +-------------------+
u32     | type = 18         |
u32     | size = 8          |
        +-------------------+

This tag indicates ExitBootServices wasn’t called

3.6.21 EFI 32-bit image handle pointer

        +-------------------+
u32     | type = 19         |
u32     | size = 12         |
u32     | pointer           |
        +-------------------+

This tag contains pointer to EFI i386 image handle. Usually it is boot loader image handle.

3.6.22 EFI 64-bit image handle pointer

        +-------------------+
u32     | type = 20         |
u32     | size = 16         |
u64     | pointer           |
        +-------------------+

This tag contains pointer to EFI amd64 image handle. Usually it is boot loader image handle.

3.6.23 Image load base physical address

        +-------------------+
u32     | type = 21         |
u32     | size = 12         |
u32     | load_base_addr    |
        +-------------------+

This tag contains image load base physical address. It is provided only if image has relocatable header tag.


Previous: , Up: Specification   [Contents][Index]