1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 19:45:07 +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

@ -228,10 +228,14 @@ bool Scheduler::pick_next()
auto& thread_to_schedule = pull_next_runnable_thread();
if constexpr (SCHEDULER_DEBUG) {
#if ARCH(I386)
dbgln("Scheduler[{}]: Switch to {} @ {:04x}:{:08x}",
Processor::id(),
thread_to_schedule,
thread_to_schedule.tss().cs, thread_to_schedule.tss().eip);
#else
PANIC("Scheduler::pick_next() not implemented");
#endif
}
// We need to leave our first critical section before switching context,
@ -571,14 +575,22 @@ void dump_thread_list()
dbgln("Scheduler thread list for processor {}:", Processor::id());
auto get_cs = [](Thread& thread) -> u16 {
#if ARCH(I386)
if (!thread.current_trap())
return thread.tss().cs;
#else
PANIC("get_cs() not implemented");
#endif
return thread.get_register_dump_from_stack().cs;
};
auto get_eip = [](Thread& thread) -> u32 {
#if ARCH(I386)
if (!thread.current_trap())
return thread.tss().eip;
#else
PANIC("get_eip() not implemented");
#endif
return thread.get_register_dump_from_stack().eip;
};