How do you setup paging, so you can page anywhere.. I'm wondering if you can page and "un-page" memory?
I'm wondering about any POC of properly setting up paging on x64 so I can understand properly
If I turn on paging, would the CPU only recognize addresses that map to a page? Like no physical addresses? As in paging the entire RAM or just certain parts?
I'm struggling to understand paging
understanding paging
-
- Member
- Posts: 5568
- Joined: Mon Mar 25, 2013 7:01 pm
Re: understanding paging
Yes, you are free to add and remove mappings at any time. On x86, you need to make sure you flush the TLB appropriately.newosdeveloper2021 wrote:I'm wondering if you can page and "un-page" memory?
It depends on the CPU. On x86, turning on paging means only the page tables use physical addresses, and everything else uses virtual addresses. In order to read or write data at a virtual address, your page tables have to specify which physical address to use for that virtual address. You don't have to specify a physical address for every virtual address.newosdeveloper2021 wrote:If I turn on paging, would the CPU only recognize addresses that map to a page? Like no physical addresses?
It's up to you. Some 64-bit operating systems map all of RAM somewhere only the kernel can access. Others only map memory that they're using, and leave unused memory unmapped.newosdeveloper2021 wrote:As in paging the entire RAM or just certain parts?