Recursive paging. If the page directory contains a self reference then
the page tables will appear in the logical address space.
For example, if the self reference is the last entry of the page dir then
the page tables appear in the highest 4M. To obtain the physical
page for a logical address shift the address by 12 and index the
array at FFC00000.
Fortunately, that's only useful as a debug tool, so the speed is
irrelevant.
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.
But that's not gonna help in any way (except for performance -- you
don't need map page tables as page frames to access them).
> To obtain the physical
> page for a logical address shift the address by 12 and index the
> array at FFC00000.
Right, but this is almost useless (except as noted above) since he
needs to do a reverse look up: given the physical adress (which is in
the PTE) he wants to find the corresponding virtual address (which is
the path from the top-most page directory to this PTE). So, he'd need
to scan all these 4MB in the worst case scenario to find the VA that
refers to the given PA.
I'd add a data structure for this. A binary tree probably, whose nodes
would describe subranges of the virtual address space which are mapped
to physically contiguous memory. That should speed things up
considerably.
But there's a catch. If any physical page is mapped in several places
in the address space, then there needs to be some logic around that
(e.g. one should either prohibit this or find multiple mappings to the
same physical page and decide what to do with each of them).
Alex
"Dick Wesseling" <fr...@MUNGED.microcosmotalk.com> wrote in message
news:4b13ee13$0$4860$9a6e...@unlimited.newshosting.com...
I think the question though was about reverse mapping...
note that with just this information, it would still be a problem to do a
reverse-lookup efficiently (granted, even a linear search would not likely
be that bad for likely "typical" uses).
it could be helped some using a hash table, where a hash is used to help map
addresses, assuming that addresses follow the "typical" distribution (as in,
lots of accesses to the same spots).
otherwise...
one might need some sort of inverse page table...
or such...
You are right, I misread the original posting.
As alex said, I also believe I need to read all the PDE. sometimes,
one physical address are mapped with several virutal addresses.
But is this a good feature for my debugger?
thanks
from Peter