mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28: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:
parent
f2eb759901
commit
38fca26f54
21 changed files with 295 additions and 40 deletions
42
Kernel/Arch/x86/common/CPU.cpp
Normal file
42
Kernel/Arch/x86/common/CPU.cpp
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/Assertions.h>
|
||||
#include <AK/Types.h>
|
||||
#include <Kernel/Arch/x86/CPU.h>
|
||||
#include <Kernel/Arch/x86/Processor.h>
|
||||
#include <Kernel/Arch/x86/TrapFrame.h>
|
||||
#include <Kernel/KSyms.h>
|
||||
#include <Kernel/Process.h>
|
||||
|
||||
void __assertion_failed(const char* msg, const char* file, unsigned line, const char* func)
|
||||
{
|
||||
asm volatile("cli");
|
||||
critical_dmesgln("ASSERTION FAILED: {}", msg);
|
||||
critical_dmesgln("{}:{} in {}", file, line, func);
|
||||
|
||||
abort();
|
||||
}
|
||||
|
||||
[[noreturn]] void abort()
|
||||
{
|
||||
// Switch back to the current process's page tables if there are any.
|
||||
// Otherwise stack walking will be a disaster.
|
||||
auto process = Process::current();
|
||||
if (process)
|
||||
MM.enter_process_paging_scope(*process);
|
||||
|
||||
Kernel::dump_backtrace();
|
||||
Processor::halt();
|
||||
|
||||
abort();
|
||||
}
|
||||
|
||||
[[noreturn]] void _abort()
|
||||
{
|
||||
asm volatile("ud2");
|
||||
__builtin_unreachable();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue