From owner-freebsd-current@FreeBSD.ORG Mon Aug 22 20:23:07 2005 Return-Path: X-Original-To: freebsd-current@FreeBSD.org 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 6528F16A41F; Mon, 22 Aug 2005 20:23:07 +0000 (GMT) (envelope-from jkim@FreeBSD.org) Received: from anuket.mj.niksun.com (gwnew.niksun.com [65.115.46.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id BC91843D46; Mon, 22 Aug 2005 20:23:06 +0000 (GMT) (envelope-from jkim@FreeBSD.org) Received: from niksun.com (anuket [10.70.0.5]) by anuket.mj.niksun.com (8.13.1/8.13.1) with ESMTP id j7MKRAlT070785; Mon, 22 Aug 2005 16:27:10 -0400 (EDT) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: John Baldwin Date: Mon, 22 Aug 2005 16:22:41 -0400 User-Agent: KMail/1.6.2 References: <20050813221234.GA23162@nargothrond.kdm.org> <200508221319.31025.jkim@FreeBSD.org> <200508221518.43770.jhb@FreeBSD.org> In-Reply-To: <200508221518.43770.jhb@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_VQjCD1EGYaKnbp8" Message-Id: <200508221622.45914.jkim@FreeBSD.org> X-Virus-Scanned: ClamAV 0.85.1/1035/Mon Aug 22 07:37:18 2005 on anuket.mj.niksun.com X-Virus-Status: Clean Cc: freebsd-current@FreeBSD.org, "Kenneth D. Merry" Subject: Re: BTX problems X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2005 20:23:07 -0000 --Boundary-00=_VQjCD1EGYaKnbp8 Content-Type: text/plain; charset="iso-8859-6" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Monday 22 August 2005 03:18 pm, John Baldwin wrote: > On Monday 22 August 2005 01:19 pm, Jung-uk Kim wrote: > > On Monday 22 August 2005 12:33 pm, Kenneth D. Merry wrote: > > > On Mon, Aug 22, 2005 at 12:16:51 -0400, Jung-uk Kim wrote: > > > > On Monday 22 August 2005 11:57 am, Kenneth D. Merry wrote: > > > > > On Mon, Aug 22, 2005 at 11:37:25 -0400, Jung-uk Kim wrote: > > > > > > On Saturday 20 August 2005 01:02 am, Kenneth D. Merry wrote: > > > > > > > On Tue, Aug 16, 2005 at 13:39:48 -0400, John Baldwin wrote: > > > > > > > > There haven't been a whole lot of changes. My guess > > > > > > > > would be the recently added smbios support. You can > > > > > > > > probably just comment out the call to smbios_detect() > > > > > > > > in sys/boot/i386/loader/main.c as a simple test for > > > > > > > > that. It could also possibly be the multiple console > > > > > > > > support in which case it would be easiest to just > > > > > > > > step your sys/boot tree back using CVS. The good > > > > > > > > news is that sys/boot is largely self-contained so > > > > > > > > you can step it back while keeping the rest of the > > > > > > > > tree up to date for testing purposes at least. > > > > > > > > > > > > > > Thanks for the tips! > > > > > > > > > > > > > > Commenting out smbios_detect() did the trick. The > > > > > > > loader works fine after that. > > > > > > > > > > > > > > So now what? Is there a way to fix it so it won't > > > > > > > crash on my system? > > > > > > > > > > > > So, I guess I broke it, then. Can you install > > > > > > ports/sysutils/dmidecode and send me dmidecode output? > > > > > > > > > > Sure, here it is. > > > > > > > > Okay, it looks good so far. Can you do: > > > > > > > > dd if=/dev/mem of=dmi.dat bs=1 count=1534 skip=984640 > > > > dd if=/dev/mem of=smbios.dat bs=1 count=65536 skip=983040 > > > > > > > > and send me dmi.dat and smbios.dat, please? > > > > > > Here they are. > > > > It's very strange. It seems SM entry and DMI structures are all > > sane. I don't understand why it happens. :-( I just wrote a > > qucik-and-dirty userland wrapper for smbios.c, which is attached. > > > > SMBIOS entry: 0x000f00a0 > > DMI structures: length = 1534, paddr = 0x000f0640, count = 49 > > smbios.bios.vendor="American Megatrends Inc." > > smbios.bios.version="0700xx " > > smbios.bios.reldate="11/14/2001" > > smbios.system.maker="Supermicro" > > smbios.system.product="P3TDE6" > > smbios.system.version="1234567890" > > smbios.planar.maker="Supermicro" > > smbios.planar.product="P3TDE6" > > smbios.planar.version="1234567890" > > smbios.chassis.maker="Supermicro" > > smbios.chassis.version="P3TDE6" > > > > Is it possible that PTOV() is not working somehow??? I need help > > here. > > Perhaps give ken@ a patch with some printf's added to figure out > how far it gets into smbios_detect() before it dies? Thanks for the suggestion. ken, can you try the attached diff and tell me how far it goes? Thanks, Jung-uk Kim --Boundary-00=_VQjCD1EGYaKnbp8 Content-Type: text/x-diff; charset="iso-8859-6"; name="smbios.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="smbios.diff" Index: smbios.c =================================================================== RCS file: /home/ncvs/src/sys/boot/i386/libi386/smbios.c,v retrieving revision 1.2 diff -u -r1.2 smbios.c --- smbios.c 27 Jul 2005 19:11:10 -0000 1.2 +++ smbios.c 22 Aug 2005 20:19:20 -0000 @@ -67,6 +67,7 @@ u_int16_t i, length, count; u_int32_t paddr; + printf("smbios_detect\n"); /* locate and validate the SMBIOS */ smbios = smbios_sigsearch(PTOV(SMBIOS_START), SMBIOS_LENGTH); if (smbios == NULL) @@ -76,6 +77,7 @@ paddr = *(u_int32_t *)(smbios + 0x18); /* Structure Table Address */ count = *(u_int16_t *)(smbios + 0x1c); /* No of SMBIOS Structures */ + printf("length = %u, paddr = %u, count = %u\n", length, paddr, count); for (dmi = addr = PTOV(paddr), i = 0; dmi - addr < length && i < count; i++) dmi = smbios_parse_table(dmi); @@ -86,6 +88,7 @@ { u_int8_t *dp; + printf("smbios_parse_table: type %u\n", dmi[0]); switch(dmi[0]) { case 0: /* Type 0: BIOS */ smbios_setenv("smbios.bios.vendor", dmi, 0x04); @@ -119,6 +122,7 @@ while (dp[0] != 0 || dp[1] != 0) dp++; + printf("smbios_parse_table returns %p\n", dp + 2); return(dp + 2); } @@ -128,13 +132,16 @@ char *cp; int i; + printf("smbios_setenv: %s at %p, offset = %d\n", str, dmi, offset); /* skip undefined string */ if (dmi[offset] == 0) return; for (cp = (char *)(dmi + dmi[1]), i = 0; i < dmi[offset] - 1; i++) cp += strlen(cp) + 1; + printf("%s=\"%s\"\n", str, cp); setenv(str, cp, 1); + printf("smbios_setenv done\n"); } static u_int8_t @@ -143,6 +150,7 @@ u_int8_t sum; int i; + printf("smbios_checksum: %p, %u\n", addr, len); for (sum = 0, i = 0; i < len; i++) sum += addr[i]; @@ -154,6 +162,7 @@ { caddr_t cp; + printf("smbios_sigsearch: %p, %u\n", addr, len); /* search on 16-byte boundaries */ for (cp = addr; cp - addr < len; cp += SMBIOS_STEP) { /* compare signature, validate checksum */ --Boundary-00=_VQjCD1EGYaKnbp8--