CPUID: Fix Intel processor identification

This commit is contained in:
zzz
2014-10-03 17:45:34 +00:00
parent 7b6f32e5b2
commit 1c2b6fc00e
4 changed files with 32 additions and 4 deletions

View File

@@ -277,13 +277,19 @@ public class CPUID {
String mname = getCPUModelName(); String mname = getCPUModelName();
if (mname != null) if (mname != null)
System.out.println("CPU Model Name: " + mname); System.out.println("CPU Model Name: " + mname);
System.out.println("CPU Vendor: " + getCPUVendorID()); String vendor = getCPUVendorID();
System.out.println("CPU Vendor: " + vendor);
// http://en.wikipedia.org/wiki/Cpuid // http://en.wikipedia.org/wiki/Cpuid
// http://web.archive.org/web/20110307080258/http://www.intel.com/Assets/PDF/appnote/241618.pdf
// http://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-2a-manual.pdf
int family = getCPUFamily(); int family = getCPUFamily();
int model = getCPUModel(); int model = getCPUModel();
if (family == 15 ||
(family == 6 && "GenuineIntel".equals(vendor))) {
model += getCPUExtendedModel() << 4;
}
if (family == 15) { if (family == 15) {
family += getCPUExtendedFamily(); family += getCPUExtendedFamily();
model += getCPUExtendedModel() << 4;
} }
System.out.println("CPU Family: " + family); System.out.println("CPU Family: " + family);
System.out.println("CPU Model: " + model); System.out.println("CPU Model: " + model);

View File

@@ -59,12 +59,18 @@ class IntelInfoImpl extends CPUIDCPUInfo implements IntelCPUInfo
private static String identifyCPU() private static String identifyCPU()
{ {
// http://en.wikipedia.org/wiki/Cpuid // http://en.wikipedia.org/wiki/Cpuid
// http://web.archive.org/web/20110307080258/http://www.intel.com/Assets/PDF/appnote/241618.pdf
// http://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-2a-manual.pdf
String modelString = null; String modelString = null;
int family = CPUID.getCPUFamily(); int family = CPUID.getCPUFamily();
int model = CPUID.getCPUModel(); int model = CPUID.getCPUModel();
if (family == 15 || family == 6) {
// Intel uses extended model for family = 15 or family = 6,
// which is not what wikipedia says
model += CPUID.getCPUExtendedModel() << 4;
}
if (family == 15) { if (family == 15) {
family += CPUID.getCPUExtendedFamily(); family += CPUID.getCPUExtendedFamily();
model += CPUID.getCPUExtendedModel() << 4;
} }
switch (family) { switch (family) {
@@ -160,6 +166,17 @@ class IntelInfoImpl extends CPUIDCPUInfo implements IntelCPUInfo
case 1: case 1:
modelString = "Pentium Pro"; modelString = "Pentium Pro";
break; break;
// Nehalem 45 nm
// As reported; can't find in any CPUID charts
case 2:
isPentium2Compatible = true;
isPentium3Compatible = true;
isPentiumMCompatible = true;
isCore2Compatible = true;
isCoreiCompatible = true;
isX64 = true;
modelString = "Core i7 (45nm)";
break;
case 3: case 3:
isPentium2Compatible = true; isPentium2Compatible = true;
modelString = "Pentium II (Klamath)"; modelString = "Pentium II (Klamath)";

View File

@@ -1,3 +1,8 @@
2014-10-03 zzz
* Console: New add-to-addressbook links on leaseset page
* CPUID: Fix Intel processor identification
* i2psnark: Fix adding magnet links with % encoding (ticket #1391)
2014-09-30 zzz 2014-09-30 zzz
* Logs: Fix displayed filename when empty (ticket #1386) * Logs: Fix displayed filename when empty (ticket #1386)
* SAM: Fix v3 LS publish, broken in -4 (ticket #1390) * SAM: Fix v3 LS publish, broken in -4 (ticket #1390)

View File

@@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */ /** deprecated */
public final static String ID = "Monotone"; public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION; public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 5; public final static long BUILD = 6;
/** for example "-test" */ /** for example "-test" */
public final static String EXTRA = ""; public final static String EXTRA = "";