Date: Mon, 21 Oct 2002 11:56:23 -0600 From: Nate Williams <nate@yogotech.com> To: Mitsuru IWASAKI <iwasaki@jp.FreeBSD.org> Cc: bde@zeta.org.au, current@FreeBSD.ORG Subject: Re: [PATCH] Workaround for bogus INT 12H BIOS service implementation Message-ID: <15796.16327.363187.40794@emerger.yogotech.com> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15796.16327.363187.40794>