mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:37:34 +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:
parent
c4887882cc
commit
3c616ae00f
5 changed files with 7 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue