LibELF: Start implementing elf library
This commit is contained in:
@@ -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})
|
||||
|
||||
@@ -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*)
|
||||
|
||||
Reference in New Issue
Block a user