LibELF: Start implementing elf library

This commit is contained in:
Bananymous
2023-04-12 22:20:18 +03:00
parent c897b90c28
commit 998ae511a3
10 changed files with 485 additions and 1 deletions

View File

@@ -93,10 +93,15 @@ set(LIBC_SOURCES
../libc/string.cpp
)
set(LIBELF_SOURCES
../LibELF/LibELF/ELF.cpp
)
set(KERNEL_SOURCES
${KERNEL_SOURCES}
${BAN_SOURCES}
${LIBC_SOURCES}
${LIBELF_SOURCES}
)
add_executable(kernel ${KERNEL_SOURCES})

View File

@@ -22,6 +22,8 @@
#include <kernel/Terminal/TTY.h>
#include <kernel/Terminal/VesaTerminalDriver.h>
#include <LibELF/ELF.h>
extern "C" const char g_kernel_cmdline[];
struct ParsedCommandLine
@@ -177,7 +179,17 @@ static void init2(void* terminal_driver)
ASSERT(tty1);
DeviceManager::get().add_device(tty1);
return jump_userspace();
MUST(Process::create_kernel(
[](void*)
{
MUST(LibELF::ELF::load_from_file("/bin/test"sv));
Process::current()->exit();
}, nullptr
));
return;
jump_userspace();
return;
MUST(Process::create_kernel(
[](void*)