Jump to content

[UEFIPatch] UEFI patching utility

BIOS patch power management UEFI

  • Please log in to reply
1629 replies to this topic

#361
beta992

beta992

    InsanelyMac Sage

  • Members
  • PipPipPipPipPip
  • 338 posts
  • Gender:Male

I'm not an expert, but I believe that HP insyde BIOS disables APIC/LAPIC which causes the OS X kernel to panic if booting with a multicore CPU.

There are currently two work arounds for that:
1- Either use cpus=1 as a kernel flag (which makes OS X use only one core) or
2- Patch the kernel to disable the lapic panic.

It seems that the latest Clover rev. has added a lapic patch, don't know if it is the same.

#362
ktzyeah

ktzyeah

    InsanelyMac Protégé

  • Members
  • Pip
  • 49 posts
  • Gender:Male

I think, there is no need to patch BIOS on Z77-based Gigabyte boards, they aren't locked by default.


I'm not familiar with this problem.
What is it about and how it got solved now?


Yeah you're right, thank you. I don't know why but I can't get more then 2 p-states with clover (16 and 39 with macmini6,1. unfortunately macmini6,2 makes the system reboot during boot)
With chameleon (and model macmini6,2) now i get up to 6 states ( 16 21 28 34 37 39 )

#363
CodeRush

CodeRush

    InsanelyMac Sage

  • Developers
  • 398 posts
  • Gender:Male
  • Location:Deggendorf, Germany
I don't know if this LAPIC bug can be solved with BIOS modification. At first, I need to figure out the difference between buggy BIOS and normal BIOS, and as far as I don't have any affected system, it can be very hard to do.
If this Clover patch is working, then it's easier to use it and do nothing with BIOS.

#364
Dr. Hurt

Dr. Hurt

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 1,473 posts
  • Gender:Male
  • Location:Cairo, Egypt and NYC, USA
  • Interests:Wandering around on the internet!! Politics, Sci/Tech, Medicine.
It's not really a bug in the BIOS, but rather a stupid decision by HP. I think the problem is that APIC is "disabled" by the BIOS and since this is an OEM BIOS there is no user-visible option to re-enable it.

What clover does is patch the kernel before booting to "disable" the panic. Not a very wise idea as kernel code could change anytime.

I saw people online unlocking Insyde BIOS which gives options to mess with APIC. Have a look here: http://forum.noteboo...ation-info.html

Once again, I'm no expert so I don't know if I'm making any sense here.

Thanks for your time.

#365
donovan6000

donovan6000

    InsanelyMac Protégé

  • Members
  • PipPip
  • 55 posts
  • Gender:Male

What clover does is patch the kernel before booting to "disable" the panic. Not a very wise idea as kernel code could change anytime.


I'm the guy who created the lapic patches that were added to clover by gsly.

The kernel code it patches has remained the same since at least 10.6.0. So unless Apple completely rewrites that portion of the kernel, clover should successfully fix this issue for a long time :thumbsup_anim:


@CodeRush I originally thought that the APIC table in the bios was responsible for the kernel panic, but I tried injecting modified versions of it using clover's

<key>ApicName</key>
<string>APIC.aml</string>
<key>DropAPIC</key>
<string>Yes</string>

but I couldn't get anything to fix it. I did notice that HP's APIC tables don't have any NMI entries as compared to most other vendor's. This was kind of interesting because the first lapic kernel fix discovered by yehla2amer involved adding this line of code to the kernel:

/* NMI: ummasked, off course */
LAPIC_WRITE(LVT_LINT1, LAPIC_LVT_DM_NMI);

Fixing the lapic problem with a bios mod doesn't seem worth it to me when Clover is now perfectly capable of achieving the same result :P

And are you still working on a successor to PMPatch? Haven't heard you mention anything about it for a while.

#366
CodeRush

CodeRush

    InsanelyMac Sage

  • Developers
  • 398 posts
  • Gender:Male
  • Location:Deggendorf, Germany
Thank you for explanation, Donovan.
Yes, i'm still woking on that PMPatch successor, but very slowly, because right now I have no time for programming at all.
In 2 months I have my last exams, and now I'm taking part of uC-related hardware project of my university, that consumes all my free time.
As far as I see, current PMPatch version is good enough and there is no reason to hurry.

#367
CodeRush

CodeRush

    InsanelyMac Sage

  • Developers
  • 398 posts
  • Gender:Male
  • Location:Deggendorf, Germany
New Intel CPU platform is now on the market and I'm waiting for it's first users, that try installing OS X on it and see if this patch is still needed.
Power management routines for Haswell have been changed a lot, so if our register is still 0xE2 and it's still locked, then we must find a way to patch the locking code out.
I need BIOS images from real Z87 boards, especially ASUS ones (not BIOS files from vendor sites), and MSRDumper reports.
To make a backup of your Z8x BIOS, use Intel FPT (attached) and one of batch files, running it as Administrator.
Try biosbck.bat first, if it works and produces biosbck.bin file, try backup.bat too. Attach your biosbck.bin or backup.bin file to your post.
Thank you in advance.

Attached Files



#368
CodeRush

CodeRush

    InsanelyMac Sage

  • Developers
  • 398 posts
  • Gender:Male
  • Location:Deggendorf, Germany
I have made a small research and now see, that Intel code is stable and persistent. No one knows what is it for, so no one touches it. And it goes unmodified from the beginning of the Universe to the end of it. :)
Behold, the 0xE2 locking code in ASUS Z87 WS BIOS based on AMI Aptio V platform:
80 FB 01
75 08
0F BA E8 0F
89 44 24 30
Looks familiar? Exactly the same code as in PowerManagement module for Sandy/Ivy, only located in different module named PowerMgmtDxe with GUID F7731B4C-58A2-4DF4-8980-5645D39ECE58.
Trivial change for PMPatch will make it compatible with new BIOSes.
The problem is that flashing modified BIOSes can be very hard on boards without USB Flashback feature, because of AMI's new protection, but there is nothing impossible for people with hardware SPI programmer. :)

#369
Andy Vandijck

Andy Vandijck

    InsanelyMac Deity

  • Coders
  • 1,613 posts
  • Gender:Male
  • Location:Tienen
  • Interests:Programming stuff for Mac OS X...
    Hacking...
    Hard rock (also really big Metallica...
I'm pleased to announce that this patch works fine for the
Asus P8H77-M LE bios.
Both with flashrom dumps and the original cap bios dumps.
Thanks Coderush ;)

#370
tonydickinson

tonydickinson

    InsanelyMac Geek

  • Donators
  • 188 posts
  • Gender:Male
  • Location:Singapore

I have made a small research and now see, that Intel code is stable and persistent. No one knows what is it for, so no one touches it. And it goes unmodified from the beginning of the Universe to the end of it. :)
Behold, the 0xE2 locking code in ASUS Z87 WS BIOS based on AMI Aptio V platform:

80 FB 01
75 08
0F BA E8 0F
89 44 24 30
Looks familiar? Exactly the same code as in PowerManagement module for Sandy/Ivy, only located in different module named PowerMgmtDxe with GUID F7731B4C-58A2-4DF4-8980-5645D39ECE58.
Trivial change for PMPatch will make it compatible with new BIOSes.
The problem is that flashing modified BIOSes can be very hard on boards without USB Flashback feature, because of AMI's new protection, but there is nothing impossible for people with hardware SPI programmer. :)


Hi CodeRush - Thanks for the heads up on this - appreciated and good luck with the final exams. Your work has made a significant difference to many of us with Asus boards and it looks as though more will be added to the list.

#371
naidb

naidb

    InsanelyMac Geek

  • Members
  • PipPipPipPip
  • 187 posts
  • Gender:Male
  • Location:ThaiLand
  • Interests:mainboards gigabyte GA-Z87X-UD3H
    CPU intel HasWell Core i5 4670K
    Gell 16Gb 1866
gigabyte Z87-UD3H do like doing this.
http://www.gigabyte....spx?pid=4481#sp
+CPU Haswell i5 4670k Purchased used

#372
giacomoleopardo

giacomoleopardo

    InsanelyMac Protégé

  • Members
  • PipPip
  • 63 posts
  • Gender:Male
Hello CodeRush, the new Zotac Z77 ITX bios (april 2013) gave me this
Last login: Wed Jun  5 23:07:47 on console
localhost:~ gio$ /Users/gio/Desktop/PMPatch /Users/gio/Desktop/A2290426.bin /Users/gio/Desktop/A2290426Patch.bin 
PMPatch 0.5.11
PowerManagement modules not found.
Trying to apply patch #1
Nested PowerManagement module at 0032FC8C not patched: Patch pattern not found.
AMI nest module at 00550048 not patched: PowerManagement modules not found in nested module.
Phoenix nest modules not found.
CpuPei module at 0079F3E0 not patched: Patch pattern not found.
localhost:~ gio$
Any idea?

