Kernel/LibC: pass environ pointer to process

This commit is contained in:
Bananymous
2023-06-05 20:34:08 +03:00
parent 6b73f4d187
commit 896b919c9d
6 changed files with 14 additions and 5 deletions

View File

@@ -78,6 +78,7 @@ namespace Kernel
process->m_userspace_entry.argc = 1;
process->m_userspace_entry.argv = argv;
process->m_userspace_entry.envp = (char**)0x69696969;
process->m_userspace_entry.entry = elf->file_header_native().e_entry;
delete elf;

View File

@@ -9,7 +9,7 @@
namespace Kernel
{
extern "C" void thread_userspace_trampoline(uint64_t rsp, uint64_t rip, int argc, char** argv);
extern "C" void thread_userspace_trampoline(uint64_t rsp, uint64_t rip, int argc, char** argv, char** envp);
extern "C" uintptr_t read_rip();
template<size_t size, typename T>
@@ -131,7 +131,7 @@ namespace Kernel
[](void*)
{
const auto& entry = Process::current().userspace_entry();
thread_userspace_trampoline(Thread::current().rsp(), entry.entry, entry.argc, entry.argv);
thread_userspace_trampoline(Thread::current().rsp(), entry.entry, entry.argc, entry.argv, entry.envp);
ASSERT_NOT_REACHED();
}
);