1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:18:11 +00:00
serenity/Kernel/Prekernel/BootInfo.h
Gunnar Beutner 7e94b090fe Kernel: Introduce basic pre-kernel environment
This implements a simple bootloader that is capable of loading ELF64
kernel images. It does this by using QEMU/GRUB to load the kernel image
from disk and pass it to our bootloader as a Multiboot module.

The bootloader then parses the ELF image and sets it up appropriately.
The kernel's entry point is a C++ function with architecture-native
code.

Co-authored-by: Liav A <liavalb@gmail.com>
2021-07-18 17:31:13 +02:00

30 lines
614 B
C++

/*
* 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;
};
}