Serenity Operating System
1/*
2 * Copyright (c) 2021, Gunnar Beutner <gbeutner@serenityos.org>
3 *
4 * SPDX-License-Identifier: BSD-2-Clause
5 */
6
7#pragma once
8
9#ifdef __cplusplus
10# include <Kernel/Multiboot.h>
11# include <Kernel/PhysicalAddress.h>
12# include <Kernel/VirtualAddress.h>
13#endif
14
15#define MAX_KERNEL_SIZE 0x4000000
16#define KERNEL_PD_SIZE 0x31000000
17
18// FIXME: This should be using the define from Sections.h, but that currently is not possible
19// and causes linker errors, because Sections.h includes BootInfo.h.
20#define KERNEL_MAPPING_BASE 0x2000000000
21
22#ifdef __cplusplus
23namespace Kernel {
24
25struct [[gnu::packed]] BootInfo {
26 u32 start_of_prekernel_image;
27 u32 end_of_prekernel_image;
28 u64 physical_to_virtual_offset;
29 u64 kernel_mapping_base;
30 u64 kernel_load_base;
31# if ARCH(X86_64)
32 u32 gdt64ptr;
33 u16 code64_sel;
34 u32 boot_pml4t;
35# endif
36 u32 boot_pdpt;
37 u32 boot_pd0;
38 u32 boot_pd_kernel;
39 u64 boot_pd_kernel_pt1023;
40 u64 kernel_cmdline;
41 u32 multiboot_flags;
42 u64 multiboot_memory_map;
43 u32 multiboot_memory_map_count;
44 u64 multiboot_modules;
45 u32 multiboot_modules_count;
46 u64 multiboot_framebuffer_addr;
47 u32 multiboot_framebuffer_pitch;
48 u32 multiboot_framebuffer_width;
49 u32 multiboot_framebuffer_height;
50 u8 multiboot_framebuffer_bpp;
51 u8 multiboot_framebuffer_type;
52};
53}
54#endif