Trying to fix user stack

This commit is contained in:
Alex
2022-11-16 16:04:09 +02:00
parent 4d874a3e81
commit 9fdad650b9
7 changed files with 172 additions and 110 deletions

View File

@ -40,7 +40,7 @@ namespace Execute
};
BinaryType GetBinaryType(char *Path);
SpawnData Spawn(char *Path, Vector<const char *> &argv, Vector<const char *> &envp);
SpawnData Spawn(char *Path, const char **argv, const char **envp);
void *ELFLoadRel(Elf64_Ehdr *Header);
}

View File

@ -35,7 +35,8 @@ extern uint64_t _kernel_text_end, _kernel_data_end, _kernel_rodata_end;
#define TO_GPB(d) (d / 1024 / 1024 / 1024 / 1024 / 1024 / 1024 / 1024 / 1024 / 1024 / 1024)
#define PAGE_SIZE 0x1000
#define STACK_SIZE 0x10000
#define STACK_SIZE 0x1000000
#define USER_STACK_SIZE 0x1000000
// to pages
#define TO_PAGES(d) (d / PAGE_SIZE + 1)

View File

@ -85,7 +85,7 @@ namespace Tasking
IP EntryPoint;
IPOffset Offset;
int ExitCode;
void *Stack;
void *Stack __attribute__((aligned(16)));
TaskStatus Status;
#if defined(__amd64__)
CPU::x64::TrapFrame Registers;
@ -241,8 +241,8 @@ namespace Tasking
TCB *CreateThread(PCB *Parent,
IP EntryPoint,
Vector<const char *> &argv,
Vector<const char *> &envp,
const char **argv,
const char **envp,
Vector<AuxiliaryVector> &auxv,
IPOffset Offset = 0,
TaskArchitecture Architecture = TaskArchitecture::x64,