Enabling paging only in Ring 3
Posted: Tue Jul 28, 2020 5:47 pm
Hey guys.
I'm developing an OS for 80386 and am currently looking to implement paging. However I want logical addresses to be generated only in Userland (Ring 3) and all addresses in ring 0 to be physical. Is this possible and if yes, how can I do so?
I understand that paging gets enabled upon setting PG in CR0. If I set the bit right before my IRET, then the stack pointer address (esp) used by IRET for retrieving the CS, IP, EFLAGS, ESP, SS etc is also logical right? Any way to make sure logical addressing is used only after IRET completes?
I'm developing an OS for 80386 and am currently looking to implement paging. However I want logical addresses to be generated only in Userland (Ring 3) and all addresses in ring 0 to be physical. Is this possible and if yes, how can I do so?
I understand that paging gets enabled upon setting PG in CR0. If I set the bit right before my IRET, then the stack pointer address (esp) used by IRET for retrieving the CS, IP, EFLAGS, ESP, SS etc is also logical right? Any way to make sure logical addressing is used only after IRET completes?