Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
multiboot.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 Intel Corporation
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_ARCH_X86_MULTIBOOT_H_
8#define ZEPHYR_INCLUDE_ARCH_X86_MULTIBOOT_H_
9
10#ifndef _ASMLANGUAGE
11
12/*
13 * Multiboot (version 1) boot information structure.
14 *
15 * Only fields/values of interest to Zephyr are enumerated: at
16 * present, that means only those pertaining to the framebuffer.
17 */
18
35};
36
37extern struct multiboot_info multiboot_info;
38
39extern void z_multiboot_init(struct multiboot_info *info_pa);
40
41/*
42 * the mmap_addr field points to a series of entries of the following form.
43 */
44
50} __packed;
51
52#endif /* _ASMLANGUAGE */
53
54/*
55 * Possible values for multiboot_mmap.type field.
56 * Other values should be assumed to be unusable ranges.
57 */
58
59#define MULTIBOOT_MMAP_RAM 1 /* available RAM */
60#define MULTIBOOT_MMAP_ACPI 3 /* reserved for ACPI */
61#define MULTIBOOT_MMAP_NVS 4 /* ACPI non-volatile */
62#define MULTIBOOT_MMAP_DEFECTIVE 5 /* defective RAM module */
63
64/*
65 * Magic numbers: the kernel multiboot header (see crt0.S) begins with
66 * MULTIBOOT_HEADER_MAGIC to signal to the booter that it supports
67 * multiboot. On kernel entry, EAX is set to MULTIBOOT_EAX_MAGIC to
68 * signal that the boot loader is multiboot compliant.
69 */
70
71#define MULTIBOOT_HEADER_MAGIC 0x1BADB002
72#define MULTIBOOT_EAX_MAGIC 0x2BADB002
73
74/*
75 * Typically, we put no flags in the multiboot header, as it exists solely
76 * to reassure the loader that we're a valid binary. The exception to this
77 * is when we want the loader to configure the framebuffer for us.
78 */
79
80#define MULTIBOOT_HEADER_FLAG_MEM BIT(1) /* want mem_/mmap_* info */
81#define MULTIBOOT_HEADER_FLAG_FB BIT(2) /* want fb_* info */
82
83#ifdef CONFIG_MULTIBOOT_FRAMEBUF
84#define MULTIBOOT_HEADER_FLAGS \
85 (MULTIBOOT_HEADER_FLAG_FB | MULTIBOOT_HEADER_FLAG_MEM)
86#else
87#define MULTIBOOT_HEADER_FLAGS MULTIBOOT_HEADER_FLAG_MEM
88#endif
89
90/* The flags in the boot info structure tell us which fields are valid. */
91
92#define MULTIBOOT_INFO_FLAGS_MEM (1 << 0) /* mem_* valid */
93#define MULTIBOOT_INFO_FLAGS_MMAP (1 << 6) /* mmap_* valid */
94#define MULTIBOOT_INFO_FLAGS_FB (1 << 12) /* fb_* valid */
95
96/* The only fb_type we support is RGB. No text modes and no color palettes. */
97
98#define MULTIBOOT_INFO_FB_TYPE_RGB 1
99
100#endif /* ZEPHYR_INCLUDE_ARCH_X86_MULTIBOOT_H_ */
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__UINT64_TYPE__ uint64_t
Definition: stdint.h:61
__UINT8_TYPE__ uint8_t
Definition: stdint.h:58
Definition: multiboot.h:19
uint8_t fb_bpp
Definition: multiboot.h:32
uint32_t fb_pitch
Definition: multiboot.h:29
uint32_t fb_height
Definition: multiboot.h:31
uint8_t fb_type
Definition: multiboot.h:33
uint32_t flags
Definition: multiboot.h:20
uint32_t fb_addr_lo
Definition: multiboot.h:27
uint32_t fb_addr_hi
Definition: multiboot.h:28
uint32_t unused1[9]
Definition: multiboot.h:26
uint32_t mmap_length
Definition: multiboot.h:24
uint32_t unused0[8]
Definition: multiboot.h:23
uint8_t fb_color_info[6]
Definition: multiboot.h:34
uint32_t mem_lower
Definition: multiboot.h:21
uint32_t mem_upper
Definition: multiboot.h:22
uint32_t fb_width
Definition: multiboot.h:30
uint32_t mmap_addr
Definition: multiboot.h:25
Definition: multiboot.h:45
uint32_t type
Definition: multiboot.h:49
uint64_t length
Definition: multiboot.h:48
uint64_t base
Definition: multiboot.h:47
uint32_t size
Definition: multiboot.h:46