The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
multiboot2.c File Reference
#include "multiboot2.h"
#include "common/memory.h"
#include "kernel/memory/phys.h"

Macros

#define TAG_END   0
 read the multiboot 2 boot information (the multiboot 2 specification, section 3.6) into a boot_info_t.
#define TAG_CMDLINE   1
#define TAG_MODULE   3
#define TAG_MMAP   6
#define TAG_FRAMEBUFFER   8
#define TAG_ACPI_OLD   14
#define TAG_ACPI_NEW   15
#define FB_TYPE_RGB   1
#define INFO_MAX_SIZE   (1024u * 1024u)
#define CMDLINE_MAX   256

Functions

bool multiboot2_read (uintptr_t info_phys, boot_info_t *boot)
 read the multiboot 2 information into a boot_info_t.

Macro Definition Documentation

◆ TAG_END

#define TAG_END   0

read the multiboot 2 boot information (the multiboot 2 specification, section 3.6) into a boot_info_t.

the information starts with its total size and a reserved word. tags follow, each aligned to 8 bytes, each with a type and a size. tag type 0 is the last tag. the tag fields are read with memcpy, because the kernel must not assume their alignment.

◆ TAG_CMDLINE

#define TAG_CMDLINE   1

◆ TAG_MODULE

#define TAG_MODULE   3

◆ TAG_MMAP

#define TAG_MMAP   6

◆ TAG_FRAMEBUFFER

#define TAG_FRAMEBUFFER   8

◆ TAG_ACPI_OLD

#define TAG_ACPI_OLD   14

◆ TAG_ACPI_NEW

#define TAG_ACPI_NEW   15

◆ FB_TYPE_RGB

#define FB_TYPE_RGB   1

◆ INFO_MAX_SIZE

#define INFO_MAX_SIZE   (1024u * 1024u)

◆ CMDLINE_MAX

#define CMDLINE_MAX   256

Function Documentation

◆ multiboot2_read()

bool multiboot2_read ( uintptr_t info_phys,
boot_info_t * boot )

read the multiboot 2 information into a boot_info_t.

fields without a tag stay zero. the command line is copied into kernel memory.

Parameters
info_physthe physical address the bootloader gave in EBX.
bootthe boot_info_t to fill in (zeroed by the caller).
Returns
false if the information is not in the direct map or is not valid.