overdue-scratch

Author Topic: CPUID OVERRIDE patch!  (Read 7921 times)

0 Members and 1 Guest are viewing this topic.

george205

  • Entrant
  • Posts: 4
CPUID OVERRIDE patch!
« on: September 02, 2009, 02:29:39 AM »
 Hello! [I have written a similar post at "http://chameleon.osx86.hu/articles/chameleon-20rc2-is-available-with-new-features-and-less-bugs" and at:"http://netkas.org/?p=175" a few days ago].

 I was wondering if it is possible to make a build-in CPUID vendor override option/patch inside chameleon, so all AMD cpus will appear as Intel to the osX. I believe that something like that will give the ability to amd users to boot from retail/vanilla kernel but after all I’m not a programmer. So I would like to have your opinion about this.
 I have to add that there is already CPUID override “ability” on QEMU,BOCHS and KVM and I think that XEN has this ability too, but I’m not sure. Anyway,all those programs are open-sourced, so the code is already available to all of us. Secondly,there is a cpu from VIA,the via nano cpu, with unlocked cpuid from the factory! ;-)

Kabyl

  • VoodooLabs
  • Posts: 158
Re: CPUID OVERRIDE patch!
« Reply #1 on: September 02, 2009, 02:15:35 PM »
And I thought I've replied to your comment..

george205

  • Entrant
  • Posts: 4
Re: CPUID OVERRIDE patch!
« Reply #2 on: September 02, 2009, 03:42:00 PM »
Hey kabyl,nice to hearing from you again! This is our previous "conversation" after my first post:
#

Kabyl · 27. August 2009, 18:57 · #

george205,
Even if that is possible, it’s not a good idea, as there are checks for the cpuid to enable CPU features and to access registers and MSRs unique to each family or model.
#

george205 · 27. August 2009, 21:24 · #

Hello again! Thanks for your quick response Kabyl! I believe that you don’t have to change the values of all the MSR’s.It seems pointless to me,and could be rather messy for a system. I think that you only have to patch the Vendor:(Authenticamd to Genuineintel) and the brand string:[example: Dual-Core AMD Opteron™ Processor 8214 to Dual-Core Intel® Xeon®
processor 5130-or something like that]. All the other MSR’s which provide informations about the supported commands and other cpu’s features should remain intacted(unpatched). I’m sure that people who are developing the voodoo kernel know exactly what needs patching.

However, I still have some remaining questions:
 1)Has anyone try to install leopard or snow on a system with via nano cpu (appearing as "GenuineIntel")? If "yes", is it working fine with vanilla(original) kernel?
 2)Has anyone ever made an osX bootloader with build-in cpuid patch? If "yes", does this non-intel system become really unstable after running osX woth that bootloader?
 3)Has anyone installed osX vanilla on a non-intel system using QEMU/BOCHS or another application which provide cpuid patch?
If nobody has tested those options, then how do we know the result (success,instability or whatever)?
I also haven't yet understanded if anyone who knows how to do it IS WILLING to port such a thing inside a bootloader or not!So what is the decision of the dev team?




Kabyl

  • VoodooLabs
  • Posts: 158
Re: CPUID OVERRIDE patch!
« Reply #3 on: September 02, 2009, 05:29:05 PM »
The same answer applies again, if you don't use an Intel Core CPU you will need to make changes in the kernel, why do you think non-Core Intel CPUS like Pentium M/D.. etc need a modified XNU?

Qemu/Bochs are both virtual machines, and that's different.

george205

  • Entrant
  • Posts: 4
Re: CPUID OVERRIDE patch!
« Reply #4 on: September 02, 2009, 07:10:44 PM »
Good point Kabyl!
 So,we have Intel cpus -so vendorId=GenuineIntel- but all versions of Vanilla kernels refuse to run/work with Intel Pentium D cpus. And everyone knows that there isn't a single original mac out there with intel pentium D cpu.
 So, it seems that if someone can patch vendor id only, he won't have the desirable result. So,it's obvious that mach kernels check some other things instead of vendor id. I believe that mach_kernels also check cpu brand string. Anyway, since I'm not a programer,computer expert or whatever -as I already declared on my first post- what other checks does an original apple kernel make to our hardware in order to run?
 As far as I know, the cpuid infos are provided to the running software by the bios and not by the cpu chip itself. Every emulator like QEMU,BOCHS e.t.c. emulates a bios too, so it's easy for them to pass our desired cpuid info to the software. In order to run mac os to a none-core intel cpu, we don't require any kind of emulation or virtualization, except EFI emulation -unless we do want to emulate some cpu instructions (like SSE3) which our cpu chip cannot support. I also believe that MacOSX get CPUID informations from EFI. So, If we can "inject" our "fake" informations inside that fake efi, maybe we can "fool" the vanilla kernel enough to run on non-core intel cpus.
 TO SUM UP, instead of patching original mach_kernel in order to be usable on non-core systems, why don't we patch properly the fake efi? This isn't created by Apple, so we can have full control over it! On the other hand, the kernel will be always made by apple. How can we patch their kernel in order to run on our machines, if one day they decide to stop releasing their XNU source code?

Kabyl

  • VoodooLabs
  • Posts: 158
Re: CPUID OVERRIDE patch!
« Reply #5 on: September 02, 2009, 08:11:17 PM »
...
 As far as I know, the cpuid infos are provided to the running software by the bios and not by the cpu chip itself.
...

That's wrong, and I suggest that you do more reading about the topic before any further discussion.

zef

  • Administrator
  • Posts: 265
Re: CPUID OVERRIDE patch!
« Reply #6 on: September 02, 2009, 09:48:30 PM »
ASUS P8Z68-V PRO/GEN3 | i5-2500k | 16GB RAM | GTX560 | Keyboard | Mouse | Devilsound DAC

george205

  • Entrant
  • Posts: 4
Re: CPUID OVERRIDE patch!
« Reply #7 on: September 03, 2009, 01:51:58 AM »
 I said "as far as I know" , not "I'am sure about it"! The difference between those seems to be clear enough I think. I repeat again: I'M NOT a programmer, computer genious,hacker or something like that. And I don't pretend to know everything!
 By the way, I found the answer to one of my previous questions which was:
"what other checks does an original apple kernel make to our hardware in order to run?"
CPU:
Kernel checks for GenuineIntel and certain CPU Families
Requires:
SSE2 for 32-bit
SSE3 for PPC emulation
SSSE3 for 64-bit

Oh yeah! Reading is good! ;-) I love it! :-)