diff options
Diffstat (limited to 'src/core/loader/elf.cpp')
-rw-r--r-- | src/core/loader/elf.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp index 773eaf771..a951bc80f 100644 --- a/src/core/loader/elf.cpp +++ b/src/core/loader/elf.cpp @@ -5,13 +5,14 @@ #include <string> #include <memory> -#include "common/common.h" +#include "common/common_types.h" #include "common/file_util.h" +#include "common/logging/log.h" #include "common/symbols.h" -#include "core/mem_map.h" -#include "core/loader/elf.h" #include "core/hle/kernel/kernel.h" +#include "core/loader/elf.h" +#include "core/memory.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // ELF Header Constants @@ -349,9 +350,15 @@ ResultStatus AppLoader_ELF::Load() { if (file->ReadBytes(&buffer[0], size) != size) return ResultStatus::Error; + Kernel::g_current_process = Kernel::Process::Create(filename, 0); + Kernel::g_current_process->svc_access_mask.set(); + Kernel::g_current_process->address_mappings = default_address_mappings; + ElfReader elf_reader(&buffer[0]); - elf_reader.LoadInto(0x00100000); - Kernel::LoadExec(elf_reader.GetEntryPoint()); + elf_reader.LoadInto(Memory::PROCESS_IMAGE_VADDR); + // TODO: Fill application title + + Kernel::g_current_process->Run(elf_reader.GetEntryPoint(), 48, Kernel::DEFAULT_STACK_SIZE); is_loaded = true; return ResultStatus::Success; |