aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86_64/include/arch/memory/multiboot/memory_map.hpp2
-rw-r--r--arch/x86_64/scripts/kernel.ld3
-rw-r--r--arch/x86_64/src/memory/paging/page_table.cpp7
3 files changed, 9 insertions, 3 deletions
diff --git a/arch/x86_64/include/arch/memory/multiboot/memory_map.hpp b/arch/x86_64/include/arch/memory/multiboot/memory_map.hpp
index 1a38a30..858ae52 100644
--- a/arch/x86_64/include/arch/memory/multiboot/memory_map.hpp
+++ b/arch/x86_64/include/arch/memory/multiboot/memory_map.hpp
@@ -28,10 +28,10 @@ namespace teachos::arch::memory::multiboot
*/
struct __attribute__((packed)) memory_area
{
- uint32_t size; ///< Size of this structure in bytes.
uint64_t base_address; ///< Base address the memory region starts at.
uint64_t area_length; ///< Size of the memory region, added to base_address results in the final address.
memory_area_type type; ///< Specific type of memory the region can contain.
+ uint32_t zero; ///<
};
/**
diff --git a/arch/x86_64/scripts/kernel.ld b/arch/x86_64/scripts/kernel.ld
index 31d8be3..c777d10 100644
--- a/arch/x86_64/scripts/kernel.ld
+++ b/arch/x86_64/scripts/kernel.ld
@@ -59,6 +59,9 @@ SECTIONS
*(.boot_stack)
}
+ . = ALIGN(4K);
+ _end_of_image = .;
+
/***************************************************************************
* Now it is time to load the 64-bit kernel code. We virtually load it into
* the upper 2GiB, while adjusting the linear load address appropriately. We
diff --git a/arch/x86_64/src/memory/paging/page_table.cpp b/arch/x86_64/src/memory/paging/page_table.cpp
index 21611e1..1d7b8a0 100644
--- a/arch/x86_64/src/memory/paging/page_table.cpp
+++ b/arch/x86_64/src/memory/paging/page_table.cpp
@@ -1,5 +1,7 @@
#include "arch/memory/paging/page_table.hpp"
+#include <array>
+
namespace teachos::arch::memory::paging
{
/**
@@ -44,8 +46,9 @@ namespace teachos::arch::memory::paging
*/
auto next_table_address(std::size_t table_index) -> std::optional<std::size_t>;
- entry entries[PAGE_TABLE_ENTRY_COUNT]; ///< Entries containing addresses to page tables of a level below or
- ///< actual virtual addresses for the level 1 page table.
+ std::array<entry, PAGE_TABLE_ENTRY_COUNT>
+ entries{}; ///< Entries containing addresses to page tables of a level below or
+ ///< actual virtual addresses for the level 1 page table.
};
auto page_table::zero_entries() -> void