On 11/17/06, Bithika Khargharia <bithika@xxxxxxxxx> wrote:
Hi, 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?
Yes, Right. In kernel/protected_mode the memory is referenced/accessed through pages not from physical addresses and pages have pfn which is directly associated with physical address by PAGE_SHIFT bits
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?
The PFNs AFAIK must be 2097152 for 8GB RAM, have you tried to do read/kmap physical-memory representing by PFN greater-than 2097152 ? TOTAL_PHYS is the term you are referring for total-physical-memory or its used in the kernel too ? as I not able to find-out that TOTAL_PHYS in kernel sources. AFAIR max_mapnr variable (if CONFIG_DISCONTIGMEM isn't defined) can tell maximum number of pages (of physical-memory) available in system/kernel which actually calculated during memory initialization at boot-time. If still not able to get things correctly then please provide you kernel version number and config file. -- Fawad Lateef -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/