mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:18:12 +00:00
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>
This commit is contained in:
parent
357ddd393e
commit
7e94b090fe
30 changed files with 1207 additions and 181 deletions
|
@ -43,16 +43,17 @@ constexpr FlatPtr page_round_down(FlatPtr x)
|
|||
|
||||
inline FlatPtr low_physical_to_virtual(FlatPtr physical)
|
||||
{
|
||||
return physical + KERNEL_BASE;
|
||||
return physical + kernel_base;
|
||||
}
|
||||
|
||||
inline FlatPtr virtual_to_low_physical(FlatPtr virtual_)
|
||||
{
|
||||
return virtual_ - KERNEL_BASE;
|
||||
return virtual_ - kernel_base;
|
||||
}
|
||||
|
||||
enum class UsedMemoryRangeType {
|
||||
LowMemory = 0,
|
||||
Bootloader,
|
||||
Kernel,
|
||||
BootModule,
|
||||
PhysicalPages,
|
||||
|
@ -60,6 +61,7 @@ enum class UsedMemoryRangeType {
|
|||
|
||||
static constexpr StringView UserMemoryRangeTypeNames[] {
|
||||
"Low memory",
|
||||
"Bootloader",
|
||||
"Kernel",
|
||||
"Boot module",
|
||||
"Physical Pages"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue