UbixOS
2.0
|
#include <sys/_null.h>
#include <sys/types.h>
#include <sys/elf.h>
#include <sys/gdt.h>
#include <ubixos/exec.h>
#include <ubixos/ld.h>
#include <ubixos/kpanic.h>
#include <ubixos/endtask.h>
#include <vmm/vmm.h>
#include <lib/kmalloc.h>
#include <lib/kprintf.h>
#include <vfs/file.h>
#include <assert.h>
#include <string.h>
#include <sys/descrip.h>
Go to the source code of this file.
Macros | |
#define | ARGV_PAGE 0x100 |
#define | AT_BASE 7 /* Interpreter's base address. */ |
#define | AT_ENTRY 9 /* Where interpreter should transfer control. */ |
#define | AT_EXECFD 2 /* File descriptor of program to load. */ |
#define | AT_FLAGS 8 /* Flags (unused for i386). */ |
#define | AT_IGNORE 1 /* Ignored entry. */ |
#define | AT_NULL 0 /* Terminates the vector. */ |
#define | AT_PAGESZ 6 /* Page size in bytes. */ |
#define | AT_PHDR 3 /* Program header of program already loaded. */ |
#define | AT_PHENT 4 /* Size of each program header entry. */ |
#define | AT_PHNUM 5 /* Number of program header entries. */ |
#define | AUXARGS_ENTRY(pos, id, val) {*pos = id;pos++; *pos = val;pos++;} |
#define | ELF_AUX 0x100 |
#define | ENOEXEC -1 |
#define | ENVP_PAGE 0x100 |
#define | STACK_PAD 0x1000 |
Functions | |
void | execFile (char *file, char **argv, char **envp, int console) |
uint32_t | execThread (void(*tproc)(void), uint32_t stack, char *arg) |
int | sys_exec (struct thread *td, char *file, char **argv, char **envp) |
#define ARGV_PAGE 0x100 |
Definition at line 46 of file i386_exec.c.
#define AT_BASE 7 /* Interpreter's base address. */ |
Definition at line 59 of file i386_exec.c.
#define AT_ENTRY 9 /* Where interpreter should transfer control. */ |
Definition at line 61 of file i386_exec.c.
#define AT_EXECFD 2 /* File descriptor of program to load. */ |
Definition at line 54 of file i386_exec.c.
#define AT_FLAGS 8 /* Flags (unused for i386). */ |
Definition at line 60 of file i386_exec.c.
#define AT_IGNORE 1 /* Ignored entry. */ |
Definition at line 53 of file i386_exec.c.
#define AT_NULL 0 /* Terminates the vector. */ |
Definition at line 52 of file i386_exec.c.
#define AT_PAGESZ 6 /* Page size in bytes. */ |
Definition at line 58 of file i386_exec.c.
#define AT_PHDR 3 /* Program header of program already loaded. */ |
Definition at line 55 of file i386_exec.c.
#define AT_PHENT 4 /* Size of each program header entry. */ |
Definition at line 56 of file i386_exec.c.
#define AT_PHNUM 5 /* Number of program header entries. */ |
Definition at line 57 of file i386_exec.c.
Definition at line 63 of file i386_exec.c.
#define ELF_AUX 0x100 |
Definition at line 47 of file i386_exec.c.
#define ENOEXEC -1 |
Definition at line 50 of file i386_exec.c.
#define ENVP_PAGE 0x100 |
Definition at line 45 of file i386_exec.c.
#define STACK_PAD 0x1000 |
Definition at line 48 of file i386_exec.c.
void execFile | ( | char * | file, |
char ** | argv, | ||
char ** | envp, | ||
int | console | ||
) |
Definition at line 244 of file i386_exec.c.
Definition at line 148 of file i386_exec.c.
References assert, tssStruct::back_link, tssStruct::cr3, tssStruct::cs, tssStruct::ds, tssStruct::ebp, tssStruct::edi, tssStruct::eflags, tssStruct::eip, tssStruct::es, tssStruct::esi, tssStruct::esp, tssStruct::esp0, tssStruct::esp1, tssStruct::esp2, taskStruct::files, tssStruct::fs, tssStruct::gs, taskStruct::id, tssStruct::io_map, kernelPageDirectory, kpanic(), tssStruct::ldt, taskStruct::oInfo, PAGE_SIZE, READY, sched_setStatus(), schedNewTask(), tssStruct::ss, tssStruct::ss0, tssStruct::ss1, tssStruct::ss2, tssStruct::trace_bitmap, taskStruct::tss, vmm_getFreeKernelPage(), and osInfo::vmStart.
int sys_exec | ( | struct thread * | td, |
char * | file, | ||
char ** | argv, | ||
char ** | envp | ||
) |
Clean the virtual of COW pages left over from the fork
Definition at line 491 of file i386_exec.c.