1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:47:45 +00:00

Kernel: Make the kernel independent from specific physical addresses

Previously the kernel relied on a fixed offset between virtual and
physical addresses based on the kernel's load address. This allows us
to specify an independent offset.
This commit is contained in:
Gunnar Beutner 2021-07-22 13:05:04 +02:00 committed by Andreas Kling
parent c4887882cc
commit 3c616ae00f
5 changed files with 7 additions and 2 deletions

View file

@ -43,12 +43,12 @@ constexpr FlatPtr page_round_down(FlatPtr x)
inline FlatPtr low_physical_to_virtual(FlatPtr physical)
{
return physical + kernel_base;
return physical + physical_to_virtual_offset;
}
inline FlatPtr virtual_to_low_physical(FlatPtr virtual_)
{
return virtual_ - kernel_base;
return virtual_ - physical_to_virtual_offset;
}
enum class UsedMemoryRangeType {