Subject: Question concerning discontinuities in memory map.

From: Jeff Harrell <[email-masked]>
Date: Fri, 25 Aug 2000 16:50:15 -0600

I have a question concerning a discontinuity in my memory map.  The
development board that I am
working on currently has the start of its SDRAM at 0x14000000 (physical
memory).  It looks like a
lot of the code is written under the assumption that the base of the
kernel will be at 0x80000000.  I
have had to modify several sections of code to handle this discontinuity
with respect to max_low_pfn,
high_memory, num_physpages  max_mapnr, and low (/arch/mips/mm/init.c).
These variables seem
to use the PAGE_SHIFT variable to locate the start of that page in
physical memory: (e.g.,   max_mapnr
<< PAGE_SHIFT).  It looks like a lot of the problem stems from
max_low_pfn.  In init_bootmem_core:

----8<  snippet from init_bootmem_core ( mm/bootmem.c) 8<----------

     static unsigned long __init init_bootmem_core (bootmem_data_t
     *bdata,
               unsigned long mapstart, unsigned long start,
     unsigned long end)
       {
               unsigned long mapsize = ((end - start)+7)/8;

               mapsize = (mapsize + (sizeof(long) - 1UL)) &
     ~(sizeof(long) - 1UL);
               bdata->node_bootmem_map = phys_to_virt(mapstart <<
     PAGE_SHIFT);
               bdata->node_boot_start = (start << PAGE_SHIFT);
               bdata->node_low_pfn = end;
       ...

----------------------------------------------------

the mapsize is defined by end-start, where start is the _end
(kernel_end) + bootmap_size.
therefore it looks like end should represent the end of memory (i.e.
SDRAM).  In our case
this is 0x15FFFFFF (i.e. 32M).  If I let the rest of the kernel process
max_low_pfn and the
associated variable normally,  the paging routines will calculate that I
have 335M of memory!
I seem to be chasing this problem through the kernel.  Is there a
central place in the code that
would handle the offset properly?  I don't think I have caught all of
the implications of this change
yet because I am still failing in the paging routines.  Any information
that is available on how this
can be accomplished would be greatly appreciated.

Thanks,
Jeff

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jeff Harrell                    Work:  (801) 619-6104
Broadband Access group/TI       Cell:  (801) 597-6268
[email-masked]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~