mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 21:17:45 +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
|
@ -43,6 +43,13 @@ SECTIONS
|
|||
end_of_kernel_data = .;
|
||||
}
|
||||
|
||||
.ro_after_init ALIGN(4K) (NOLOAD) : AT(ADDR(.ro_after_init) - 0xc0000000)
|
||||
{
|
||||
start_of_ro_after_init = .;
|
||||
*(.ro_after_init);
|
||||
end_of_ro_after_init = .;
|
||||
}
|
||||
|
||||
.bss ALIGN(4K) (NOLOAD) : AT (ADDR(.bss) - 0xc0000000)
|
||||
{
|
||||
start_of_kernel_bss = .;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue