Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Jun 1999 13:24:14 -0400
From:      Richard Cownie <tich@ma.ikos.com>
To:        freebsd-current@freebsd.org, tich@par28.ma.ikos.com
Subject:   fix for 4GB dram
Message-ID:  <199906181724.NAA15730@par28.ma.ikos.com>

next in thread | raw e-mail | index | archive | help
I seem to have a fix for the 4GB dram problem.

Here's the SMAP info returned from the BIOS on an SC450NX with
4GB DRAM:

type=01  base= 00000000 00000000  len= 00000000 0009e400
type=02  base= 00000000 0009e400  len= 00000000 00001c00
type=02  base= 00000000 000f0400  len= 00000000 0000fc00
type=01  base= 00000000 00100000  len= 00000000 f9dfac00
type=03  base= 00000000 f9efac00  len= 00000000 00005000
type=04  base= 00000000 f9effc00  len= 00000000 00000400
type=02  base= 00000000 fe300000  len= 00000000 01d00000
type=01  base= 00000001 00000000  len= 00000000 06100000

Note that the chipset remaps some of the DRAM up above
the 4GB boundary - this entry in the table causes confusion,
because the base address gets truncated to 32bits (though
the comparison to detect non-monotonic entries is still 
64bits).

I added this code in /usr/src/sys/i386/i386/machdep.c:getmemsize()

		if (smap->type != 0x01)
			goto next_run;

		if (smap->length == 0)
			goto next_run;

+                if (*(u_int32_t *)((char *)&smap->base + 4) != 0) {
+		        if (boothowto & RB_VERBOSE) {
+                                printf("Memory above 4GB ignored\n");
+                        }
+                        goto next_run;
+                }


		for (i = 0; i <= physmap_idx; i += 2) {
			if (smap->base < physmap[i + 1]) {
				if (boothowto & RB_VERBOSE)
					printf(
	"Overlapping or non-monotonic memory region, ignoring second region\n");
				goto next_run;
			}
		}

Now it seems to work (with options MAXMEM="((4096-64)*1024)" - haven't
tried it with speculative memory probing yet).

Thanks to Jonathan Lemon for steering me in the right direction.

Richard Cownie (tich@ma.ikos.com)


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199906181724.NAA15730>