1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 09:58:14 +00:00

Fix dumb-but-hard-to-find bug in paging.

This was the fix:

-process.m_page_directory[0] = m_kernel_page_directory[0];
-process.m_page_directory[1] = m_kernel_page_directory[1];
+process.m_page_directory->entries[0] = m_kernel_page_directory->entries[0];
+process.m_page_directory->entries[1] = m_kernel_page_directory->entries[1];

I spent a good two hours scratching my head, not being able to figure out why
user process page directories felt they had ownership of page tables in the
kernel page directory.

It was because I was copying the entire damn kernel page directory into
the process instead of only sharing the two first PDE's. Dang!
This commit is contained in:
Andreas Kling 2018-11-03 00:31:42 +01:00
parent 8accc92c3c
commit b59ce22fc5
5 changed files with 113 additions and 38 deletions

View file

@ -93,6 +93,15 @@ public:
m_impl = nullptr;
}
bool contains_slow(const T& value) const
{
for (size_t i = 0; i < size(); ++i) {
if (at(i) == value)
return true;
}
return false;
}
bool isEmpty() const { return size() == 0; }
size_t size() const { return m_impl ? m_impl->size() : 0; }
size_t capacity() const { return m_impl ? m_impl->capacity() : 0; }