Zephyr Project API  3.1.0
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
39#ifdef CONFIG_MULTIBOOT_INFO
40
41extern void z_multiboot_init(struct multiboot_info *info_pa);
42
43#else
44
45inline void z_multiboot_init(struct multiboot_info *info_pa)
46{
47 ARG_UNUSED(info_pa);
48}
49
50#endif /* CONFIG_MULTIBOOT_INFO */
51
52/*
53 * the mmap_addr field points to a series of entries of the following form.
54 */
55
61} __packed;
62
63#endif /* _ASMLANGUAGE */
64
65/* Boot type value (see prep_c.c) */
66#define MULTIBOOT_BOOT_TYPE 1
67
68/*
69 * Possible values for multiboot_mmap.type field.
70 * Other values should be assumed to be unusable ranges.
71 */
72
73#define MULTIBOOT_MMAP_RAM 1 /* available RAM */
74#define MULTIBOOT_MMAP_ACPI 3 /* reserved for ACPI */
75#define MULTIBOOT_MMAP_NVS 4 /* ACPI non-volatile */
76#define MULTIBOOT_MMAP_DEFECTIVE 5 /* defective RAM module */
77
78/*
79 * Magic numbers: the kernel multiboot header (see crt0.S) begins with
80 * MULTIBOOT_HEADER_MAGIC to signal to the booter that it supports
81 * multiboot. On kernel entry, EAX is set to MULTIBOOT_EAX_MAGIC to
82 * signal that the boot loader is multiboot compliant.
83 */
84
85#define MULTIBOOT_HEADER_MAGIC 0x1BADB002
86#define MULTIBOOT_EAX_MAGIC 0x2BADB002
87
88/*
89 * Typically, we put no flags in the multiboot header, as it exists solely
90 * to reassure the loader that we're a valid binary. The exception to this
91 * is when we want the loader to configure the framebuffer for us.
92 */
93
94#define MULTIBOOT_HEADER_FLAG_MEM BIT(1) /* want mem_/mmap_* info */
95#define MULTIBOOT_HEADER_FLAG_FB BIT(2) /* want fb_* info */
96
97#ifdef CONFIG_MULTIBOOT_FRAMEBUF
98#define MULTIBOOT_HEADER_FLAGS \
99 (MULTIBOOT_HEADER_FLAG_FB | MULTIBOOT_HEADER_FLAG_MEM)
100#else
101#define MULTIBOOT_HEADER_FLAGS MULTIBOOT_HEADER_FLAG_MEM
102#endif
103
104/* The flags in the boot info structure tell us which fields are valid. */
105
106#define MULTIBOOT_INFO_FLAGS_MEM (1 << 0) /* mem_* valid */
107#define MULTIBOOT_INFO_FLAGS_MMAP (1 << 6) /* mmap_* valid */
108#define MULTIBOOT_INFO_FLAGS_FB (1 << 12) /* fb_* valid */
109
110/* The only fb_type we support is RGB. No text modes and no color palettes. */
111
112#define MULTIBOOT_INFO_FB_TYPE_RGB 1
113
114#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: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:56
uint32_t type
Definition: multiboot.h:60
uint64_t length
Definition: multiboot.h:59
uint64_t base
Definition: multiboot.h:58
uint32_t size
Definition: multiboot.h:57