Kernel: Implement Process::exec()

This commit is contained in:
Bananymous
2023-05-31 20:56:29 +03:00
parent 5fb69300ca
commit b48b239882
5 changed files with 136 additions and 62 deletions

View File

@@ -47,6 +47,7 @@ namespace Kernel
pid_t pid() const { return m_pid; }
BAN::ErrorOr<Process*> fork(uintptr_t rsp, uintptr_t rip);
BAN::ErrorOr<void> exec(BAN::StringView path, const char* const* argv, const char* const* envp);
BAN::ErrorOr<int> open(BAN::StringView, int);
BAN::ErrorOr<void> close(int fd);
@@ -85,6 +86,8 @@ namespace Kernel
static Process* create_process();
static void register_process(Process*);
BAN::ErrorOr<void> cleanup_and_load_elf(BAN::StringView);
BAN::ErrorOr<BAN::String> absolute_path_of(BAN::StringView) const;
private:

View File

@@ -32,6 +32,7 @@ namespace Kernel
~Thread();
BAN::ErrorOr<Thread*> clone(Process*, uintptr_t rsp, uintptr_t rip);
void setup_exec();
pid_t tid() const { return m_tid; }