diff options
author | Andreas Kling <awesomekling@gmail.com> | 2020-01-17 19:59:20 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2020-01-17 22:34:26 +0100 |
commit | e362b56b4fd73db86eb8bf62baa8963eec0a967b (patch) | |
tree | 38ff10b38b7a8f843c436b629cc8184b2e5f0287 /Kernel/VM/PageDirectory.h | |
parent | cee597a728c89c0d7217a646aea84b14b534e200 (diff) | |
download | serenity-e362b56b4fd73db86eb8bf62baa8963eec0a967b.zip |
Kernel: Move kernel above the 3GB virtual address mark
The kernel and its static data structures are no longer identity-mapped
in the bottom 8MB of the address space, but instead move above 3GB.
The first 8MB above 3GB are pseudo-identity-mapped to the bottom 8MB of
the physical address space. But things don't have to stay this way!
Thanks to Jesse who made an earlier attempt at this, it was really easy
to get device drivers working once the page tables were in place! :^)
Fixes #734.
Diffstat (limited to 'Kernel/VM/PageDirectory.h')
-rw-r--r-- | Kernel/VM/PageDirectory.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Kernel/VM/PageDirectory.h b/Kernel/VM/PageDirectory.h index 53b4d5d410..6cdf990930 100644 --- a/Kernel/VM/PageDirectory.h +++ b/Kernel/VM/PageDirectory.h @@ -16,13 +16,13 @@ public: { return adopt(*new PageDirectory(process, parent_range_allocator)); } - static NonnullRefPtr<PageDirectory> create_at_fixed_address(PhysicalAddress paddr) { return adopt(*new PageDirectory(paddr)); } + static NonnullRefPtr<PageDirectory> create_kernel_page_directory() { return adopt(*new PageDirectory); } static RefPtr<PageDirectory> find_by_cr3(u32); ~PageDirectory(); u32 cr3() const { return m_directory_table->paddr().get(); } - PageDirectoryPointerTable& table() { return *reinterpret_cast<PageDirectoryPointerTable*>(cr3()); } + PageDirectoryPointerTable& table() { return *reinterpret_cast<PageDirectoryPointerTable*>(0xc0000000 + cr3()); } RangeAllocator& range_allocator() { return m_range_allocator; } @@ -31,7 +31,7 @@ public: private: PageDirectory(Process&, const RangeAllocator* parent_range_allocator); - explicit PageDirectory(PhysicalAddress); + PageDirectory(); Process* m_process { nullptr }; RangeAllocator m_range_allocator; |