Date: Mon, 27 Aug 2001 14:59:34 -0400 From: Allen Landsidel <all@biosys.net> To: freebsd-stable@freebsd.org Subject: identcpu patch for k6-2? Message-ID: <5.1.0.14.0.20010827131809.00c4ad38@rfnj.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5.1.0.14.0.20010827131809.00c4ad38>