#373
k3nny

k3nny

    InsanelyMac Legend

  • Members
  • PipPipPipPipPipPipPip
  • 538 posts
  • Gender:Male
The power management module itself is there but PMPatch is not able to find the patch pattern. It will need to be added to a future version. Until then you can try to do it yourself.

PS: Just found out PMPatch is able to patch a single module without without extracting the bios. Nice!

EDIT: Are you sure it needs to be patched at all? I suspect that it already is unlocked.

Edited by k3nny, 07 June 2013 - 05:45 PM.


#374
giacomoleopardo

giacomoleopardo

    InsanelyMac Protégé

  • Members
  • PipPip
  • 63 posts
  • Gender:Male
k3nny, I'm not sure at all! The previous release of this bios wasn't patched, so I wonder why this should? I'll dig on it and report results, unless CodeRush would help me out here! :)

#375
tonydickinson

tonydickinson

    InsanelyMac Geek

  • Donators
  • 188 posts
  • Gender:Male
  • Location:Singapore
@CodeRush.

Please to advise that PMPATCH works with the latest Asus BIOS 2003 for my Z77 Sabertooth, and fixes the power management issue. One is no longer able to write to nvram on these boards with the two latest BIOS releases (1908/2003) . We hoped it was a bug, but it now looks intentional as 2003 exhibits the same issue. Fortunately for Clover users there is a workaround using EmuVariableUefi-64.efi, which saves a nvram.plist to disk rather than the internal nvram which is now locked....

PMPATCH is great! Thanks.

#376
CodeRush

CodeRush

    InsanelyMac Sage

  • Developers
  • 398 posts
  • Gender:Male
  • Location:Deggendorf, Germany

Any idea?

Yes. Two weeks of writing letters to Zotac BIOS developes, and now we have:
1. Unlocked PM module, no need to patch it now
2. Darwin string in vanilla DSDT :)
3. vCore offset voltage ajustment
4. C3/C6/C7 report ajustment
5. CPU Spread Spectrum ajustment
6. Updated OROMs, EFI drivers and ME firmware
7. SATA mode for drives by default
Big thanks for Ilgonis Inspeters from Zotac for making it possible.

#377
nhymxu

nhymxu

    InsanelyMac Protégé

  • Members
  • Pip
  • 3 posts
  • Gender:Male
I'm patching for Toshiba L840 laptop but error.
My patch BIOS can work?
Attached File  Untitled.png   14.51KB   27 downloads

#378
CodeRush

CodeRush

    InsanelyMac Sage

  • Developers
  • 398 posts
  • Gender:Male
  • Location:Deggendorf, Germany

I'm patching for Toshiba L840 laptop but error.
My patch BIOS can work?

There is no errors on this screenshot. Yes, your BIOS must work.

#379
LatinMcG

LatinMcG

    Insanely digesting DSDT

  • Members
  • PipPipPipPipPipPipPipPipPipPipPip
  • 2,509 posts
  • Gender:Male
  • Location:Tampa, Florida

Yes. Two weeks of writing letters to Zotac BIOS developes, and now we have:
1. Unlocked PM module, no need to patch it now
2. Darwin string in vanilla DSDT :)
3. vCore offset voltage ajustment
4. C3/C6/C7 report ajustment
5. CPU Spread Spectrum ajustment
6. Updated OROMs, EFI drivers and ME firmware
7. SATA mode for drives by default
Big thanks for Ilgonis Inspeters from Zotac for making it possible.


wow sounds like gigabyte devs :P but with more options lol

i think ill be buying more Zotac stuff.. as i like devs that work with other non company devs.

#380
CodeRush

CodeRush

    InsanelyMac Sage

  • Developers
  • 398 posts
  • Gender:Male
  • Location:Deggendorf, Germany
Nice to hear it, LatinMcG.
I'm writing to ASUS guys now, hope they will do something about this lock too, if we promise to buy their new boards. :)





Also tagged with one or more of these keywords: BIOS, patch, power management, UEFI


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy