mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 02:03:06 -05:00
Kernel: Only clone the bottom 2MB of mappings from kernel to processes
This commit is contained in:
parent
122c76d7fa
commit
536c0ff3ee
Notes:
sideshowbarker
2024-07-19 10:00:15 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/536c0ff3ee0
1 changed files with 4 additions and 4 deletions
|
@ -62,12 +62,12 @@ PageDirectory::PageDirectory(Process& process, const RangeAllocator* parent_rang
|
||||||
MM.unquickmap_page();
|
MM.unquickmap_page();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clone bottom 8 MB of mappings from kernel_page_directory
|
// Clone bottom 2 MB of mappings from kernel_page_directory
|
||||||
PageDirectoryEntry buffer[4];
|
PageDirectoryEntry buffer;
|
||||||
auto* kernel_pd = MM.quickmap_pd(MM.kernel_page_directory(), 0);
|
auto* kernel_pd = MM.quickmap_pd(MM.kernel_page_directory(), 0);
|
||||||
memcpy(buffer, kernel_pd, sizeof(PageDirectoryEntry) * 4);
|
memcpy(&buffer, kernel_pd, sizeof(PageDirectoryEntry));
|
||||||
auto* new_pd = MM.quickmap_pd(*this, 0);
|
auto* new_pd = MM.quickmap_pd(*this, 0);
|
||||||
memcpy(new_pd, buffer, sizeof(PageDirectoryEntry) * 4);
|
memcpy(new_pd, &buffer, sizeof(PageDirectoryEntry));
|
||||||
|
|
||||||
InterruptDisabler disabler;
|
InterruptDisabler disabler;
|
||||||
cr3_map().set(cr3(), this);
|
cr3_map().set(cr3(), this);
|
||||||
|
|
Loading…
Add table
Reference in a new issue