MOS Source Code
|
#include "mos/tasks/process.h"
#include "mos/tasks/task_types.h"
#include <elf.h>
#include <mos/types.h>
Go to the source code of this file.
Classes | |
struct | elf_identity_t |
struct | elf_header_t |
struct | elf_program_hdr_t |
struct | auxv_vec_t |
struct | elf_startup_info_t |
Macros | |
#define | ELF_ENDIANNESS_MOS_DEFAULT ELF_ENDIANNESS_MSB |
#define | AUXV_VEC_SIZE 16 |
Enumerations | |
enum | elf_endianness { ELF_ENDIANNESS_INVALID = 0 , ELF_ENDIANNESS_LSB = 1 , ELF_ENDIANNESS_MSB = 2 } |
enum | elf_program_header_type { ELF_PT_NULL = 0 , ELF_PT_LOAD = 1 , ELF_PT_DYNAMIC = 2 , ELF_PT_INTERP = 3 , ELF_PT_NOTE = 4 , ELF_PT_SHLIB = 5 , ELF_PT_PHDR = 6 , ELF_PT_TLS = 7 , _ELF_PT_COUNT , ELF_PT_OS_LOW = 0x60000000 , ELF_PT_OS_HIGH = 0x6fffffff , ELF_PT_PROCESSOR_LO = 0x70000000 , ELF_PT_PROCESSOR_HI = 0x7fffffff } |
enum | elf_ph_flags { ELF_PF_X = 1 << 0 , ELF_PF_W = 1 << 1 , ELF_PF_R = 1 << 2 } |
Functions | |
MOS_STATIC_ASSERT (sizeof(elf_identity_t)==16, "elf_identity_t has wrong size") | |
__nodiscard bool | elf_read_and_verify_executable (file_t *file, elf_header_t *header) |
__nodiscard bool | elf_fill_process (process_t *proc, file_t *file, const char *path, const char *const argv[], const char *const envp[]) |
__nodiscard bool | elf_do_fill_process (process_t *proc, file_t *file, elf_header_t elf, elf_startup_info_t *info) |
process_t * | elf_create_process (const char *path, process_t *parent, const char *const argv[], const char *const envp[], const stdio_t *ios) |
#define ELF_ENDIANNESS_MOS_DEFAULT ELF_ENDIANNESS_MSB |
Definition at line 21 of file elf.h.
Referenced by elf_verify_header().
#define AUXV_VEC_SIZE 16 |
Definition at line 98 of file elf.h.
Referenced by add_auxv_entry().
enum elf_endianness |
enum elf_ph_flags |
MOS_STATIC_ASSERT | ( | sizeof(elf_identity_t) | = =16, |
"elf_identity_t has wrong size" | ) |
__nodiscard bool elf_read_and_verify_executable | ( | file_t * | file, |
elf_header_t * | header ) |
Definition at line 338 of file elf.c.
Referenced by elf_fill_process(), elf_map_interpreter(), and process_do_execveat().
__nodiscard bool elf_fill_process | ( | process_t * | proc, |
file_t * | file, | ||
const char * | path, | ||
const char *const | argv[], | ||
const char *const | envp[] ) |
Definition at line 353 of file elf.c.
Referenced by elf_create_process().
__nodiscard bool elf_do_fill_process | ( | process_t * | proc, |
file_t * | file, | ||
elf_header_t | elf, | ||
elf_startup_info_t * | info ) |
Definition at line 230 of file elf.c.
Referenced by elf_fill_process(), and process_do_execveat().
process_t * elf_create_process | ( | const char * | path, |
process_t * | parent, | ||
const char *const | argv[], | ||
const char *const | envp[], | ||
const stdio_t * | ios ) |
Definition at line 408 of file elf.c.
Referenced by mos_start_kernel(), and MOS_STATIC_ASSERT().