1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 20:57:44 +00:00

Kernel: Move boot info declarations to a header file

Instead of manually redeclaring those variables in various files this
now adds a header file for them.
This commit is contained in:
Gunnar Beutner 2021-07-19 17:54:51 +02:00 committed by Andreas Kling
parent b4600f2996
commit dd42093b93
8 changed files with 53 additions and 51 deletions

View file

@ -1,30 +0,0 @@
/*
* Copyright (c) 2021, Gunnar Beutner <gbeutner@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Platform.h>
#include <Kernel/Multiboot.h>
namespace Kernel {
struct [[gnu::packed]] BootInfo {
u8 const* start_of_prekernel_image;
u8 const* end_of_prekernel_image;
FlatPtr kernel_base;
multiboot_info* multiboot_info_ptr;
#if ARCH(X86_64)
u32 gdt64ptr;
u16 code64_sel;
FlatPtr boot_pml4t;
#endif
FlatPtr boot_pdpt;
FlatPtr boot_pd0;
FlatPtr boot_pd_kernel;
FlatPtr boot_pd_kernel_pt1023;
char const* kernel_cmdline;
};
}

View file

@ -6,4 +6,30 @@
#pragma once
#ifdef __cplusplus
# include <Kernel/Multiboot.h>
#endif
#define MAX_KERNEL_SIZE 0x3000000
#ifdef __cplusplus
namespace Kernel {
struct [[gnu::packed]] BootInfo {
u8 const* start_of_prekernel_image;
u8 const* end_of_prekernel_image;
FlatPtr kernel_base;
multiboot_info* multiboot_info_ptr;
# if ARCH(X86_64)
u32 gdt64ptr;
u16 code64_sel;
FlatPtr boot_pml4t;
# endif
FlatPtr boot_pdpt;
FlatPtr boot_pd0;
FlatPtr boot_pd_kernel;
FlatPtr boot_pd_kernel_pt1023;
char const* kernel_cmdline;
};
}
#endif

View file

@ -8,7 +8,6 @@
#include <AK/Types.h>
#include <Kernel/Multiboot.h>
#include <Kernel/Prekernel/BootInfo.h>
#include <Kernel/Prekernel/Prekernel.h>
#include <Kernel/VirtualAddress.h>
#include <LibC/elf.h>