diff options
| author | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-10-26 13:43:51 +0000 |
|---|---|---|
| committer | Matteo Gmür <matteo.gmuer1@ost.ch> | 2024-10-26 13:43:51 +0000 |
| commit | ca17ed52ea768f1e1c837207f7d27afa6ed99cc2 (patch) | |
| tree | fec81a2658e1fff0ad3a5428865be9ac5f204245 | |
| parent | d86af47f0b62cb3ae302fb292747944620542db1 (diff) | |
| download | teachos-ca17ed52ea768f1e1c837207f7d27afa6ed99cc2.tar.xz teachos-ca17ed52ea768f1e1c837207f7d27afa6ed99cc2.zip | |
Update boot.s comments and comment initalize page tables out
| -rw-r--r-- | arch/x86_64/src/boot/boot.s | 8 | ||||
| -rw-r--r-- | arch/x86_64/src/memory/paging/page_table.cpp | 3 |
2 files changed, 7 insertions, 4 deletions
diff --git a/arch/x86_64/src/boot/boot.s b/arch/x86_64/src/boot/boot.s index 6ed1e0a..f04ae44 100644 --- a/arch/x86_64/src/boot/boot.s +++ b/arch/x86_64/src/boot/boot.s @@ -17,8 +17,8 @@ * * We need: * - A single PML 4 (since we will only use 4-level paging) - * - 2 PML 3s (since we need to map low (1+MiB) memory) - * - 2 PML 2s (since we need to map low (1+MiB) memory) + * - 1 PML 3 + * - 1 PML 2 */ .global page_map_level_4 @@ -317,12 +317,12 @@ enable_sse: * page map entries. */ prepare_page_maps: - /* Add an entry to the PML4, pointing to the low PML3 */ + /* Add an entry to the PML4, pointing to the PML3 */ mov $page_map_level_3, %eax or $0x3, %eax mov %eax, (page_map_level_4 + ((0x0000000000100000 >> 39) & 0x1ff) * 8) - /* Add an entry to the low PML3, pointing to the low PML2 */ + /* Add an entry to the PML3, pointing to the PML2 */ mov $page_map_level_2, %eax or $0x3, %eax mov %eax, (page_map_level_3 + ((0x0000000000100000 >> 30) & 0x1ff) * 8) diff --git a/arch/x86_64/src/memory/paging/page_table.cpp b/arch/x86_64/src/memory/paging/page_table.cpp index 93cc0de..868cf86 100644 --- a/arch/x86_64/src/memory/paging/page_table.cpp +++ b/arch/x86_64/src/memory/paging/page_table.cpp @@ -109,6 +109,8 @@ namespace teachos::arch::memory::paging auto page_table_handle::initialize_page_tables() -> void { + // TODO: This should be done differently and only once the other methods are working see Rempaing the Kernel + /* exception_handling::assert(handle_level == page_table_handle::LEVEL4, "[Page Table] Attempted to initialize a page table of level 3 or lower"); auto level3_page_table = std::construct_at(reinterpret_cast<page_table *>(&_end_of_image)); @@ -124,6 +126,7 @@ namespace teachos::arch::memory::paging } size_t const flags = reinterpret_cast<size_t>(level3_page_table); this->operator[](0U) = entry{flags}; + */ } auto page_table_handle::zero_entries() -> void { handle->zero_entries(); } |
