Jump to content

Haswell early reboot, Mavericks, locked MSRs, and HP Envy 15-J063CL (i7-4700MQ)


RehabMan
 Share

469 posts in this topic

Recommended Posts

First, this patch got my hackintosh up and running, so thanks!

 

I'm not sure if it's related to the 10.9.4 update, but the power options don't work well anymore. If I try to shutdown or restart the computer, OSX powers down, but the computer never shuts off or restarts. 

 

The console logs the following error message:

Terminal: XPC error messaging com.apple.IconServicesAgent: Connection interrupted
Terminal: XPC error messaging com.apple.IconServicesAgent: Connection invalid

Any idea if this is related to the xpcm patch, and how to fix?

 

Thanks

Link to comment
Share on other sites

First, this patch got my hackintosh up and running, so thanks!

 

I'm not sure if it's related to the 10.9.4 update, but the power options don't work well anymore. If I try to shutdown or restart the computer, OSX powers down, but the computer never shuts off or restarts. 

 

The console logs the following error message:

Terminal: XPC error messaging com.apple.IconServicesAgent: Connection interrupted
Terminal: XPC error messaging com.apple.IconServicesAgent: Connection invalid
Any idea if this is related to the xpcm patch, and how to fix?

 

Thanks

 

Not really anything to do with XCPM patch. Patching for XCPM/locked MSR 0xE2 just gets you past the early reboot problem.

 

It is what you do after to enable power management that matters for sleep...

Link to comment
Share on other sites

Not really anything to do with XCPM patch. Patching for XCPM/locked MSR 0xE2 just gets you past the early reboot problem.

 

It is what you do after to enable power management that matters for sleep...

Hi, RehabMan,

Your patch works perfectly in 10.9.1 & 10.9.4 for my Asus G750JZ laptop.

Thanks a lot !

 

Someone said who got it from RehabMan:

sudo perl -pi -e 's|(\x3B\x05\xAE\xFC\x69\x00)\x74\x11|${1}\xEB\x11|g' kernel

It seems not needed for 10.10 (Yosemite) DP2 or DP3.

Because using newest Clover with KernelPm & KernelLapi is working now.

Link to comment
Share on other sites

  • 3 weeks later...

RehabMan,

Mavericks 10.9.4 MD5 (mach_kernel) = 33e741649352c1545a269cf0700d65e0 this is the xcpm patched kernel 

I wonder if you have (created) a lock MSR Envy 17-178CA that has same config of your laptop but this is 17".

I do not use Clover at all cause i have no idea how it works and how to set it up. I am using now Chameleon 2391. Thank you for your time my Hero.

BTW i installed 10.10 on acer laptop V3-771 and on my Asus Z77 desktop and working great with dsdt you teach me how to do it ....remember!!!!

thanks for your time and appreciate your time and work for Hackintosh community.

Link to comment
Share on other sites

RehabMan,

Mavericks 10.9.4 MD5 (mach_kernel) = 33e741649352c1545a269cf0700d65e0 this is the [/size]xcpm patched kernel 

Post #1 has the md5 for XCPM patched mach_kernel. It is different from your md5 above (so I think yours is wrong).

 

I wonder if you have (created) a lock MSR Envy 17-178CA that has same config of your laptop but this is 17".

Not sure I understand the question. I do not have a 17" laptop. And I don't have the HP Envy anymore...

 

I do not use Clover at all cause i have no idea how it works and how to set it up. I am using now Chameleon 2391. Thank you for your time my Hero.

BTW i installed 10.10 on acer laptop V3-771 and on my Asus Z77 desktop and working great with dsdt you teach me how to do it ....remember!!!!

thanks for your time and appreciate your time and work for Hackintosh community.

Learning Clover is worthwhile...

Link to comment
Share on other sites

 this md5 is what i got, i knew that u don't have it anymore. What u had is 15"  (Envy), i got 12 P states

i use chameleon now and i wonder how i can learn how to setup and use Clover!!!

Thank you my Hero

Link to comment
Share on other sites

this md5 is what i got,

Then you started with an incorrect kernel for 10.9.4. md5 for vanilla mach_kernel is also provided in post #1.

 

Your md5 is 10.9.3 mach_kernel patched for XCPM and lapic.

 

i knew that u don't have it anymore. What u had is 15"  (Envy), i got 12 P states

i use chameleon now and i wonder how i can learn how to setup and use Clover!!!

Thank you my Hero

There is much to learn to transition to Clover, but if you have a solid understanding it should not be difficult.

 

Use a USB with Clover on it until you have it working.

Link to comment
Share on other sites

Then you started with an incorrect kernel for 10.9.4. md5 for vanilla mach_kernel is also provided in post #1.

 

Your md5 is 10.9.3 mach_kernel patched for XCPM and lapic.

 

 

There is much to learn to transition to Clover, but if you have a solid understanding it should not be difficult.

 

Use a USB with Clover on it until you have it working.

I see, If i make a usb with Clover installed i will learn it fast than having a clover HOW TO  installer for my HP, this way i can test 10.10 on it cause as u told me few days ago that i can patch Kernel for locked MSR.

I will start reading and testing Clover with it, any link!!!!!

Thank you 

Link to comment
Share on other sites

I see, If i make a usb with Clover installed i will learn it fast than having a clover HOW TO  installer for my HP, this way i can test 10.10 on it cause as u told me few days ago that i can patch Kernel for locked MSR.

I will start reading and testing Clover with it, any link!!!!!

Thank you

I don't know about "learn it fast," but using USB allows you to experiment with it without breaking your existing install.

Link to comment
Share on other sites

I am running an Msi Gaming 5 Z97 LGA1150 motherboard with a R9 280  GPU and G3258 CPU. I've installed the no xcpm kernel and this is where I'm stuck at if any of you could help that'd be much appreciated thank you.

 

Edit: Tried patching with kernel with the aforementioned patch and still to no avail. Picture.

Link to comment
Share on other sites

I am running an Msi Gaming 5 Z97 LGA1150 motherboard with a R9 280  GPU and G3258 CPU. I've installed the no xcpm kernel and this is where I'm stuck at if any of you could help that'd be much appreciated thank you.

 

Edit: Tried patching with kernel with the aforementioned patch and still to no avail. Picture.

OS X Mavericks does not support Haswell Pentium/Celeron... only Core i-series.

Link to comment
Share on other sites

Oh, well that sucks. Is there any work on it yet, if not what version of OSX can I install?

Some people say 10.8.5 does not have this limitation. However, the data I see is mixed on that point...

 

And 10.8.5 is the first OS X version with Haswell support.

Link to comment
Share on other sites

Hm, dammit. Looks like I'm going to have to try Mountain Lion. I've spent the past 2-3 days trying everything. I've recreated by USB stick about 5 times, and had to redownload Mavericks twice. /me Sighs. Thanks again, I hope Mavericks supports Haswell someday.

Link to comment
Share on other sites

Hm, dammit. Looks like I'm going to have to try Mountain Lion. I've spent the past 2-3 days trying everything. I've recreated by USB stick about 5 times, and had to redownload Mavericks twice. /me Sighs. Thanks again, I hope Mavericks supports Haswell someday.

Mavericks supports Haswell just fine. Just not the Haswell Pentium/Celeron chips (keep in mind Apple doesn't use those chips in their computers).

  • Like 1
Link to comment
Share on other sites

Mavericks supports Haswell just fine. Just not the Haswell Pentium/Celeron chips (keep in mind Apple doesn't use those chips in their computers).

That is a good point. Keeping my hopes up that someones finds a workaround for this issue. Thank again for helping me not spend another week trying to run a Haswell Pentium on Mavericks. :)

Link to comment
Share on other sites

That is a good point. Keeping my hopes up that someones finds a workaround for this issue. Thank again for helping me not spend another week trying to run a Haswell Pentium on Mavericks. :)

Maybe a patch could be created for the kernel, but it would require:

- someone motivated (eg. person has the hardware, and doesn't want to just swap the CPU for a compatible one)

- someone with the skills (x86 assembly language... a knack for binary patching)

- someone with the time (binary patches to the kernel can be time consuming)

  • Like 1
Link to comment
Share on other sites

Got it to work on 10.8.5. The only issues are that the ALC1150 Codec from [url="http://www.insanelymac.com/forum/topic/279450-why-insanelymac-does-not-support-tonymacx86/"]#####[/url] doesn't work with any of my headphone ports and E2205 LAN controller isn't supported. 

Link to comment
Share on other sites

You could attempt using an AMD Kernel which works just as well. I did this temporarily when I moved from my AMD Setup to my new Intel Setup just recently, it works well, and I can also boot with caches..

The problem with any kind of mach_kernel built from sources, including one for AMD is you'll be unable to access Apple services (iCloud, FaceTime, Messages, etc.)

 

 

Plus there is no reason to do that if you have a supported Intel CPU.

Link to comment
Share on other sites

I wrote this "somewhere else" as well, but I thought this might be interesting here too...

 

Haswell/Mavericks Troubles

 

Many people with Haswell laptops (and some desktops) have been running into a new problem Apple has thrown at us. The new Mavericks kernel has power management moved down into the kernel. For this reason, my MacBookAir6,2 running Mavericks does not load AppleIntelCPUPowerManagement. In the past, we patched AppleIntelCPUPowerManagement to avoid the kernel writing to locked CPU MSRs (machine specific registers, credit RevoGirl). Some BIOSes lock some of these registers (the common one is 0xE2, I don't know if others can be locked as well). The problem is that touching these registers when they are locked causes an unexpected fault and you get a KP. It seems this KP is so early, that the kernel is unprepared to handle it, and the computer reboots.

 

Some people have found that if they use a kernel modified for AMD systems, they are able to boot. I tried this and it indeed works. But other things break... I was able to install (using that kernel), but I couldn't boot with caches (always had to use "-f"). Booting with caches caused a KP. In addition, there was no power management. CPU was running at x24 always.

 

But...

 

I decided to see what I could do by building my own kernel. My main thought was to make some changes, see if I could avoid touching locked MSRs with modifications to the source code with the idea to fold the changes into a patch. So, I downloaded the kernel source from opensource.apple.com, found out how to build it (thanks google!), and tried to use it. On first try, I didn't make any changes... and I was surprised that I was able to start the installer with the newly built kernel! No changes and it just works. WTF?

 

Turns out the sources for the kernel do not include the parts for xnu power management. Since it isn't there, it doesn't cause the problem. But of course, AppleIntelCPUPowerManagement expects for PM to be provided by the kernel, so it doesn't work. It doesn't crash, but still no power management. Since 10.8.5 does not have this change, I decided to try the (patched) AppleIntelCPUPowerManagement from 10.8.5 (v214). And that actually works.

 

I don't really like doing rollbacks like that, but it is probably a workable solution until something better comes along. I still think it might be possible to patch the kernel to avoid the MSR writing problem.  See updates below on patches.

 

Update 2013-11-25

 

With some prodding by Pike's blog, I went back to my original patch that I had attempted a number of weeks ago, and I found the mistakes I had made with my patch (this was prior to building the kernel from sources). The details are on my blog here: http://racerrehabman.wordpress.com/2013/11/25/maverickshaswell-kernel-patch-for-early-reboot/

 

As a result, I'm now running a patched mach_kernel (not built from source, but patched from retail), MacBookPro11,2 smbios.plist, AppleIntelCPUPowerManagement.kext, ssdt.aml generated with Pike's script (plugin-type=1). Of course, AppleIntelCPUPowerManagement does not load, as all CPU power management is handled by the kernel (xcpm). In other words, it is running just as a real Haswell MacBookPro would as far as power management. The only "problem" that I can see, is that I'm not getting pstates between x8 and x24, much like the results with iMac14,2. I wonder if something is missing (taking the place of X86PlatformPlugin plists?) that the bootloader/DSDT/SSDT should be injecting to inform the kernel's xcpm behavior? More investigation is needed. I will investigate by watching the behavior of my real MacBookAir6,2 and perhaps a friend's real MacBookPro11,x.

 

Update 2013-11-26

 

It appears that having a jump in pstates from idle to nominal (in this case x8 to x24) is by design. It appears to be intentional. I loaded AppleIntelCPUPowerManagementInfo.kext on my MacBookAir6,2 and it too jumps from idle (x8) to nominal (x17) with no states in between.

 

Update 2013-12-30

 

By borrowing some files from a real Mavericks 10.9.1 install on a real MacBookPro11,2, I was able to achieve states in between idle and nominal:

 

AICPUPMI: CPU P-States [ 8 (17) 24 26 29 30 31 32 33 34 ] GPU P-States [ 17 ]

 

Note new state 17.  This was booting via Clover with MacBookPro11,2 smbios and custom SSDT using ssdtPRgen.sh.

 

In order to do this, I borrowed from the Mac:

/System/Library/CoreServices/PlatformSupport.plist

/System/Library/Extensions/IOPlatformPluginFamily.kext

/mach_kernel (version 13.0.2, patched for xcpm)

 

I'm not sure the kernel replacement was necessary, but I did it anyway.  I think this means that when a future version of OS X arrives that has true support for MacBookPro11,2, things will work a bit better.  I find it interesting that an owner of a a real MacBookPro11,2 cannot do a fresh install of 10.9.1 from the App Store and expect their machine to work as it should.

 

Computer Specifics

HP Envy 15-J063CL (Costco)

i7-4700MQ @2.4Ghz, 12GB RAM

HM87 chipset

HD4600 graphics (1080p panel),

BCM4352 ac WiFi (works with only injection)

RTL8111/8168/8411 (works with RealtekRTL8111)

(I am not certain that I'm keeping this laptop...)

 

Working:

- power management (see pstate results below)

- booting with caches

- HD4600 graphics (this computer uses eDP) (ig-platform-id=0x0a260006)

- HDMI

- USB3 (before *and* after sleep)

- trackpad/keyboard (Synaptics)

- sleep

- sleep triggered by lid

- shutdown/restart

- backlit keyboard on/off (must be hardwired)

- Camera (kind of grainy, but could be poor lighting)

- display brightness (works after display sleep with PNLF DSDT patch)

- works with patched AppleHDA (volume seems low)

 

Not Working/Not Started/In progress

 

Not Tested

- Bluetooth

 

Notes:

- Fixed USB3 after sleep by switching from native AppleUSBXHCI to GenericUSBXHCI with -gux_defer_usb2 flag.

- To avoid strange flicker/flash of display upon boot, make sure to use "Graphics Mode"=1920x1080x32

 

PStates:

 

iMac14,2 (X86PlatformPlugin)

DPCIManager PStates: 8,24,25,26,27,28,29,30,31,32

 

MacBookPro8,3 (ACPI_SMC_PlatformPlugin)

DPCIManager PStates: 8,12,16,20,24,26,28,30,31,32

 

MacBookPro11,2 (xcpm, patched mach_kernel)

DPCIManager PStates: 8,24,25,26,27,29,30,32,33

 

MacBookPro11,2 (xcpm, parts borrowed from real MacBookPro11,2 install):

DPCIManager PStates: 8, 17, 24, 25, 26, 28, 29, 30, 31, 32

 

 

See my blog for perl patch for mach_kernel.

 

For ease of use, I'm providing the patches from my blog here. Please note these patches are only for applying to vanilla mach_kernel, not the "xcpm free" kernel for 10.9 provided as the attachment. The two techniques are mutually exclusive. Either you use "xcpm free" and old school PM, or you use patched kernel and new school (xcpm) PM.

 

For 10.9.x:

perl -pi -e 's|\x74\x6c(\x48\x83\xc7\x28\x90\x8b\x05..\x5e\x00\x85\x47\xdc)\x74\x54(\x8b\x4f\xd8\x45\x85\xc0\x74\x08\x44\x39\xc1\x44\x89\xc1)\x75\x44(\x0f\x32\x89\xc0\x48\xc1\xe2\x20\x48\x09\xc2\x48\x89\x57\xf8\x48\x8b\x47\xe8\x48\x85\xc0\x74\x06\x48\xf7\xd0\x48\x21\xc2\x48\x0b\x57\xf0\x49\x89\xd1\x49\xc1\xe9\x20\x89\xd0\x8b\x4f\xd8\x4c\x89\xca)(\x0f\x30\x8b\x4f\xd8\x0f\x32\x89\xc0\x48\xc1\xe2\x20\x48\x09\xc2\x48\x89\x17\x48\x83\xc7\x30\xff\xce)\x75\x99(\x5d\xc3)\x90{7}|\x74\x73${1}\x74\x5b${2}\x75\x4b${3}\x66\x81\xf9\xe2\x00\x74\x02${4}\x75\x92${5}|g' mach_kernel
For 10.8.5:

perl -pi -e 's|\x74\x69(\x48\x83\xc7\x28\x90\x8b\x05\xfe\xce\x5f\x00\x85\x47\xdc)\x74\x51(\x8b\x4f\xd8\x45\x85\xc0\x74\x05\x44\x39\xc1)\x75\x44(\x0f\x32\x89\xc0\x48\xc1\xe2\x20\x48\x09\xc2\x48\x89\x57\xf8\x48\x8b\x47\xe8\x48\x85\xc0\x74\x06\x48\xf7\xd0\x48\x21\xc2\x48\x0b\x57\xf0\x49\x89\xd1\x49\xc1\xe9\x20\x89\xd0\x8b\x4f\xd8\x4c\x89\xca)(\x0f\x30\x8b\x4f\xd8\x0f\x32\x89\xc0\x48\xc1\xe2\x20\x48\x09\xc2\x48\x89\x17\x48\x83\xc7\x30\xff\xce)\x75\x9c(\x5d\xc3)\x90{7}(\x90{3})|\x74\x70${1}\x74\x58${2}\x75\x4b${3}\x66\x81\xf9\xe2\x00\x74\x02${4}\x75\x95${5}${6}|g' mach_kernel
How to patch your kernel

 

The vanilla mach_kernel is located on your USB installer after creating your USB (with whatever tool you like :-). Here's how to patch it:

 

 

 

 

 

# in Terminal, assuming your USB is called Installer
cp /Volumes/Installer/mach_kernel ~/Desktop/mach_kernel_backup
cp /Volumes/Installer/mach_kernel ~/Desktop/mach_kernel
cd ~/Desktop
# now copy/paste one or more of the perl patches from above into Terminal
perl ...[from above]... mach_kernel
perl ...[from above]... mach_kernel
# patched mach_kernel is now at ~/Desktop/mach_kernel
sudo cp mach_kernel /Volumes/Installer/mach_kernel
After you install OS X to your HDD, you will have vanilla mach_kernel on the HDD, leading to the same instant reboot problem. So, you must re-enter the OS X installer, and go into Terminal (using Utilities -> Terminal) and replace the mach_kernel with the patched version:

# in Terminal from the OS X installer, assuming your HDD volume is called "Macintosh HD"
cp /mach_kernel "/Volumes/Macintosh HD/mach_kernel"
After that, you can exit the installer, and boot into the installed partition to finish installation and reach the desktop.

 

MD5 sums for mach_kernel

 

Check your md5 sums with:

md5 mach_kernel
10.9.4 mach_kernel

vanilla: 3d0ad5a7a8ef3b1d4e6ea33e92e4d3b5

xpcm patched: 921c850e3062e750730b0e99f5eaa381

 

10.9.3 mach_kernel

vanilla: 5ba55b0d446094f82e48e8a413ddfaec

xcpm patched: 6848b1904426d5e270a2db6fada67fb0

 

10.9.2 mach_kernel

vanilla: 15ce54d9b6edc47e282fdf038f71738c

xcpm patched: aeb9203dc754afac23bf9696833032fe

 

10.9 mach_kernel

vanilla: 06b687fa00945c97e06ad1919625793c

xcpm patched: 88bf62a7955b9e20cdb19906bdda6b43

 

10.8.5 mach_kernel

vanilla: e835be83eb956af0b63d28f69bfb22b3

xcpm patched: 539c3a1e2fef063384b44543765b8a39

 

 

DSDT Patches:

 

I have published my DSDT patch project on github. It relies heavily on my generic laptop DSDT patch repo. Read the README.md and setup carefully in order to use.

 

https://github.com/RehabMan/HP-Envy-DSDT-Patch

 

 

10.9 kernel (xcpm free) built from Apple's sources is provided below. Note: DO NOT apply the patches to this attached kernel... they will have no effect. The patches are for vanilla mach_kernel.

 

Update 2014-02-13

Attached mach_kernel built from Apple's sources removed. There is no reason to use it. Use the provided patches to create a mach_kernel that works with machines with locked MSR 0xE2.

 

Does this patch work for 10.9.5 ?

Link to comment
Share on other sites

  • 3 weeks later...
 Share

×
×
  • Create New...