aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/x86_64/include/arch/memory/heap/user_heap_allocator.hpp1
-rw-r--r--arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp13
2 files changed, 11 insertions, 3 deletions
diff --git a/arch/x86_64/include/arch/memory/heap/user_heap_allocator.hpp b/arch/x86_64/include/arch/memory/heap/user_heap_allocator.hpp
index d698888..c50d2f6 100644
--- a/arch/x86_64/include/arch/memory/heap/user_heap_allocator.hpp
+++ b/arch/x86_64/include/arch/memory/heap/user_heap_allocator.hpp
@@ -18,6 +18,7 @@ namespace teachos::arch::memory::heap
* @param heap_start Start of the allocatable heap area
* @param heap_end End of the allocatable heap area (Start + Size)
*/
+ [[gnu::section(".user_text")]]
user_heap_allocator(std::size_t heap_start, std::size_t heap_end);
/**
diff --git a/arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp b/arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp
index 05fde8b..bc36361 100644
--- a/arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp
+++ b/arch/x86_64/include/arch/memory/paging/kernel_mapper.hpp
@@ -143,10 +143,11 @@ namespace teachos::arch::memory::paging
entry entry{section.flags};
// Required to be accesible in User Mode:
- // - .user_text (Contains the actual code executed)
- // - .boot_bss (Contains statically allocated variables)
// - .boot_rodata (Contains constant data stored in ROM)
+ // - .boot_bss (Contains statically allocated variables)
+ // - .user_text (Contains the actual code executed)
// - .user_data (Contains static user variables)
+ // - .stl_text (Contains code for custom std implementations)
if (section.physical_address == 0x100000 /* .boot_rodata */ ||
section.physical_address == 0x102000 /* .boot_bss */ ||
section.physical_address == 0x218000 /* .stl_text */)
@@ -155,8 +156,14 @@ namespace teachos::arch::memory::paging
entry.set_global();
}
+ // TODO: We should be able to remove this somehow
+ if (section.physical_address == 0x209000 /* .text */)
+ {
+ entry.set_user_accesible();
+ }
+
if (section.physical_address == 0x217000 /* .user_text */ ||
- section.physical_address == 0x21D000 /* .user_data */)
+ section.physical_address == 0x21E000 /* .user_data */)
{
entry.set_user_accesible();
}