aboutsummaryrefslogtreecommitdiff
path: root/arch/x86_64/include
diff options
context:
space:
mode:
authorFabian Imhof <fabian.imhof@ost.ch>2024-10-22 08:58:48 +0000
committerFabian Imhof <fabian.imhof@ost.ch>2024-10-22 08:58:48 +0000
commitc29d8c3b65f63bfd54031412d9c2975ef7571460 (patch)
treec43af699c5f0ccb0e448f6101c6d702be372e1a9 /arch/x86_64/include
parent9a1f3e66b6c860fdca689241e78f85bdbb5b4da5 (diff)
downloadteachos-c29d8c3b65f63bfd54031412d9c2975ef7571460.tar.xz
teachos-c29d8c3b65f63bfd54031412d9c2975ef7571460.zip
use actual page_table address
Diffstat (limited to 'arch/x86_64/include')
-rw-r--r--arch/x86_64/include/arch/boot/pointers.hpp3
-rw-r--r--arch/x86_64/include/arch/memory/paging/page_entry.hpp4
-rw-r--r--arch/x86_64/include/arch/memory/paging/page_mapper.hpp2
-rw-r--r--arch/x86_64/include/arch/memory/paging/page_table.hpp2
4 files changed, 7 insertions, 4 deletions
diff --git a/arch/x86_64/include/arch/boot/pointers.hpp b/arch/x86_64/include/arch/boot/pointers.hpp
index 25800f4..37840b6 100644
--- a/arch/x86_64/include/arch/boot/pointers.hpp
+++ b/arch/x86_64/include/arch/boot/pointers.hpp
@@ -1,11 +1,14 @@
#ifndef TEACHOS_ARCH_X86_64_BOOT_POINTERS_HPP
#define TEACHOS_ARCH_X86_64_BOOT_POINTERS_HPP
+#include "arch/memory/paging/page_table.hpp"
+
#include <cstddef>
namespace teachos::arch::boot
{
extern "C" size_t const multiboot_information_pointer;
+ extern "C" memory::paging::page_table * page_map_level_4;
} // namespace teachos::arch::boot
#endif
diff --git a/arch/x86_64/include/arch/memory/paging/page_entry.hpp b/arch/x86_64/include/arch/memory/paging/page_entry.hpp
index 2b3b3f3..33126f0 100644
--- a/arch/x86_64/include/arch/memory/paging/page_entry.hpp
+++ b/arch/x86_64/include/arch/memory/paging/page_entry.hpp
@@ -59,9 +59,9 @@ namespace teachos::arch::memory::paging
* to calculate_physical_address() will return the new address and flags instead of the old one.
*
* @param frame Physical frame that contains the address we want to copy into our underlying std::bitset.
- * @param flags Entry flags which will be copied into our underlying std::bitset.
+ * @param additional_flags Entry flags which will be copied into our underlying std::bitset.
*/
- auto set_entry(allocator::physical_frame frame, std::bitset<64U> flags) -> void;
+ auto set_entry(allocator::physical_frame frame, std::bitset<64U> additional_flags) -> void;
/**
* @brief Checks if the given std::bitset is a subset or equivalent to the underlying std::bitset.
diff --git a/arch/x86_64/include/arch/memory/paging/page_mapper.hpp b/arch/x86_64/include/arch/memory/paging/page_mapper.hpp
index 173db9b..358b90c 100644
--- a/arch/x86_64/include/arch/memory/paging/page_mapper.hpp
+++ b/arch/x86_64/include/arch/memory/paging/page_mapper.hpp
@@ -77,7 +77,7 @@ namespace teachos::arch::memory::paging
exception_handling::assert(allocated_frame.has_value(), "[Page mapper] Unable to allocate frame");
current_handle[level_index].set_entry(allocated_frame.value(), entry::PRESENT | entry::WRITABLE);
// There should now be an entry at the previously not existent index, therefore we can simply access it again.
- next_handle = current_handle.next_table(page.get_level_index(level));
+ next_handle = current_handle.next_table(level_index);
exception_handling::assert(next_handle.has_value(), "[Page mapper] Unable to create new entry into page table");
next_handle.value().zero_entries();
}
diff --git a/arch/x86_64/include/arch/memory/paging/page_table.hpp b/arch/x86_64/include/arch/memory/paging/page_table.hpp
index e6542a2..ad5c794 100644
--- a/arch/x86_64/include/arch/memory/paging/page_table.hpp
+++ b/arch/x86_64/include/arch/memory/paging/page_table.hpp
@@ -66,7 +66,7 @@ namespace teachos::arch::memory::paging
* @param index Index of the entry we want to access and only read.
* @return Entry at the given table index.
*/
- auto operator[](std::size_t index) const -> entry;
+ auto operator[](std::size_t index) -> entry &;
/**
* @brief Decrements the page table handle level enum by one, is defined so we can use it as a replacement for an