~ wrote:
Can I access unmapped addresses from the page fault handler?
Or do I need to disable paging entirely in CR0 (bit 31==0)?
If you mean "When I get a not-present fault for a virtual address, can I access the faulting virtual address from the page fault handler?", then the answer is, by definition, no. You haven't told the MMU what physical page you want mapped to that virtual address, so that address doesn't correspond to any actual memory, so there's nothing at that address to access. Even disabling paging won't help, because all that will do is access a physical address for you, but that physical address won't be related in any way to the faulting virtual address, other than that they happen to be represented by the same string of bits.
If you mean, "Can I access arbitrary pages of physical memory from a page fault handler, such as the page I plan to use for a virtual address that's being swapped in?", the the answer is "not directly by their physical address, but you can map them in the course of handling the page fault, or, if physical memory is much smaller than the available virtual address space, you can premap all of physical memory at some offset in kernelspace".