Using only part of physical memory

Joseph Moran mojo at legato.com
Thu Jul 26 12:44:14 AEST 1990


In article <10131 at brazos.Rice.edu> roy at alanine.phri.nyu.edu (Roy Smith) writes:

>Is there any easy way to tell SunOS to only use a fraction of the
>available physical memory?

To do this you need to patch the kernel's "physmem" variable to be the
maximum number of pages you want the system to use.  If physmem is 0 at
boot time (the normal case), then the kernel uses the memory as sized by
the PROM monitor.  If physmem is larger than the number of pages found by
the monitor, the kernel uses the smaller of the two numbers.  Remember
that for the sun3, sun3x, and sun4 architectures, the page size is 8k
(0x2000) while for the "sun4c" architectures (SPARCstation 1's, and SLC's)
the page size is 4k (0x1000).

For example, if you want to use only 6 Mb on a 8 Mb Sun-3 system, patch
physmem to be 0x600000 / 0x2000 = 0x300.  You can do this with adb as
shown here.

	machine# cp /vmunix /vmunix.orig
	machine# adb -w /vmunix -
	physmem?W 600000%2000
	_physmem:       0x0             =       0x300
	$q
	machine# fastboot


Joseph Moran
Legato Systems Inc.
mojo at Legato.COM or {sun,uunet}!legato!mojo



More information about the Comp.sys.sun mailing list