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

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
tushs
Member
Member
Posts: 28
Joined: Mon Aug 02, 2010 7:43 am

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

Post 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 ?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

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

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

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

Post 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
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

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

Post 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:
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
tushs
Member
Member
Posts: 28
Joined: Mon Aug 02, 2010 7:43 am

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

Post by tushs »

Got it. thank u.
Post Reply