Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Nov 1998 09:10:58 +0900 (JST)
From:      issei@jp.FreeBSD.ORG
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   kern/8751: Cannot display new CPU name correctly.
Message-ID:  <199811190010.JAA23205@sandra.issei.org>

next in thread | raw e-mail | index | archive | help

>Number:         8751
>Category:       kern
>Synopsis:       Cannot display new CPU name correctly.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 18 16:20:00 PST 1998
>Last-Modified:
>Originator:     Issei Suzuki
>Organization:
Personal
>Release:        FreeBSD 2.2.7-STABLE i386
>Environment:

	

>Description:

	FreeBSD cannot display Intel's new CPU name correctly on boot time.

>How-To-Repeat:

	This is the boot time message when I use Celeron CPU.

CPU: Unknown 80686 (300.68-MHz 686-class CPU)
Origin = "GenuineIntel"  Id = 0x660  Stepping=0
Features=0x183f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,<b16>,<b17>,MMX,<b24>>

	FreeBSD displays CPU name as 'Unknown 80686' instead of 'Celeron'

>Fix:

	Apply the following patch to /sys/i386/i386/identcpu.c


	See also Intel's Application note AP-485 "Intel Processor
	Identification and the CPUID Instruction"

	http://developer.intel.com/design/pro/applnots/241618.HTM

--- i386/i386/identcpu.c.old	Sat Sep 12 09:54:28 1998
+++ i386/i386/identcpu.c	Sat Sep 12 12:22:20 1998
@@ -71,6 +71,7 @@
 static void print_AMD_info(void);
 static void print_AMD_assoc(int i);
 static void do_cpuid(u_long ax, u_long *p);
+static int get_L2cache(void);
 
 u_long	cyrix_did;		/* Device ID of Cyrix CPU */
 int cpu_class = CPUCLASS_386;	/* least common denominator */
@@ -196,8 +197,33 @@
 					cpu = CPU_PII;
 					break;
 				case 0x50:
-				        strcat(cpu_model, "Pentium II (quarter-micron)");
-					cpu = CPU_PII;
+				case 0x60:
+					/* Ident Celeron and Pentium II */
+					switch (get_L2cache()) {
+					case 0:
+						strcat(cpu_model, "Celeron");
+						break;
+					case 128:
+						strcat(cpu_model, "Celeron (L2 128KB)");
+						break;
+					case 512:
+						strcat(cpu_model, "Pentium II (quarter-micron) / Pentium II Xeon (L2 512KB)");
+						cpu = CPU_PII;
+						break;
+					case 1024:
+						strcat(cpu_model, "Pentium II Xeon (L2 1MB)");
+						cpu = CPU_PII;
+						break;
+					case 2048:
+						strcat(cpu_model, "Pentium II Xeon (L2 2MB)");
+						cpu = CPU_PII;
+						break;
+
+					case -1:
+					default:
+				        	strcat(cpu_model, "Unknown 80686");
+						break;
+					}
 					break;
 				default:
 				        strcat(cpu_model, "Unknown 80686");
@@ -829,4 +855,35 @@
 		printf(", %d lines/tag", (regs[3] >> 8) & 0xff);
 		print_AMD_assoc((regs[3] >> 16) & 0xff);
 	}
+}
+
+/* check the amount of L2 cache */
+static int
+get_L2cache(void)
+{
+	int i, j;
+	u_long regs[4];
+	do_cpuid(2, regs);
+
+	for (i=0; i<4; i++)
+		for (j=0; j<4; j++)
+			switch ((regs[i] >> j*8) & 0xff) {
+			case 0x40:
+				return 0;
+			case 0x41:
+				return 128;
+			case 0x42:
+				return 256;
+			case 0x43:
+				return 512;
+			case 0x44:
+				return 1024;
+			case 0x45:
+				return 2048;
+			default:
+			        /* nothing */
+				break;
+			}
+
+	return -1;
 }
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199811190010.JAA23205>