1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:48:12 +00:00

Kernel: Add stubs for missing x86_64 functionality

This adds just enough stubs to make the kernel compile on x86_64. Obviously
it won't do anything useful - in fact it won't even attempt to boot because
Multiboot doesn't support ELF64 binaries - but it gets those compiler errors
out of the way so more progress can be made getting all the missing
functionality in place.
This commit is contained in:
Gunnar Beutner 2021-06-23 21:54:41 +02:00 committed by Andreas Kling
parent f2eb759901
commit 38fca26f54
21 changed files with 295 additions and 40 deletions

View file

@ -8,6 +8,7 @@
#include <AK/String.h>
#include <AK/StringBuilder.h>
#include <AK/StringView.h>
#include <Kernel/Panic.h>
#include <Kernel/PerformanceManager.h>
#include <Kernel/Process.h>
#include <Kernel/VM/MemoryManager.h>
@ -60,11 +61,16 @@ KResultOr<int> Process::sys$create_thread(void* (*entry)(void*), Userspace<const
if (!is_thread_joinable)
thread->detach();
#if ARCH(I386)
auto& tss = thread->tss();
tss.eip = (FlatPtr)entry;
tss.eflags = 0x0202;
tss.cr3 = space().page_directory().cr3();
tss.esp = user_esp.value();
#else
(void)entry;
PANIC("Process::sys$create_thread() not implemented");
#endif
auto tsr_result = thread->make_thread_specific_region({});
if (tsr_result.is_error())