X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/74926d2db1d9f3228acdfca03013a8ba0ac1d8c0..09aa85cf875db1e6fd1317cd2b9947b9d3675d6c:/lunaix-os/includes/lunaix/ld.h diff --git a/lunaix-os/includes/lunaix/ld.h b/lunaix-os/includes/lunaix/ld.h index 88114f5..690f95f 100644 --- a/lunaix-os/includes/lunaix/ld.h +++ b/lunaix-os/includes/lunaix/ld.h @@ -1,25 +1,62 @@ #ifndef __LUNAIX_LOADER_H #define __LUNAIX_LOADER_H +#include #include #include #define LD_STAT_FKUP 0x1U #define MAX_VAR_PAGES 8 +#define DEFAULT_HEAP_PAGES 16 + +struct ld_info +{ + struct elf32_ehdr ehdr_out; + ptr_t base; + ptr_t end; + ptr_t mem_sz; + + ptr_t stack_top; + ptr_t entry; +}; struct ld_param { struct proc_info* proc; ptr_t vms_mnt; - struct elf32_ehdr ehdr_out; + + struct ld_info info; int status; }; +struct usr_exec_param +{ + int argc; + char** argv; + int envc; + char** envp; + struct ld_info info; +} PACKED; + +#ifndef __USR_WRAPPER__ int elf_load(struct ld_param* ldparam, struct v_file* elfile); +int +exec_load_byname(struct ld_param* param, + const char* filename, + const char** argv, + const char** envp); + +int +exec_load(struct ld_param* param, + struct v_file* executable, + const char** argv, + const char** envp); + void ld_create_param(struct ld_param* param, struct proc_info* proc, ptr_t vms); +#endif #endif /* __LUNAIX_LOADER_H */