Kext for undervolting Mac Mini

Discussion in 'Mac mini' started by wbyung, Jul 22, 2009.

  1. wbyung macrumors member

    Jan 16, 2009

    I'm done with CoolBook which has not been updated for a while and the latest version 2.14 doesn't support my Mac Mini 2.26. So I decided to look around to see if there is any open source SpeedStep driver.

    And I found xnu-speedstep.

    It was stated that undervolt function was implemented but I find that the kext has some problem remembering the user defined voltage.

    I decided to modify the kext FOR MY OWN CPU.

    I ran CPUTest to load up the CPUs and undervolted from 1.175V to 0.975V and let it run for a while.

    0.95V would give kernel panic immediately.

    Then I rewrote the Auto-throttle section to disable frequency stepping and fix the frequency at the highest and undervolt. Basically everytime the timer runs it checks if the voltage and frequency is correct and recorrect if neccesary.

    The compiled kext would
    1) fix the CPU at the highest frequency
    2) fix the voltage at 0.975V

    At full load the power consumption is lowered from 14W to just 9W.

    If you are certain your CPU can run at 0.975V, try using it at your own risk.
    If not, edit the attached XCode project.

    The kext doesn't give consistent readings via sysctl. The debugger message loads the register directly from the CPU and confirms the buggy sysctl interface.

    Here is how the hex digits are read:

    815 in binary is 1000 0001 0101

    First 4 bits represent the frequency ID (multiplier). You would notice that the kext truncates the half multiplier.

    FID = 8
    8 X 266 = 2128

    Next 8 bit represent the voltage ID

    VID = 21
    Voltage = 21 X 125 + 7125 = 10000 --> 1000mV

    This is basically it. I could not think of anything else to post here at the moment.

    Attached Files:

  2. milk242 macrumors 6502a

    Jun 28, 2007
    Seems interesting, but I'm wearing of modifying my kexts without fully understanding everything. Are you basically modifying xnu-speedstep?
  3. wbyung thread starter macrumors member

    Jan 16, 2009
    Yes. I'm modifying the source code of xnu-speedstep.

    I am now running at 8.5 X 266 = 2.26GHz at 1.025V.

    Full load power consumption is down from 14.2W to 10.5W.

    The way xnu-speedstep handles power states is buggy. The highest pstate which is 2.26GHz doesn't show up via sysctl as 2.26GHz but instead 2.12GHz. I found the bug which misread the CPU register. In the original source code it checks if the first bit of the FID is "1". This is not the case in VoodooPower which checks the second bit.

    I modified the source code to change the register to 0x4819.

    "4" = 0100
    "8" = 1000

    4 is the "half multiplier"
    8 is the multiplier

    FID = 72
    VID = 25

    Then I deleted AppleIntelCPUPowerManagement.kext to remove the Apple's Speedstep implementation.

    The end result is not a cooler running mac. In fact I think it's running warmer because Apple tends to put the CPU off the highest state unless CPU load is very high. However I do notice the OSX GUI is a little smoother.

Share This Page

2 July 22, 2009