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

Kernel: Take some baby steps towards x86_64

Make more of the kernel compile in 64-bit mode, and make some things
pointer-size-agnostic (by using FlatPtr.)

There's a lot of work to do here before the kernel will even compile.
This commit is contained in:
Andreas Kling 2021-02-25 16:18:36 +01:00
parent eb08a0edd5
commit 8f70528f30
12 changed files with 187 additions and 118 deletions

View file

@ -87,11 +87,11 @@ int Process::sys$module_load(Userspace<const char*> user_path, size_t path_lengt
case R_386_PC32: {
// PC-relative relocation
dbgln("PC-relative relocation: {}", relocation.symbol().name());
u32 symbol_address = address_for_kernel_symbol(relocation.symbol().name());
auto symbol_address = address_for_kernel_symbol(relocation.symbol().name());
if (symbol_address == 0)
missing_symbols = true;
dbgln(" Symbol address: {:p}", symbol_address);
ptrdiff_t relative_offset = (char*)symbol_address - ((char*)&patch_ptr + 4);
ptrdiff_t relative_offset = (FlatPtr)symbol_address - ((FlatPtr)&patch_ptr + 4);
patch_ptr = relative_offset;
break;
}