Kernel: Add bareboness fork() function
This commit is contained in:
@@ -17,4 +17,8 @@
|
||||
#define read_rsp(rsp) asm volatile("movl %%esp, %0" : "=r"(rsp))
|
||||
#define push_callee_saved() asm volatile("pushal")
|
||||
#define pop_callee_saved() asm volatile("popal")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
extern "C" uintptr_t read_rip();
|
||||
|
||||
@@ -41,6 +41,8 @@ namespace Kernel
|
||||
|
||||
pid_t pid() const { return m_pid; }
|
||||
|
||||
BAN::ErrorOr<Process*> fork(uintptr_t rsp, uintptr_t rip);
|
||||
|
||||
BAN::ErrorOr<int> open(BAN::StringView, int);
|
||||
BAN::ErrorOr<void> close(int fd);
|
||||
BAN::ErrorOr<size_t> read(int fd, void* buffer, size_t count);
|
||||
|
||||
@@ -31,6 +31,8 @@ namespace Kernel
|
||||
static BAN::ErrorOr<Thread*> create_userspace(uintptr_t, Process*, int, char**);
|
||||
~Thread();
|
||||
|
||||
BAN::ErrorOr<Thread*> clone(Process*, uintptr_t rsp, uintptr_t rip);
|
||||
|
||||
pid_t tid() const { return m_tid; }
|
||||
|
||||
void set_rsp(uintptr_t rsp) { m_rsp = rsp; validate_stack(); }
|
||||
|
||||
Reference in New Issue
Block a user