Subject: port-i386/1831: i386 doesn't probe memory correctly
To: None <gnats-bugs@gnats.netbsd.org>
From: None <downsj@teeny.org>
List: netbsd-bugs
Date: 12/12/1995 02:48:08
>Number:         1831
>Category:       port-i386
>Synopsis:       i386 port trusts the BIOS explicitly
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 12 05:50:02 1995
>Last-Modified:
>Originator:     Jason Downs
>Organization:
	teeny.org: Free Software for a Free Internet
>Release:        1.1
>Environment:
System: NetBSD threadway.teeny.org 1.1 NetBSD 1.1 (THREADWAY) #4: Tue Dec 12 00:00:27 PST 1995 root@threadway.teeny.org:/usr/src/sys/arch/i386/compile/THREADWAY i386


>Description:
	NetBSD/i386 1.1 accepts the amount of memory returned by the BIOS.
BIOS' can lie, sometimes without any way of convincing them not to.  This
causes *much* lossage on some machines.
>How-To-Repeat:
	boot NetBSD on most Compaq's with >16mb.  The OS will only find 16mb.
>Fix:
	I worked around this with a compile time option.  Some sort of
probing should be done, instead.

options		EXTRA_EXTMEM=8192

/usr/src/sys/arch/i386/i386/machdep.c:
*** machdep.c.orig	Sun Oct 15 19:43:28 1995
--- machdep.c	Mon Dec 11 11:09:45 1995
***************
*** 1098,1103 ****
--- 1098,1110 ----
  	    mc146818_read(NULL, NVRAM_BASELO);
  	biosextmem = (mc146818_read(NULL, NVRAM_EXTHI) << 8) |
  	    mc146818_read(NULL, NVRAM_EXTLO);
+ #ifdef EXTRA_EXTMEM
+ 	/*
+ 	 * Some BIOS' (Compaq) don't report the correct amount of memory...
+ 	 * For instance, mine loses 8mb.  EXTRA_EXTMEM is in k.
+ 	 */
+ 	biosextmem += EXTRA_EXTMEM;
+ #endif		/* EXTRA_EXTMEM */
  
  	/* Round down to whole pages. */
  	biosbasemem &= -(NBPG / 1024);
>Audit-Trail:
>Unformatted: