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