Kernel/LibC: pass environ pointer to process
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user