aboutsummaryrefslogtreecommitdiff
path: root/common/elf.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2021-12-19 17:10:36 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2021-12-19 17:10:36 +0200
commit9966b49db468de0168c7a455dfb5b4c66c413c4d (patch)
treedf31febe5e1ae52bae68ebe1df8b4469b97e0546 /common/elf.c
parent8bb1e280280c2f30740defca68ea643c56a3d880 (diff)
downloadkmi-9966b49db468de0168c7a455dfb5b4c66c413c4d.tar.gz
kmi-9966b49db468de0168c7a455dfb5b4c66c413c4d.zip
Massive changes to jump to userspace
Diffstat (limited to 'common/elf.c')
-rw-r--r--common/elf.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/elf.c b/common/elf.c
new file mode 100644
index 0000000..7531bd1
--- /dev/null
+++ b/common/elf.c
@@ -0,0 +1,9 @@
+#include <apos/elf.h>
+#include <apos/vmem.h>
+
+vm_t bin_entry(vm_t bin)
+{
+ struct elf_header *e = (struct elf_header *)bin;
+ /* TODO: check that address points to a valid ELF executable */
+ return (vm_t)e->e_entry;
+}