PatchworkOS  966e257
A non-POSIX operating system.
Loading...
Searching...
No Matches
loader.c File Reference
#include <kernel/cpu/gdt.h>
#include <kernel/fs/dentry.h>
#include <kernel/fs/file_table.h>
#include <kernel/fs/path.h>
#include <kernel/fs/vfs.h>
#include <kernel/log/log.h>
#include <kernel/mem/vmm.h>
#include <kernel/proc/process.h>
#include <kernel/sched/loader.h>
#include <kernel/sched/sched.h>
#include <kernel/sched/thread.h>
#include <errno.h>
#include <kernel/sched/wait.h>
#include <stdlib.h>
#include <string.h>
#include <sys/elf.h>
#include <sys/math.h>
#include <sys/proc.h>
Include dependency graph for loader.c:

Go to the source code of this file.

Functions

static void loader_strv_free (char **array, uint64_t amount)
 
void loader_exec (const char *executable, char **argv, uint64_t argc)
 Causes the currently running thread to load and execute a new program.
 
static void loader_entry (const char *executable, char **argv, uint64_t argc)
 
 SYSCALL_DEFINE (SYS_SPAWN, pid_t, const char **argv, spawn_flags_t flags)
 
 SYSCALL_DEFINE (SYS_THREAD_CREATE, tid_t, void *entry, void *arg)
 

Function Documentation

◆ loader_strv_free()

static void loader_strv_free ( char **  array,
uint64_t  amount 
)
static

Definition at line 21 of file loader.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loader_entry()

static void loader_entry ( const char *  executable,
char **  argv,
uint64_t  argc 
)
static

Definition at line 145 of file loader.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SYSCALL_DEFINE() [1/2]

SYSCALL_DEFINE ( SYS_SPAWN  ,
pid_t  ,
const char **  argv,
spawn_flags_t  flags 
)

Definition at line 154 of file loader.c.

Here is the call graph for this function:

◆ SYSCALL_DEFINE() [2/2]

SYSCALL_DEFINE ( SYS_THREAD_CREATE  ,
tid_t  ,
void *  entry,
void *  arg 
)

Definition at line 278 of file loader.c.

Here is the call graph for this function: