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

Kernel: Use ksyms in-place instead of duplicating them into eternal heap

We can leave the .ksyms section mapped-but-read-only and then have the
symbols index simply point into it.

Note that we manually insert null-terminators into the symbols section
while parsing it.

This gets rid of ~950 KiB of kmalloc_eternal() at startup. :^)
This commit is contained in:
Andreas Kling 2021-12-17 09:52:06 +01:00
parent abf2204402
commit 1f2d0d0ad4
4 changed files with 11 additions and 13 deletions

View file

@ -336,8 +336,8 @@ void init_stage2(void*)
// NOTE: Everything marked UNMAP_AFTER_INIT becomes inaccessible after this point.
MM.unmap_text_after_init();
// NOTE: Everything in the .ksyms section becomes inaccessible after this point.
MM.unmap_ksyms_after_init();
// NOTE: Everything in the .ksyms section becomes read-only after this point.
MM.protect_ksyms_after_init();
// FIXME: It would be nicer to set the mode from userspace.
// FIXME: It would be smarter to not hardcode that the first tty is the only graphical one