1. I checked the ARCH_PFN_OFFSET variable for my kernel and it was set to 0. In that case the kernel should generate PFN serially from 0 to TOTAL_PHYS. Am I right?
2. What confuses me is the following. I know that I have 8 GB of memory physically installed on my System. 8 GB should translate to a PFN of 2097152
(8 * 2^30)/4 where 4KB is the PAGE_SIZE in my system. However the kernel gives a TOTAL_PHYS value of 2411724 which is almost equal to 9.2 GB of memory. If PFNs are generated serially why do I have this problem of higher PFNs that 8 GB?
Thanks
Bithika
On 11/15/06, Fawad Lateef <fawadlateef@xxxxxxxxx> wrote:
On 11/15/06, Bithika Khargharia <bithika@xxxxxxxxx> wrote:
> Hi,
>
> 1. Given the PFN, how do I obtain the base physical address for the PFN.
>
> I use
> 'pfn <<12'.
>
> Is this correct?
Yes 'pfn << PAGE_SHIFT' gives physical-base-address although its
better to use page_to_phys macro
>
> 2. Does the kernel generate PFN serailly from 0 to TOTAL_PHYS or are there
> breaks in between?
>
Yes serially for x86 from 0UL but might contain some starting offset
according to some architectures. Take a look at page_to_phys macro
( http://lxr.free-electrons.com/source/include/asm-i386/io.h#101) and
__page_to_pfn macro
(http://lxr.free-electrons.com/source/include/asm-generic/memory_model.h#032 )
--
Fawad Lateef
--
O for a Life of Sensations rather than of Thoughts!-- Keats