mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-23 16:14:23 +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:
committed by
Andreas Kling
parent
f2eb759901
commit
38fca26f54
@@ -20,6 +20,7 @@
|
||||
#include <Kernel/KBufferBuilder.h>
|
||||
#include <Kernel/KSyms.h>
|
||||
#include <Kernel/Module.h>
|
||||
#include <Kernel/Panic.h>
|
||||
#include <Kernel/PerformanceEventBuffer.h>
|
||||
#include <Kernel/PerformanceManager.h>
|
||||
#include <Kernel/Process.h>
|
||||
@@ -179,8 +180,14 @@ RefPtr<Process> Process::create_kernel_process(RefPtr<Thread>& first_thread, Str
|
||||
auto process = Process::create(first_thread, move(name), (uid_t)0, (gid_t)0, ProcessID(0), true);
|
||||
if (!first_thread || !process)
|
||||
return {};
|
||||
#if ARCH(I386)
|
||||
first_thread->tss().eip = (FlatPtr)entry;
|
||||
first_thread->tss().esp = FlatPtr(entry_data); // entry function argument is expected to be in tss.esp
|
||||
#else
|
||||
(void)entry;
|
||||
(void)entry_data;
|
||||
PANIC("Process::create_kernel_process() not implemented");
|
||||
#endif
|
||||
|
||||
if (process->pid() != 0) {
|
||||
process->ref();
|
||||
@@ -640,9 +647,15 @@ RefPtr<Thread> Process::create_kernel_thread(void (*entry)(void*), void* entry_d
|
||||
if (!joinable)
|
||||
thread->detach();
|
||||
|
||||
#if ARCH(I386)
|
||||
auto& tss = thread->tss();
|
||||
tss.eip = (FlatPtr)entry;
|
||||
tss.esp = FlatPtr(entry_data); // entry function argument is expected to be in tss.esp
|
||||
#else
|
||||
(void)entry;
|
||||
(void)entry_data;
|
||||
PANIC("Process::create_kernel_thread() not implemented");
|
||||
#endif
|
||||
|
||||
ScopedSpinLock lock(g_scheduler_lock);
|
||||
thread->set_state(Thread::State::Runnable);
|
||||
|
||||
Reference in New Issue
Block a user