From owner-freebsd-stable Mon Aug 27 11:59:43 2001 Delivered-To: freebsd-stable@freebsd.org Received: from rfnj.org (rfnj.org [216.239.237.194]) by hub.freebsd.org (Postfix) with ESMTP id 7B14937B409 for ; Mon, 27 Aug 2001 11:59:38 -0700 (PDT) (envelope-from all@biosys.net) Received: from megalomaniac.biosys.net (megalomaniac.rfnj.org [216.239.237.200]) by rfnj.org (Postfix) with ESMTP id DA0421385C for ; Mon, 27 Aug 2001 14:59:36 +0000 (GMT) Message-Id: <5.1.0.14.0.20010827131809.00c4ad38@rfnj.org> X-Sender: (Unverified) X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Mon, 27 Aug 2001 14:59:34 -0400 To: freebsd-stable@freebsd.org From: Allen Landsidel Subject: identcpu patch for k6-2? Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Since as long as I can remember.. 3.4 or so at least, identcpu.c has incorrectly identified my K6-2 as a K6. After looking into /usr/src/sys/i386/i386/identcpu.c I notice that it apparently gets the CPU ID information and then subsequently overwrites it with something else. I made some minor changes that are entirely cosmetic, nothing really functionally different that I saw, and it now displays the proper CPU type. Unfortunately this screws up the CPU detection on my Athlon (it reports as Unknown). I'm sure there is a way to do this.. having done cpu identification myself (in asm and delphi/pascal, not c) I'm pretty sure that even though the K6-2s report that they support the extended cpuid instruction to report their CPU name string, that the string is K6 and not a K6-2. I could just be smoking crack though too.. here is the patch I applied, it's pretty simple, but apparently screws things up sometimes. I didn't try it on my P-133 yet.. Maybe someone could take a closer look at this and see what's up? I'm fighting through trying to get the identcpu.c code into a standalone format that I can compile and just get the raw cpuid output, but my C is just plain terrible.. maybe I'll grab the freepascal compiler and try that. ;) [root@revolution] /root # diff -cu identcpu.c identcpu.patched.c diff: conflicting specifications of output style --- identcpu.c Mon Aug 27 13:12:15 2001 +++ identcpu.patched.c Mon Aug 27 13:13:23 2001 @@ -86,7 +86,7 @@ SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, "Machine class"); -static char cpu_model[128]; +static char cpu_model[144]; SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, cpu_model, 0, "Machine model"); @@ -329,11 +329,11 @@ nreg = regs[0]; if (nreg >= 0x80000004) { do_cpuid(0x80000002, regs); - memcpy(cpu_model, regs, sizeof regs); - do_cpuid(0x80000003, regs); memcpy(cpu_model+16, regs, sizeof regs); - do_cpuid(0x80000004, regs); + do_cpuid(0x80000003, regs); memcpy(cpu_model+32, regs, sizeof regs); + do_cpuid(0x80000004, regs); + memcpy(cpu_model+48, regs, sizeof regs); } } else if (strcmp(cpu_vendor,"CyrixInstead") == 0) { strcpy(cpu_model, "Cyrix "); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message