Files
.github
.vscode
Architecture
Core
Execute
FileSystem
Files
GUI
Library
Network
Profiling
Recovery
SystemCalls
Tasking
Tests
include
boot
filesystem
net
abi.h
assert.h
atomic.hpp
bitmap.hpp
cargs.h
convert.h
cpu.hpp
crc32.h
cstring
cwalk.h
debug.h
disk.hpp
display.hpp
driver.hpp
dumper.hpp
elf.h
exec.hpp
filesystem.hpp
gui.hpp
hashmap.hpp
interrupts.hpp
io.h
ipc.hpp
kconfig.hpp
limits.h
lock.hpp
md5.h
memory.hpp
msexec.h
pci.hpp
power.hpp
printf.h
rand.hpp
recovery.hpp
smartptr.hpp
smp.hpp
std.hpp
stdint.h
symbols.hpp
sys.h
syscalls.hpp
task.hpp
time.hpp
types.h
uart.hpp
vector.hpp
.gitignore
DAPI.hpp
Doxyfile
Fex.hpp
KConfig.cpp
KThread.cpp
Kernel.cpp
LICENSE
Makefile
README.md
dump.sh
kernel.h
syscalls.h
Kernel/include/exec.hpp
2022-12-26 08:39:27 +02:00

60 lines
1.3 KiB
C++

#ifndef __FENNIX_KERNEL_FILE_EXECUTE_H__
#define __FENNIX_KERNEL_FILE_EXECUTE_H__
#include <types.h>
#include <task.hpp>
#include <elf.h>
namespace Execute
{
enum BinaryType
{
BinTypeInvalid,
BinTypeFex,
BinTypeELF,
BinTypePE,
BinTypeNE,
BinTypeMZ,
BinTypeUnknown
};
enum ExStatus
{
OK,
Unknown,
Unsupported,
InvalidFile,
InvalidFileFormat,
InvalidFileHeader,
InvalidFileData,
InvalidFileEntryPoint,
InvalidFilePath
};
struct SpawnData
{
ExStatus Status;
Tasking::PCB *Process;
Tasking::TCB *Thread;
};
BinaryType GetBinaryType(char *Path);
SpawnData Spawn(char *Path, const char **argv, const char **envp);
void *ELFLoadRel(Elf64_Ehdr *Header);
void ELFLoadExec(void *BaseImage,
size_t Length,
Elf64_Ehdr *ELFHeader,
Memory::Virtual &pva,
SpawnData *ret,
char *Path,
Tasking::PCB *Process,
const char **argv,
const char **envp,
Tasking::TaskArchitecture Arch,
Tasking::TaskCompatibility Comp);
}
#endif // !__FENNIX_KERNEL_FILE_EXECUTE_H__