XenevaOS
Loading...
Searching...
No Matches
loader.h
Go to the documentation of this file.
1
30#ifndef __LOADER_H__
31#define __LOADER_H__
32
33#include <stdint.h>
34#include <pe.h>
35#include <process.h>
36
37#ifdef ARCH_X64
38#include <Sync/mutex.h>
39#endif
40
41/* the base address from where every executable image
42 * starts
43 */
44#define PROC_IMAGE_BASE_START 0x0000000000600000
45
46extern void AuInitialiseLoader();
47
48/*
49* AuLoadExecToProcess -- loads an executable to the
50* process
51* @param proc -- pointer to process data structure
52* @param filename -- executable file name
53* @param argc -- number of arguments
54* @param argv -- array of argument in strings
55*/
56extern int AuLoadExecToProcess(AuProcess* proc, char* filename, int argc, char** argv);
57
58/*
59* AuProcessEntUser -- main kernel thread call
60* in order to enter user for processes
61* @param rcx -- user entry structure
62*/
63extern void AuProcessEntUser(uint64_t rcx);
64
65extern void AuProcessEntSubThread(uint64_t rcx);
66
67struct __mm_file_back__;
68
69/*
70 * AuLoadElfImage -- map a static aarch64 ELF from the file page cache.
71 * Offset P is P2V(cache->physicalPage) + (P % PAGE_SIZE) on the
72 * AuMMPageCache whose pageIndex is P / PAGE_SIZE. Not a PE image.
73 */
74extern int AuLoadElfImage(AuProcess* proc, struct __mm_file_back__* fb, size_t image_len,
75 int argc, char** argv);
76
77/* Build the musl initial stack (argc, argv, envp, auxv) and return the sp. */
79
80#ifdef ARCH_X64
81/*
82* AuLoaderGetMutex -- returns loader
83* mutex
84*/
86
87#endif
88
89extern bool AuIsLoaderBusy();
90#endif
COMPILER_DEPENDENT_UINT64 uint64_t
Definition acefiex.h:165
AuMutex * AuLoaderGetMutex()
Definition loader.cpp:309
bool AuIsLoaderBusy()
Definition loader.cpp:313
uint64_t AuLinuxBuildUserStack(AuUserEntry *uentry)
Definition loader_elf.c:184
void AuProcessEntUser(uint64_t rcx)
AuProcessEntUser – main kernel thread call in order to enter user for processes.
Definition loader.cpp:82
int AuLoadElfImage(AuProcess *proc, struct __mm_file_back__ *fb, size_t image_len, int argc, char **argv)
Definition loader_elf.c:261
void AuProcessEntSubThread(uint64_t rcx)
Definition loader.c:162
void AuInitialiseLoader()
AuInitialiseLoader – initialize the loader and allocate atleast 1 MiB for scratch use.
Definition loader.cpp:298
int AuLoadExecToProcess(AuProcess *proc, char *filename, int argc, char **argv)
AuLoadExecToProcess – loads an executable to the process.
Definition loader.cpp:126
Definition mmfile.h:48
Definition process.h:126
Definition mutex.h:40
Definition x86_64_sched.h:98