mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 20:17:44 +00:00
Kernel: Add mechanism to make some memory read-only after init finishes
You can now use the READONLY_AFTER_INIT macro when declaring a variable and we will put it in a special ".ro_after_init" section in the kernel. Data in that section remains writable during the boot and init process, and is then marked read-only just before launching the SystemServer. This is based on an idea from the Linux kernel. :^)
This commit is contained in:
parent
917f7d668c
commit
d8013c60bb
5 changed files with 28 additions and 0 deletions
|
@ -34,6 +34,8 @@
|
|||
#include <Kernel/VirtualAddress.h>
|
||||
#include <LibC/sys/arch/i386/regs.h>
|
||||
|
||||
#define READONLY_AFTER_INIT __attribute__((section(".ro_after_init")))
|
||||
|
||||
#define PAGE_SIZE 4096
|
||||
#define GENERIC_INTERRUPT_HANDLERS_COUNT (256 - IRQ_VECTOR_BASE)
|
||||
#define PAGE_MASK ((FlatPtr)0xfffff000u)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue