Quote:
Originally Posted by naquaada
I'm not sure about this.
|
OK. Explanations follow.
Quote:
In System Profiler the processor is detected correctly as AMD Opteron, in 'About this Mac' (I'll shorten it with 'ATM' now) is it Intel Core Duo. If a program/installer needs system information, from which source it will take them?
|
You see it from the user-visible program perspective. In the kernel there are sysctl keys for cputype, cpu family, cpu model, cpu vendor string, cpu brand string. Then there is the cpuid instruction itself. And a couple other methods.
Quote:
From there where System Profiler gets it or from there where ATM gets it?
|
System Profiler is a mess itself, it does some cpuid itself, takes some values from sysctl, and so on. While fixing some bugs I found that the "cpu type" sysctl key is used by installers to check whether they are running on intel or PPC.
Quote:
What about the tools from zephyroth and PCwiz which could write custom text in the processor and memory fields in ATM?
|
That is just cosmetic. There is a text file which can be freely modified and has nothing to do with the kernel.
Quote:
I never had a tool which doesn't working because of an unknown processor, and only the Parallels installer checked for an Intel CPU. But this was easily to remove.
|
Others did. Silverlight installer is one. You also say Parallels. These will only work on "Intel" cpu, not powerpc. They do not KNOW about an AMD possibility.
Quote:
I think the most people would like a correct cpu name in ATM.
|
Sure. Use one of the tools to modify what you want to be displayed. The
text string is trivial.
Quote:
An kernel option for this would be better, so that the cpu is detected either as 'unknown', 'Intel' or the correct type.
|
Not at all. Kernel option so that people read "AMD Opteron" in about this mac? Why is about this mac important at all when you are fully aware that 50% of your CPU's functionality is running emulated as intel?
And second, we do NOT have the option to identify the CPU correctly. It's either Unknown, OR an Intel CPU. The kernel, the programs, installers and kexts do NOT know about anything else. I will paste that part of the code so it will be clearer:
The part which sets the cpu type:
Code:
/* hw.cpufamily */
switch (cpuid_info()->cpuid_family) {
case 6:
switch (cpuid_info()->cpuid_model) {
case 13:
cpufamily = CPUFAMILY_INTEL_6_13;
break;
case 14:
cpufamily = CPUFAMILY_INTEL_6_14; /* Core Solo/Duo */
break;
case 15:
cpufamily = CPUFAMILY_INTEL_6_15; /* Core 2 */
break;
case 23:
cpufamily = CPUFAMILY_INTEL_6_23;
break;
case 26:
cpufamily = CPUFAMILY_INTEL_6_26;
break;
default:
/* For other models, report Intel Core */
cpufamily = CPUFAMILY_INTEL_6_14;
}
break;
/* mercurysquad: Report cpu family as one of the Apple-recognized
* CPUs, for CPU families other than 6. This entire system is very
* myopic, where the kernel explicitly encourages checking for a handful
* of families with arbitrary signatures. We cannot define our own
* signatures here as we never know when an installer or other app
* might check among only the ones stock kernel supports.*/
case 15:
/* This applies to Pentium 4/D and AMD Phenom. In the future
* we might want to choose a more specific cpufamily based on the
* number of cores etc., but for now it's just not worth it IMO */
switch (cpuid_info()->cpuid_model) {
case 0:
case 1:
case 2:
/* Report Core Solo/Duo for these models */
cpufamily = CPUFAMILY_INTEL_6_14;
default:
/* For higher models, report Core 2 Duo */
cpufamily = CPUFAMILY_INTEL_6_15;
}
default:
/* For unknown CPU families, just report Intel Core */
cpufamily = CPUFAMILY_INTEL_6_14;
}
And the part where these cpu types are defined (these are the only choices we have). Even if we add some values here, it means nothing because we cannot change all the hundreds of programs or kexts which use the apple stock values:
Code:
/*
* CPU families (sysctl hw.cpufamily)
*
* These are meant to identify the CPU's marketing name - an
* application can map these to (possibly) localized strings.
* NB: the encodings of the CPU families are intentionally arbitrary.
* There is no ordering, and you should never try to deduce whether
* or not some feature is available based on the family.
* Use feature flags (eg, hw.optional.altivec) to test for optional
* functionality.
*/
#define CPUFAMILY_UNKNOWN 0
#define CPUFAMILY_POWERPC_G3 0xcee41549
#define CPUFAMILY_POWERPC_G4 0x77c184ae
#define CPUFAMILY_POWERPC_G5 0xed76d8aa
#define CPUFAMILY_INTEL_6_13 0xaa33392b
#define CPUFAMILY_INTEL_6_14 0x73d67300 /* "Intel Core Solo" and "Intel Core Duo" (32-bit Pentium-M with SSE3) */
#define CPUFAMILY_INTEL_6_15 0x426f69ef /* "Intel Core 2 Duo" */
#define CPUFAMILY_INTEL_6_23 0x78ea4fbc /* Penryn */
#define CPUFAMILY_INTEL_6_26 0x6b5a4cd2 /* Nehalem */
#define CPUFAMILY_ARM_9 0xe73283ae
#define CPUFAMILY_ARM_11 0x8ff620d8
#define CPUFAMILY_ARM_XSCALE 0x53b005f5
#define CPUFAMILY_INTEL_YONAH CPUFAMILY_INTEL_6_14
#define CPUFAMILY_INTEL_MEROM CPUFAMILY_INTEL_6_15
#define CPUFAMILY_INTEL_PENRYN CPUFAMILY_INTEL_6_23
#define CPUFAMILY_INTEL_NEHALEM CPUFAMILY_INTEL_6_26
#define CPUFAMILY_INTEL_CORE CPUFAMILY_INTEL_6_14
#define CPUFAMILY_INTEL_CORE2 CPUFAMILY_INTEL_6_15