[kernel] Add userspace threading

Implement the syscalls necessary for threads to create other threads in
their same process. This involved rearranging a number of syscalls, as
well as implementing object_wait and a basic implementation of a
process' list of handles.
This commit is contained in:
2020-07-26 16:02:38 -07:00
parent 4cf222a5bb
commit ae3290c53d
22 changed files with 481 additions and 255 deletions

View File

@@ -2,6 +2,8 @@
#include "cpu.h"
#include "debug.h"
#include "gdt.h"
#include "objects/process.h"
#include "objects/thread.h"
#include "page_manager.h"
size_t __counter_syscall_enter = 0;
@@ -15,6 +17,9 @@ print_regs(const cpu_state &regs)
uint64_t cr2 = 0;
__asm__ __volatile__ ("mov %%cr2, %0" : "=r"(cr2));
cons->printf(" process: %llx", bsp_cpu_data.p->koid());
cons->printf(" thread: %llx\n", bsp_cpu_data.t->koid());
print_regL("rax", regs.rax);
print_regM("rbx", regs.rbx);
print_regR("rcx", regs.rcx);