You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When becoming the first process, we recycle the current page tables hierarchy as our process' page table hierarchy.
When doing so, the kernel treats it as if it was empty, associating an empty bookkeeping with it. However, the bootstrap is still mapped in UserLand at this point.
This creates a situation where the bookkeeping does not reflect the state of the page tables, and leads to a kernel panic as soon as we try to map something in the UserLand of the init process (for me it was its TLS).
There are at least two straight-forward ways to solve this:
Make the bookkeeping reflect the state of the page tables. This means iterating the page tables and reserving any found frame in the FrameAllocator, the same way do for the KernelLand.
Create a fresh ProcessMemory for the init process, and switch to it.
I have a preference for the second method, as it is simpler, even though it is a little bit less efficient.
The text was updated successfully, but these errors were encountered:
Second attempt at fixing sunriseos#314.
Compromise between leaking the bootstrap page tables, and reconstructing
full ProcessMemory.
Making InactiveHierarchy public so we can reconstruct one when becoming
the first process, instead of a ProcessMemory.
Deleting ProcessMemory::from_active_page_tables, since we don't use it.
Fixessunriseos#314
When becoming the first process, we recycle the current page tables hierarchy as our process' page table hierarchy.
When doing so, the kernel treats it as if it was empty, associating an empty bookkeeping with it. However, the bootstrap is still mapped in UserLand at this point.
This creates a situation where the bookkeeping does not reflect the state of the page tables, and leads to a kernel panic as soon as we try to map something in the UserLand of the init process (for me it was its TLS).
There are at least two straight-forward ways to solve this:
FrameAllocator
, the same way do for the KernelLand.I have a preference for the second method, as it is simpler, even though it is a little bit less efficient.
The text was updated successfully, but these errors were encountered: