2

Author Topic: cpu-type Detection [PATCH]  (Read 12908 times)

0 Members and 1 Guest are viewing this topic.

DigitalDJ

  • Entrant
  • Posts: 3
cpu-type Detection [PATCH]
« on: October 05, 2009, 05:09:20 PM »
Not too sure why this isn't in Chameleon. I wrote a fairly lengthy post on InsanelyMac about OSX CPU Detection at:

http://www.insanelymac.com/forum/index.php?showtopic=189562&st=0

Basically, including tables 131 and 132 to inject cpu-type and interconnect-speed (for i7) users. Allows installations like Silverlight to pick up on the correct CPU type and not need modifying to get it to install....

I don't expect this to be included with Chameleon...but I thought I'd share the patch. Enjoy.

Signal64

  • Observer
  • Posts: 11
Re: cpu-type Detection [PATCH]
« Reply #1 on: October 11, 2009, 01:17:38 AM »
I like this one and know a few others on IRC are using it now as well.

It allows my e7300 and e8400 to be detected and in the end a better solution than a cosmetic About This Mac "fix".

It's small enough patch that I hope it is included in future versions.

Might want to link to your blog post about this patch as well:
http://digitaldj.net/2009/10/06/cpu-detection-integrated-with-chameleon-rc3/

BladeRunner

  • Member
  • Posts: 88
Re: cpu-type Detection [PATCH]
« Reply #2 on: October 11, 2009, 01:28:14 AM »
While I expect the answer is no, I have to ask.  Is there any chance that this injection can include some older Intel iron like P4 Prescott CPU?
Code: [Select]
lrh ~ $ sysctl -a | grep cpu
hw.ncpu = 2
hw.cpufrequency = 3000000000
hw.availcpu = 2
hw.ncpu: 2
hw.activecpu: 2
hw.physicalcpu: 1
hw.physicalcpu_max: 1
hw.logicalcpu: 2
hw.logicalcpu_max: 2
hw.cputype: 7
hw.cpusubtype: 4
hw.cpu64bit_capable: 0
hw.cpufamily: 0
hw.cpufrequency: 3000000000
hw.cpufrequency_min: 3000000000
hw.cpufrequency_max: 3000000000
hw.cputhreadtype: 1
machdep.cpu.max_basic: 5
machdep.cpu.max_ext: 2147483656
machdep.cpu.vendor: GenuineIntel
machdep.cpu.brand_string: Intel(R) Pentium(R) 4 CPU 3.00GHz
machdep.cpu.family: 15
machdep.cpu.model: 4
machdep.cpu.extmodel: 0
machdep.cpu.extfamily: 0
machdep.cpu.stepping: 1
machdep.cpu.feature_bits: 3219913727 17437
machdep.cpu.extfeature_bits: 0 0
machdep.cpu.signature: 3905
machdep.cpu.brand: 0
machdep.cpu.features:  FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFSH DS ACPI MMX FXSR SSE SSE2 SS HTT TM SSE3 MON DSCPL CID TPR
machdep.cpu.extfeatures:
machdep.cpu.logical_per_package: 2
machdep.cpu.cores_per_package: 1
machdep.cpu.microcode_version: 5
machdep.cpu.mwait.linesize_min: 64
machdep.cpu.mwait.linesize_max: 64
machdep.cpu.mwait.extensions: 0
machdep.cpu.mwait.sub_Cstates: 0
machdep.cpu.thermal.sensor: 0
machdep.cpu.thermal.dynamic_acceleration: 0
machdep.cpu.thermal.thresholds: 0
machdep.cpu.thermal.ACNT_MCNT: 0
machdep.cpu.arch_perf.version: 0
machdep.cpu.arch_perf.number: 0
machdep.cpu.arch_perf.width: 0
machdep.cpu.arch_perf.events_number: 0
machdep.cpu.arch_perf.events: 0
machdep.cpu.arch_perf.fixed_number: 0
machdep.cpu.arch_perf.fixed_width: 0
machdep.cpu.cache.linesize: 64
machdep.cpu.cache.L2_associativity: 6
machdep.cpu.cache.size: 1024
machdep.cpu.tlb.inst.large: 64
machdep.cpu.tlb.data.large: 64
machdep.cpu.address_bits.physical: 36
machdep.cpu.address_bits.virtual: 32
machdep.cpu.core_count: 1
machdep.cpu.thread_count: 2
Base system: HP Pavilion P6340f Desktop  Intel� Core2Quad�  CPU: Speed: 2.66 GHz   Package: Socket 775 LGA:  L2 Cache 2 x 2048 KB  RAM : 8.0 GB:  DDR3

Disks : 2 eSATA @ 2 TB (hardware raid 1), NAS 4 x 2 TB raid 5 Display : 21" Samsung on EVGA GeForce 9400 GT - PCIe - 1900x1080  Keyboard/mouse :  USB connected  OS Version : 10.6.0 from retail DVD + SW update to 10.6.5 - Kernel:  Vanilla mach_kernel

Gringo Vermelho

  • Forum Moderator
  • Posts: 611
  • The gray monster energy hat
Re: cpu-type Detection [PATCH]
« Reply #3 on: October 11, 2009, 08:42:27 AM »
While I expect the answer is no, I have to ask.  Is there any chance that this injection can include some older Intel iron like P4 Prescott CPU?

It makes sense to only inject CPU models that ship in actual Apple computers.

If you use the patch as it is, your CPU will be set as Core Solo (like the voodoo kernel does on P4 and single-core AMD systems).

If the aim is to allow stuff like Silverlight to install and Adobe.com not offering the PPC version of Shockwave, then the problem is solved for you.

As for cosmetics, you could still change it to Pentium 4 in "About this Mac" if you want to, using the usual methods (OSX86Tools or hand-editing PlatformReporter-something-or-other).
« Last Edit: April 04, 2010, 07:03:26 AM by Gringo Vermelho »
10.9.5 - ASUS P8Z77-V Pro - i5 3570K - GTX 660 - Chameleon 2.3 svn-r2xxx
How to...
Install Chameleon: http://forum.voodooprojects.org/index.php/topic,649
Make your own Chameleon boot CD: http://forum.voodooprojects.org/index.php/topic,484.msg2131.html#msg2131

thorazine74

  • Member
  • Posts: 57
Re: cpu-type Detection [PATCH]
« Reply #4 on: October 11, 2009, 02:42:18 PM »
I like this one and know a few others on IRC are using it now as well.

It allows my e7300 and e8400 to be detected and in the end a better solution than a cosmetic About This Mac "fix".

It's small enough patch that I hope it is included in future versions.

Might want to link to your blog post about this patch as well:
http://digitaldj.net/2009/10/06/cpu-detection-integrated-with-chameleon-rc3/

The patch from the blog seems very good, I havent tried it yet but if it works as advertised it would probably be the most complete chameleon patch so far...
I cant see why all these patches should not be merged to main but I'm not sure if the team will agree (specially regarding cd driver...)
Mac OS X 10.5.6 Retail (Updated to 10.5.7) with Chameleon 2.0 RC1+BootIt NextGen 1.86 (MBR Single Drive)
Gigabyte 73PVM-S2H + C2D + 2 Gb
2 SATA HD (AppleAHCIport.kext) + 1 PATA DVD+RW (DarwinATAPort.kext)
Realtek ALC889 (VoodooHDA.kext)
Geforce 8600GTS (EFI String) PS/2 M & KB: VoodooPS2.kext

BladeRunner

  • Member
  • Posts: 88
Re: cpu-type Detection [PATCH]
« Reply #5 on: October 11, 2009, 05:20:35 PM »
While I expect the answer is no, I have to ask.  Is there any chance that this injection can include some older Intel iron like P4 Prescott CPU?

It makes sense to only inject CPU models that ship in actual Apple computers.

If you use the patch as it is, your CPU will be set as Core Solo (just like older versions of Chameleon did on P4 systems).

If the aim is to allow stuff like Silverlight to install and Adobe.com not offering the PPC version of Shockwave, then the problem is solved for you.

As for cosmetics, you could still change it to Pentium 4 in "About this Mac" if you want to, using the usual methods (OSX86Tools or hand-editing PlatformReporter-something-or-other).

I agree with your comment about only injecting CPU types actually used.  I applied the patch and now About says I have a Core 2 Solo.  Silverlight installs, which it didn't before. 

VMwareFunsion install still panics at the end while running the scripts.  That was the problem I was hoping would be solved. Fusion ran fine on my 10.5.8 system but has refused to install since I converted 10.6.  Howeverl, that's a discussion for a different forum.

I noticed that the "sysctl -a | grep cpu" output has not changed since I patched the boot file.  Is that a because sysctl pulls data from the hardware bios and not the ioreg?
Base system: HP Pavilion P6340f Desktop  Intel� Core2Quad�  CPU: Speed: 2.66 GHz   Package: Socket 775 LGA:  L2 Cache 2 x 2048 KB  RAM : 8.0 GB:  DDR3

Disks : 2 eSATA @ 2 TB (hardware raid 1), NAS 4 x 2 TB raid 5 Display : 21" Samsung on EVGA GeForce 9400 GT - PCIe - 1900x1080  Keyboard/mouse :  USB connected  OS Version : 10.6.0 from retail DVD + SW update to 10.6.5 - Kernel:  Vanilla mach_kernel

zef

  • Administrator
  • Posts: 265
Re: cpu-type Detection [PATCH]
« Reply #6 on: October 12, 2009, 10:04:03 AM »
Thanks DigitalDJ for your patch!

Your changes are committed. :)
ASUS P8Z68-V PRO/GEN3 | i5-2500k | 16GB RAM | GTX560 | Keyboard | Mouse | Devilsound DAC

BuildSmart

  • Member
  • Posts: 30
Re: cpu-type Detection [PATCH]
« Reply #7 on: March 29, 2010, 01:43:14 PM »
Without proper QPI register manipulation this patch is nothing more than a hack for the newer series CPU's.

For the i7-9xx and e55xx series CPU's it does not extract the QPI interlink speed and those boards with QPI registers they are never accessed/enabled and I would think that proper detection is the main goal.

BuildSmart

  • Member
  • Posts: 30
Re: cpu-type Detection [PATCH]
« Reply #8 on: March 31, 2010, 09:03:04 AM »
There was a patch that modified the kernel for P4/Pentium-D CPU's that did some other CPU stuff.

If this patch could be provided, I can amend it to include the QPI interlink-connect speed detection code removing the need to have any entries in a plist file to set any CPU information by setting the information automatically and setting it properly.

Yes I do detect the QPI interlink-connect speed and set the appropriate flags so seeing a 533mhz FSB speed for an i7 or it's Xeon brother never occurs, it displays the correct speed without having to edit any files to do it.

This allows me portability, this means I can install an OS on a D945GCL system and then plug the drive into a DX58SO and never have to change anything to have the system boot and the information for the board is correctly reported and yes, I correctly report the information, and I have entirely removed the need to load a DSDT from disk, instead I build a BIOS edit table for a supported motherboard and then intelligently patch the embedded DSDT so I can patch ATA to prevent KP's, change the DSDT's AZAL device to HDEF all without having to save, decompile or edit a DSDT file.

Gringo Vermelho

  • Forum Moderator
  • Posts: 611
  • The gray monster energy hat
Re: cpu-type Detection [PATCH]
« Reply #9 on: March 31, 2010, 04:21:11 PM »
There was a patch that modified the kernel for P4/Pentium-D CPU's that did some other CPU stuff.
Wasn't that in the Voodoo Kernel?
10.9.5 - ASUS P8Z77-V Pro - i5 3570K - GTX 660 - Chameleon 2.3 svn-r2xxx
How to...
Install Chameleon: http://forum.voodooprojects.org/index.php/topic,649
Make your own Chameleon boot CD: http://forum.voodooprojects.org/index.php/topic,484.msg2131.html#msg2131

BuildSmart

  • Member
  • Posts: 30
Re: cpu-type Detection [PATCH]
« Reply #10 on: April 01, 2010, 12:16:26 PM »
There was a patch that modified the kernel for P4/Pentium-D CPU's that did some other CPU stuff.
Wasn't that in the Voodoo Kernel?
HAHAHAHAHAHAHAHA......

Why would a kernel patch a vanilla kernel?????

Gringo Vermelho

  • Forum Moderator
  • Posts: 611
  • The gray monster energy hat
Re: cpu-type Detection [PATCH]
« Reply #11 on: April 01, 2010, 06:00:38 PM »
Nice attitude. That's not what I meant..

When using the Voodoo Kernel with a single core Athlon or P4, it would 'fake' the CPU type as Intel Core Solo.

I was thinking maybe that's the code you're referring to. You know, just offering a friendly suggestion.
« Last Edit: April 01, 2010, 06:40:53 PM by Gringo Vermelho »
10.9.5 - ASUS P8Z77-V Pro - i5 3570K - GTX 660 - Chameleon 2.3 svn-r2xxx
How to...
Install Chameleon: http://forum.voodooprojects.org/index.php/topic,649
Make your own Chameleon boot CD: http://forum.voodooprojects.org/index.php/topic,484.msg2131.html#msg2131

BuildSmart

  • Member
  • Posts: 30
Re: cpu-type Detection [PATCH]
« Reply #12 on: April 04, 2010, 09:32:11 AM »
Your suggestion was a clear indication that you didn't understand the question.

The boot loader is very capable of patching a kernel to do anything, I stated a particular patch that was discarded because people thought it wasn't of any real value however it contains some of the routines needed for QPI related stuff that works with this code base.

It's certainly not going to work with my BIOS calls since this code base doe not interact with any of the BIOS EFI modules.

Gringo Vermelho

  • Forum Moderator
  • Posts: 611
  • The gray monster energy hat
Re: cpu-type Detection [PATCH]
« Reply #13 on: April 04, 2010, 09:37:58 AM »
Your suggestion was a clear indication that you didn't understand the question.

Hell, I didn't even understand that you were asking a question. Laugh it up.  ::)
10.9.5 - ASUS P8Z77-V Pro - i5 3570K - GTX 660 - Chameleon 2.3 svn-r2xxx
How to...
Install Chameleon: http://forum.voodooprojects.org/index.php/topic,649
Make your own Chameleon boot CD: http://forum.voodooprojects.org/index.php/topic,484.msg2131.html#msg2131

andyvand

  • VoodooLabs
  • Posts: 51
Re: cpu-type Detection [PATCH]
« Reply #14 on: May 05, 2010, 04:48:46 PM »
Value to be used for single core (Intel Core solo/duo) is 0x0201 instead of 0x0101...
I've fixed it and added the correct part to my svn branch...