Immediate effect of loading CR3
Posted: Sat Dec 18, 2010 3:17 pm
Hi everyone ! Long time no see...
It's been close to a year since I started designing my OS, and I'm close to having some complete memory management system. I can now allocate arbitrary amounts of memory to the kernel and arbitrary PIDs, kill innocent PIDs, set up shared memory between them... In short, this part is soon completed, and I'm happy I managed to get this far.
But before I close this chapter and start to write automated regression tests to stress-test future patches, there's a last thing which I would like to implement : some code which switches from the kernel's address space to that of another process.
I did not manage to find a relevant part of the AMD doc on the topic of context switches, so I would like to check that my vision of it is correct.
Is that right that when a new value of CR3 is loaded, the CPU does not immediately make the switch to the new address space, but that instead a long jump is necessary before the new value of CR3 is "acknowledged" ? Just like back in the day where I enabled long mode, a long time ago ?
It's been close to a year since I started designing my OS, and I'm close to having some complete memory management system. I can now allocate arbitrary amounts of memory to the kernel and arbitrary PIDs, kill innocent PIDs, set up shared memory between them... In short, this part is soon completed, and I'm happy I managed to get this far.
But before I close this chapter and start to write automated regression tests to stress-test future patches, there's a last thing which I would like to implement : some code which switches from the kernel's address space to that of another process.
I did not manage to find a relevant part of the AMD doc on the topic of context switches, so I would like to check that my vision of it is correct.
Is that right that when a new value of CR3 is loaded, the CPU does not immediately make the switch to the new address space, but that instead a long jump is necessary before the new value of CR3 is "acknowledged" ? Just like back in the day where I enabled long mode, a long time ago ?