1 /*
2  * SPDX-License-Identifier: Apache-2.0
3  * Copyright (c) 2019 Intel Corp.
4  */
5 
6 #include <zephyr/kernel.h>
7 #include <zephyr/arch/x86/multiboot.h>
8 
multiboot(void)9 void multiboot(void)
10 {
11 #ifndef CONFIG_MULTIBOOT_INFO
12 	printk("MULTIBOOT: info struct NOT preserved.\n\n");
13 #else
14 	/*
15 	 * If flags == 0, then either we didn't copy the flags from a real
16 	 * multiboot info struct because the loader didn't provide one, or
17 	 * (highly unlikely) we DID get a valid struct, but it was empty.
18 	 */
19 
20 	if (!multiboot_info.flags) {
21 		printk("MULTIBOOT: info struct UNAVAILABLE or EMPTY.\n\n");
22 	} else {
23 		printk("MULTIBOOT: boot info structure available.\n");
24 		printk("\tFlags = 0x%08x\n", multiboot_info.flags);
25 	}
26 
27 	if (multiboot_info.flags & MULTIBOOT_INFO_FLAGS_MEM) {
28 		printk("\tBasic memory map: lower = %dK, upper = %dK.\n",
29 			multiboot_info.mem_lower,
30 			multiboot_info.mem_upper);
31 	} else {
32 		printk("\tNo basic memory map available.\n");
33 	}
34 
35 	if (multiboot_info.flags & MULTIBOOT_INFO_FLAGS_MMAP) {
36 		printk("\tExtended memory map was at 0x%08x (%d bytes).\n",
37 			multiboot_info.mmap_addr,
38 			multiboot_info.mmap_length);
39 	} else {
40 		printk("\tNo extended memory map available.\n");
41 	}
42 
43 	if (multiboot_info.flags & MULTIBOOT_INFO_FLAGS_FB) {
44 		printk("\tFramebuffer %dbpp %dX%d (pitch %d) @ %08x.\n",
45 			multiboot_info.fb_bpp,
46 			multiboot_info.fb_width,
47 			multiboot_info.fb_height,
48 			multiboot_info.fb_pitch,
49 			multiboot_info.fb_addr_lo);
50 	} else {
51 		printk("\tFramebuffer data not present.\n");
52 	}
53 #endif
54 	printk("\n");
55 }
56