X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/b6ff3c7dbab3f40d03389808d95ac27d416c35e3..0fd474df7001837bde53da0e42e83081827c9641:/lunaix-os/includes/lunaix/exec.h?ds=sidebyside diff --git a/lunaix-os/includes/lunaix/exec.h b/lunaix-os/includes/lunaix/exec.h index 2bc0d94..50f9489 100644 --- a/lunaix-os/includes/lunaix/exec.h +++ b/lunaix-os/includes/lunaix/exec.h @@ -5,14 +5,16 @@ #include #include +#define MAX_PARAM_LEN 1024 +#define MAX_PARAM_SIZE 4096 + #define MAX_VAR_PAGES 8 #define DEFAULT_HEAP_PAGES 16 -struct exec_context; - struct load_context { - struct exec_container* container; + struct exec_host* container; + ptr_t base; ptr_t end; ptr_t mem_sz; @@ -20,17 +22,25 @@ struct load_context ptr_t entry; }; -struct exec_container +struct exec_arrptr +{ + unsigned int len; + unsigned int size; + ptr_t raw; + ptr_t copied; +}; + + +struct exec_host { struct proc_info* proc; ptr_t vms_mnt; struct load_context exe; + struct v_inode* inode; - // argv prependums - char* argv_pp[2]; - const char** argv; - const char** envp; + struct exec_arrptr argv; + struct exec_arrptr envp; ptr_t stack_top; @@ -43,19 +53,25 @@ struct uexec_param char** argv; int envc; char** envp; -} PACKED; +} compact; -#ifndef __USR_WRAPPER__ +int +exec_arch_prepare_entry(struct thread* thread, struct exec_host* container); int -exec_load_byname(struct exec_container* container, const char* filename); +exec_load_byname(struct exec_host* container, const char* filename); int -exec_load(struct exec_container* container, struct v_file* executable); +exec_load(struct exec_host* container, struct v_file* executable); int exec_kexecve(const char* filename, const char* argv[], const char* envp[]); -#endif +void +exec_init_container(struct exec_host* param, + struct thread* thread, + ptr_t vms, + const char** argv, + const char** envp); #endif /* __LUNAIX_LOADER_H */