From owner-freebsd-current Sun Sep 29 15: 0:20 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 EDE7F37B401 for ; Sun, 29 Sep 2002 15:00:17 -0700 (PDT) Received: from tasogare.imasy.or.jp (tasogare.imasy.or.jp [202.227.24.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id D7AF343E42 for ; Sun, 29 Sep 2002 15:00:15 -0700 (PDT) (envelope-from iwasaki@jp.FreeBSD.org) Received: from localhost (iwa@tasogare.imasy.or.jp [202.227.24.5]) by tasogare.imasy.or.jp (8.11.6+3.4W/8.11.6/tasogare) with ESMTP/inet id g8TM0BY41687 for ; Mon, 30 Sep 2002 07:00:12 +0900 (JST) (envelope-from iwasaki@jp.FreeBSD.org) Date: Mon, 30 Sep 2002 07:00:03 +0900 (JST) Message-Id: <20020930.070003.70227125.iwasaki@jp.FreeBSD.org> To: current@FreeBSD.ORG Subject: [PATCH] Workaround for bogus INT 12H BIOS service implementation From: Mitsuru IWASAKI X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 Hi, I've found that some recent machine's BIOS doesn't support INT 12H (Get base memory size) BIOS service, instead they seems to support SMAP (system memory map: INT 15H function e820H) for this purpose. I already checked that there is no problems on Linux or Windows or others, but FreeBSD won't boot at all. I'll report bogus INT 12H BIOS service implementation to BIOS vendors if I get chances. On the other hand, I think we need to have a workaround in a safety way for this problem for newer machines. Here is the patches. I'll commit them in a few days if no objection. Thanks Index: sys/boot/i386/boot2/boot2.c =================================================================== RCS file: /home/ncvs/src/sys/boot/i386/boot2/boot2.c,v retrieving revision 1.44 diff -u -r1.44 boot2.c --- sys/boot/i386/boot2/boot2.c 1 Sep 2002 21:29:10 -0000 1.44 +++ sys/boot/i386/boot2/boot2.c 29 Sep 2002 21:16:19 -0000 @@ -231,7 +231,7 @@ dsk.slice = *(uint8_t *)PTOV(ARGS + 1) + 1; bootinfo.bi_version = BOOTINFO_VERSION; bootinfo.bi_size = sizeof(bootinfo); - bootinfo.bi_basemem = memsize(MEM_BASE); + bootinfo.bi_basemem = 0; /* XXX will be filled at loader or kernel */ bootinfo.bi_extmem = memsize(MEM_EXT); bootinfo.bi_memsizes_valid++; for (i = 0; i < N_BIOS_GEOM; i++) Index: sys/boot/i386/loader/main.c =================================================================== RCS file: /home/ncvs/src/sys/boot/i386/loader/main.c,v retrieving revision 1.25 diff -u -r1.25 main.c --- sys/boot/i386/loader/main.c 5 Nov 2001 19:03:01 -0000 1.25 +++ sys/boot/i386/loader/main.c 29 Sep 2002 21:01:51 -0000 @@ -129,6 +129,10 @@ if (devsw[i]->dv_init != NULL) (devsw[i]->dv_init)(); printf("BIOS %dkB/%dkB available memory\n", bios_basemem / 1024, bios_extmem / 1024); + if (initial_bootinfo != NULL) { + initial_bootinfo->bi_basemem = bios_basemem / 1024; + initial_bootinfo->bi_extmem = bios_extmem / 1024; + } /* detect ACPI for future reference */ biosacpi_detect(); Index: sys/i386/i386/machdep.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/machdep.c,v retrieving revision 1.532 diff -u -r1.532 machdep.c --- sys/i386/i386/machdep.c 7 Sep 2002 19:12:42 -0000 1.532 +++ sys/i386/i386/machdep.c 29 Sep 2002 21:15:26 -0000 @@ -1269,8 +1269,12 @@ /* * Perform "base memory" related probes & setup */ - vm86_intcall(0x12, &vmf); - basemem = vmf.vmf_ax; + if (bootinfo.bi_basemem != 0) { + basemem = bootinfo.bi_basemem; + } else { + 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