Linux MIPS Architecture development
 help / color / mirror / Atom feed
* Question concerning memory configuration variables
@ 2000-02-01 16:45 Jeff Harrell
  2000-02-02  1:17 ` Ralf Baechle
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Harrell @ 2000-02-01 16:45 UTC (permalink / raw)
  To: sgi-mips

I have been looking at 2.2.23 and noticed that a few things concerning
memory
paging has changed.  I wonder if anybody could give me a definition of a
couple
of the variables that are defined.  The first is the max_low_pfn
variable.  It looks
like the first time that I see this called is during the paging_init()
function and
passed to free_area_init().   The memory map size is determined from
this variable.
It memory map will extend to the end of physical memory (what used to be
mips_memory_
upper).  Do I determine the max_low_pfn by calculating the available
memory and subtract
the size of the kernel?  How does the variable "start" play into this
equation?  Are they
the same?  Any help would be greatly appreciated.

Thanks,
Jeff

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Jeff Harrell                    Work:  (801) 619-6104
Broadband Access group/TI
jharrell@ti.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Question concerning memory configuration variables
  2000-02-01 16:45 Question concerning memory configuration variables Jeff Harrell
@ 2000-02-02  1:17 ` Ralf Baechle
  0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2000-02-02  1:17 UTC (permalink / raw)
  To: Jeff Harrell; +Cc: linux, linux-mips, linux-mips

On Tue, Feb 01, 2000 at 09:45:25AM -0700, Jeff Harrell wrote:

> I have been looking at 2.2.23 and noticed that a few things concerning
> memory paging has changed.  I wonder if anybody could give me a definition
> of a couple of the variables that are defined.  The first is the
> max_low_pfn variable.  It looks like the first time that I see this called
> is during the paging_init() function and passed to free_area_init().  The
> memory map size is determined from this variable.  It memory map will
> extend to the end of physical memory (what used to be mips_memory_ upper).
> Do I determine the max_low_pfn by calculating the available memory and
> subtract the size of the kernel?  How does the variable "start" play into
> this equation?  Are they the same?  Any help would be greatly appreciated.

The max_low_pfn variable is the number of `normal' memory pages.  Normal
as opposed to high memory which we don't currently don't support on MIPS.
That is for contiguous memory starting at physical address zero it's
value equals available_memory / PAGE_SIZE.

The value of max_low_pfn is set by a call to init_bootmem.  A typical
setup could look like below.  Mb in this example is the number of
available megabytes of memory.  You may simplify this somewhat more,
it's derived from the Origin code.

        free_start = PFN_ALIGN(&_end) - PAGE_OFFSET;
        free_end = PAGE_OFFSET + (mb << 20);
        start_pfn = PFN_UP((unsigned long)&_end - PAGE_OFFSET);

        /* Register all the contiguous memory with the bootmem allocator
           and free it.  Be careful about the bootmem freemap.  */
        bootmap_size = init_bootmem(start_pfn, mb << (20 - PAGE_SHIFT));

	/* Free the entire available memory after the _end symbol.  */
        free_bootmem(__pa(free_start), (mb << 20) - __pa(free_start));

	/* We also did free the memory where the bootmap is stored,
	   reserve it again. */
        reserve_bootmem(__pa(free_start), bootmap_size);

        printk("Found %ldmb of memory.\n", mb);

  Ralf

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-02-02  1:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-02-01 16:45 Question concerning memory configuration variables Jeff Harrell
2000-02-02  1:17 ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox