forksyscall on Linux). Instead of doing the copying directly, you can also implement a copy-on-write scheme by setting all pages as read-only and copying them as soon as they're accessed (by detecting this situation in your page fault handler). Then you can allocate a new stack for the process, map it to the new page table hierarchy, and add the new process to the scheduler. When loading the new process, the scheduler reloads the CR3 register with the level 4 table of the process and then jumps to the defined entry point.
@onbjerg Hey, great to hear that you like the blog! The 2nd edition isn't abandoned, I'm still keeping it updated for the latest Rust nightlies. It won't receive new posts though because I'm working on a new 3rd edition right now.
The 3rd edition is mostly motivated by supporting UEFI, which requires some fundamental changes to the first few posts. The rest of the posts will be very similar to the 2nd edition, so it won't be as different as the 1st edition -> 2nd edition switch. It should also be relatively easy to migrate from the 2nd to the 3rd edition.
x86_64and its when zeroing pagetable entries.
Hey everyone, I'm following the guide but I'm stuck at the testing part, not sure what's wrong :thinking: