From owner-freebsd-current Mon Oct 21 10:56:46 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6313E37B401 for ; Mon, 21 Oct 2002 10:56:44 -0700 (PDT) Received: from ns.yogotech.com (ns.yogotech.com [206.127.123.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6328F43E7B for ; Mon, 21 Oct 2002 10:56:37 -0700 (PDT) (envelope-from nate@yogotech.com) Received: from emerger.yogotech.com (emerger.yogotech.com [206.127.123.131]) by ns.yogotech.com (8.9.3/8.9.3) with ESMTP id LAA20771; Mon, 21 Oct 2002 11:56:27 -0600 (MDT) (envelope-from nate@yogotech.com) Received: (from nate@localhost) by emerger.yogotech.com (8.12.5/8.12.5) id g9LHuOIC026570; Mon, 21 Oct 2002 11:56:24 -0600 (MDT) (envelope-from nate) From: Nate Williams MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15796.16327.363187.40794@emerger.yogotech.com> Date: Mon, 21 Oct 2002 11:56:23 -0600 To: Mitsuru IWASAKI Cc: bde@zeta.org.au, current@FreeBSD.ORG Subject: Re: [PATCH] Workaround for bogus INT 12H BIOS service implementation In-Reply-To: <20021022.003512.15273101.iwasaki@jp.FreeBSD.org> References: <20020930.234044.43000637.iwasaki@jp.FreeBSD.org> <20021002214819.W362-100000@gamplex.bde.org> <20021002.232145.29470044.iwasaki@jp.FreeBSD.org> <20021022.003512.15273101.iwasaki@jp.FreeBSD.org> X-Mailer: VM 7.07 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid Reply-To: nate@yogotech.com (Nate Williams) Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > I've recalled that FreeBSD used RTC to determine base memory size in > old days. I've tested this method on my machines and confirmed it's > working well. If this is done, then FreeBSD won't work on many laptops and other desktops, which report 640K for memory, but the BIOS actually steals some of the memory for things like APM, so when the VM86 call is done the reported memory size is actually like (like 637K or something). This change may break FreeBSD on these 'newer' hardware as well. Nate > I'll commit this coming weekend if no objections. > > Thanks > > Index: machdep.c > =================================================================== > RCS file: /home/ncvs/src/sys/i386/i386/machdep.c,v > retrieving revision 1.541 > diff -u -r1.541 machdep.c > --- machdep.c 5 Oct 2002 14:36:14 -0000 1.541 > +++ machdep.c 21 Oct 2002 15:27:02 -0000 > @@ -1284,8 +1284,14 @@ > /* > * Perform "base memory" related probes & setup > */ > - vm86_intcall(0x12, &vmf); > - basemem = vmf.vmf_ax; > + if ((basemem = rtcin(RTC_BASELO) + (rtcin(RTC_BASEHI)<<8)) > 640) > + basemem = 640; > + > + if (basemem == 0) { > + vm86_intcall(0x12, &vmf); > + basemem = vmf.vmf_ax; > + } > + > if (basemem > 640) { > printf("Preposterous BIOS basemem of %uK, truncating to 640K\n", > basemem); > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-current" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message