feat: basic elf32 loader (only LOAD segment is supported)
[lunaix-os.git] / lunaix-os / includes / lunaix / ld.h
diff --git a/lunaix-os/includes/lunaix/ld.h b/lunaix-os/includes/lunaix/ld.h
new file mode 100644 (file)
index 0000000..88114f5
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef __LUNAIX_LOADER_H
+#define __LUNAIX_LOADER_H
+
+#include <lunaix/process.h>
+#include <lunaix/types.h>
+
+#define LD_STAT_FKUP 0x1U
+
+#define MAX_VAR_PAGES 8
+
+struct ld_param
+{
+    struct proc_info* proc;
+    ptr_t vms_mnt;
+    struct elf32_ehdr ehdr_out;
+    int status;
+};
+
+int
+elf_load(struct ld_param* ldparam, struct v_file* elfile);
+
+void
+ld_create_param(struct ld_param* param, struct proc_info* proc, ptr_t vms);
+
+#endif /* __LUNAIX_LOADER_H */