From 5f66ef34dd8663bda5aa4f8c5bdf535369831101 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Tue, 27 Aug 2024 22:46:08 +0300 Subject: [PATCH] Kernel: map userspace arguments after the entry point This allows cleaner memory layout for processes that are not loaded to default location --- kernel/kernel/Process.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/kernel/Process.cpp b/kernel/kernel/Process.cpp index 3f6d96c59e..547aba7347 100644 --- a/kernel/kernel/Process.cpp +++ b/kernel/kernel/Process.cpp @@ -539,7 +539,7 @@ namespace Kernel auto region = TRY(MemoryBackedRegion::create( page_table(), bytes, - { .start = 0x400000, .end = KERNEL_OFFSET }, + { .start = m_userspace_info.entry, .end = KERNEL_OFFSET }, MemoryRegion::Type::PRIVATE, PageTable::Flags::UserSupervisor | PageTable::Flags::ReadWrite | PageTable::Flags::Present ));