From owner-freebsd-hackers Tue Mar 13 14:44:48 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.wolves.k12.mo.us (mail.wolves.k12.mo.us [207.160.214.1]) by hub.freebsd.org (Postfix) with ESMTP id BFC3637B718 for ; Tue, 13 Mar 2001 14:44:40 -0800 (PST) (envelope-from cdillon@wolves.k12.mo.us) Received: from mail.wolves.k12.mo.us (cdillon@mail.wolves.k12.mo.us [207.160.214.1]) by mail.wolves.k12.mo.us (8.9.3/8.9.3) with ESMTP id QAA57360; Tue, 13 Mar 2001 16:44:27 -0600 (CST) (envelope-from cdillon@wolves.k12.mo.us) Date: Tue, 13 Mar 2001 16:44:27 -0600 (CST) From: Chris Dillon To: Chris Sears Cc: Subject: Re: ecc kld for FreeBSD 4.2 In-Reply-To: <3AAD4752.9C40CE34@ix.netcom.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, 12 Mar 2001, Chris Sears wrote: > > Linux has some support for ECC error detection: > > http://www.anime.net/~goemon/linux-ecc/ > > I've ported ECC 0.12 to a FreeBSD kld and it seems to work. > > A couple of minor changes: > > commented out probe_450gx because the compiler was > giving some plausible warnings > > check if ecc_mode == ECC_NONE before installing the timer > > I've attached it and would welcome any comments. I've also > posted it back to the Linux ECC people. Excellent!! I've just compiled it and loaded it on my 4.2-STABLE system with a 440BX-based board. I even have an enhancement already, which is pretty much just a cut-n-paste from the Linux bits with a little bit of style enhancement, though you'll want to change it to your liking, and since I'm not an avid C programmer, make sure I've done the right stuff... (it DOES work, at least): --- ecc.c.orig Tue Mar 13 15:17:57 2001 +++ ecc.c Tue Mar 13 16:31:02 2001 @@ -1040,6 +1040,26 @@ int type, void* data) { + char *ecc[] = { + "None", + "Reserved", + "Parity checking", + "ECC detection", + "ECC detection and correction", + "ECC with hardware scrubber" + }; + char *dram[] = { + "Empty", + "Reserved", + "FPM", + "EDO", + "BEDO", + "SDR", + "DDR", + "RDR" + }; + unsigned long mem_end = 0; + unsigned long last_mem = 0; static int attached = 0; int loop; @@ -1068,6 +1088,25 @@ if (cs.ecc_mode == ECC_NONE) { printf("ECC: no ECC memory\n"); return -ENODEV; + } else { + printf("ECC: Chipset ECC capability - %s\n", + ecc[cs.ecc_cap]); + printf("ECC: Current ECC mode - %s\n", + ecc[cs.ecc_mode]); + printf("ECC:\tBank\tSize\tType\tECC\tSBE\tMBE\n"); + for (loop = 0; loop < 8; loop++) { + last_mem = bank[loop].endaddr; + if (last_mem > mem_end) { + printf("ECC:\t%d\t", loop); + printf("%dM\t", (int)(last_mem - mem_end) / 1048576); + printf("%s\t", dram[bank[loop].mtype]); + printf("%s\t", bank[loop].eccmode ? "Y" : "N"); + printf("%d\t", bank[loop].sbecount); + printf("%d\n", bank[loop].mbecount); + mem_end = last_mem; + } + } + printf("ECC: Total\t%dM\n", (int)mem_end / 1048576); } attached = 1; break; I also have something that I can hopefully just plug the bits into to get this working for the ServerWorks III chipset, as well, assuming I can find the right info about it... -- Chris Dillon - cdillon@wolves.k12.mo.us - cdillon@inter-linc.net FreeBSD: The fastest and most stable server OS on the planet. For IA32 and Alpha architectures. IA64, PPC, and ARM under development. http://www.freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message