1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:57:35 +00:00

Kernel: Allow modules to link against anything in kernel.map :^)

We now use the symbols from kernel.map to link modules as they are
loaded into the kernel. This is pretty fricken cool!
This commit is contained in:
Andreas Kling 2019-11-28 21:30:20 +01:00
parent 1f34e16ec6
commit 4ef6be8212
5 changed files with 27 additions and 20 deletions

View file

@ -19,6 +19,15 @@ static u8 parse_hex_digit(char nibble)
return 10 + (nibble - 'a');
}
u32 address_for_kernel_symbol(const char* name)
{
for (unsigned i = 0; i < ksym_count; ++i) {
if (!strcmp(name, s_ksyms[i].name))
return s_ksyms[i].address;
}
return 0;
}
const KSym* ksymbolicate(u32 address)
{
if (address < ksym_lowest_address || address > ksym_highest_address)