Page 1 of 1

Do OS need page table for itself? Physical address mode.

Posted: Mon Sep 05, 2011 8:36 am
by tushs
Many books and web links talk about nightmare of kernel using virtual address, like,
http://www.science.unitn.it/~fiorella/g ... ode31.html
But after enabling paging kernel is using all virtual address [it is fact that it knows corresponding physical addresses], OR at least need to be Identity mapped. I am not able to understand about which physical mode they are talking about..
It does not make much sense for the operating system itself to run in virtual memory. This would be a nightmare situation where the operating system must maintain page tables for itself. Most multi-purpose CPUs support the notion of a physical address mode as well as a virtual address mode. Physical addressing mode requires no page tables and the CPU does not attempt to perform any address translations in this mode. The Linux kernel is linked to run in physical address space.
how can cpu will not make translation after enabling paging? Is paging is disabled in kernel ?

Re: Do OS need page table for itself? Physical address mode.

Posted: Mon Sep 05, 2011 11:07 am
by Combuster
Wherever you got that quote from, it's nonsense. The typical kernel uses paging for itself for the same reasons one would want to use paging for userland applications: memory management and protection from its programmers. x86 incurs more overhead by disabling and enabling paging compared to just living with it enabled, and in each of those cases you still need to pass through a paged kernel mode to disable paging.

Re: Do OS need page table for itself? Physical address mode.

Posted: Mon Sep 05, 2011 12:14 pm
by AJ
Hi,

It looks like that online book was written 14 years ago, and relates to the Alpha AXP processor. This is not something I am familiar with, but the quote may make more sense if you look at it from that context. As Combuster says, for the IAxx architectures, the quote is complete nonsense.

Cheers,
Adam

Re: Do OS need page table for itself? Physical address mode.

Posted: Mon Sep 05, 2011 1:51 pm
by Combuster
Even for a DEC Alpha, you'd nowadays want to use paging in the kernel by default instead of running from it :wink:

Re: Do OS need page table for itself? Physical address mode.

Posted: Wed Sep 07, 2011 12:22 am
by tushs
Got it. thank u.