Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Getting somewhere i hope..

So here's what i figured out:
I used hopperapp to disassemble the original (UN-patched) byte code from 10.7.5 (That's the only one i could get a hold of)
and found out, that TomTheMacUser modified a function called CheckTimingWithRange. So I googled that.
It turns out, the code involved is actually open source

it seems like Tom just bypassed all the ifs and jumped right to a point where all the checking was ignored.

I tried to do the same scheme on my Mavericks IOKit but when I restarted I was in an infinite loading loop.
So I pressed cmd S to get into single user mode and what that told me, was that IOKit has a wrong signature :O
I had to put my backup back in place to safely boot my mac again

It appears that apple now signs this piece of code in order to make this patch useless...

maybe I oversaw something

I'd appreciate some help :)
 
damn... can't sign it.


when I try to sign the original file with my own certificate it just signs it :(
with the patch i get the following error message
Code:
invalid or unsupported format for signature
 
I posted this in the iMac thread too, but here's what I said:

I found an interesting issue on my 13" rMBP (Intel HD4000) where the EFI (boot screen) will support 4k@30Hz (with Accel Active Adapter) but once OSX boots up it's back to 1080p.

When looking at System Info, the Displays section shows Adapter Type: DVI or HDMI. I believe this is why the Pixel Clock is limited to 165 MHz, the computer thinks you're on an HDMI connection so it artificially limits you to 165MHz. If it wasn't for this, Mavericks should probably be able to support 4k@30Hz as evidenced by the EFI supporting it briefly during boot.

So now the question remains: how do we get the computer to detect the Accel adapter as DisplayPort instead of HDMI?
 
Working patch

Hi all, as I mentioned, I was trying to patch forward, and I got around to doing this today.

As it turns out, I ran into mostly the same conclusions with regards to reverse engineering the patch, I am successfully running a patched IOKit without any problems. It's on 10.9.1, the only problem is that I haven't got my Seiki and my mini in the same building yet, so I can't test it.

If anyone wants to email me at my username @ my username dot com, I'll happily provide an updated patching tool they can try out.

Cheers,
Doug
 
Installed and working on a second Mac now, both without my Seiki. I suspect that flowgrow got the offset wrong (you have to account for the fact that it's a relative jump from the *next* instruction, and the patch introduces a no-op instruction at a different address than what would otherwise have been the next instruction).

If no one else contacts me, I'll be testing this with my Seiki on Monday.
 
And it works! On my Mac mini, it still requires the active displayport to HDMI adapter (trying this on the native HDMI port shows the resolution, but it goes blank when you try to switch to it).

I have a working Mac Mini, 4k seiki at 30Hz!

I'll be trying to get this incorporated into the google code project... and I have an attempt at a Radeon patch if there are any takers.

Also, as soon as 10.9.2 is finally released, I'll update the patch as well.

Finally, I'll try to document how I got the patch working, so anyone else can try to do the same, going forward, rather than having to reverse engineer the original patch.
 
And it works! On my Mac mini, it still requires the active displayport to HDMI adapter (trying this on the native HDMI port shows the resolution, but it goes blank when you try to switch to it).

I have a working Mac Mini, 4k seiki at 30Hz!

I'll be trying to get this incorporated into the google code project... and I have an attempt at a Radeon patch if there are any takers.

Also, as soon as 10.9.2 is finally released, I'll update the patch as well.

Finally, I'll try to document how I got the patch working, so anyone else can try to do the same, going forward, rather than having to reverse engineer the original patch.

Doug, do you think this patch would work for Mac Mini 2012 and Dell's 4K monitor P2815Q on Mavericks? I have a MacMini and I'm thinking of buying this $699 monitor since it natively can't run above 30Hz on full 4k resolution. Thanks!
 
I can't guarantee anything, but you're talking about the same resolution and same refresh rate as the seiki, so it should work. Note that everyone is using an active hdmi adapter to output 3840x2160@30Hz over the DisplayPort out and then convert to HDMI.

The Dell has a DisplayPort input, so the adapter shouldn't even be necessary.

With that being said, I'm curious as to why you're willing to spend $300 more for 10 inches less of screen real estate? (No judgements, just curious)
 
Thanks for answering! I'll probably try that when I get my hands on a 4k.

Well, I'd love to do that (10 inches more and save $300) but I'm currently working overseas and when I fly back to the US I'll purchase the 4k and then I'll fly back here with it. So it has to fit within my 29in luggage (I remove from the box and bubble wrap it, I've done this before with a 27in iMac). Otherwise I have to pay all kinds of taxes for airline/customs if I travel with a big brown box. Any 4k model that is below 29in and costs less than Dell's?
 
Sure, but even if you factor in a $50 charge to get the brown box onto the plane, that still leaves you with a 56% upcharge. Are you really saying that the import tariffs are going to be that much? Even if they charged you a 19% tax based on a $1000 value, that's still about $70 less than what you're paying.

In any case, I don't know of any 4k monitors cheaper than the Dell that *aren't* the Seiki.
 
I've posted my changes to a fork of the repository on Google code. Hopefully, at some point, Tom will merge the change back into the main repository.

Enjoy!

http://code.google.com/r/douglas-mac-pixel-clock-patch/

Great work Doug! I just tried this and it works flawlessly with the active adapter. I actually didn't need SwitchResX at all and the resolutions I wanted showed up right after reboot. Thanks!
 
Thank you Doug for posting the fix for 10.9.1, however on my mac mini I am getting strange display artifacts in place of the spinning wheel animation during startup, and on the menu bar / across the top of the screen. The resolution is at 3840x2160 @ 30hz though.

I have a clean install of mavericks (with the exception of your fix of course) on my mac mini and a 39" Seiki. Any help would be GREATLY appreciated.

Thank you!
 
Thanks!

He Doug, thanks a lot for the patch, also works on a 2012 MacBook Air (Intel HD 4000 as well). Does not work on a HD 5000 MacBook Air though. In case anyone has a working setup, let me know ... there is a similiar thread here at MacRumors.

@Doug – in case you have any idea, would be greatly appreciated, I'd pop in a small paypal donation for a nice bottle of wine as well ... ;-)
 
Any of you guys running HiDPI modes on your 4K monitors? I am trying to turn HiDPI on mine, and cannot find a way to do it (4K at 30Hz runs without any issues).
 
Enable HiDPI

I did it with this commands that I found via Google:
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool YES;
sudo defaults delete /Library/Preferences/com.apple.windowserver DisplayResolutionDisabled;


I believe the 2nd command failed, but HiDPI works anyway.

If you still don't see a HiDPI resolution, try clicking the "Scaled" radio button using the ALT key modifier.
 
Mavericks 10.9.2 breaks 4k on an iMac 2011

So I had my iMac 27" with an AMD Radeon HD 6970M running perfectly out of the box in 4k @30Hz since I got my Seiki, I didn't need any SwtichResX oder any patch.
However, after I upgraded to 10.9.2 yesterday, this is broken, I'm having the same issue as with my MBA 2012: I can only run it @17Hz.
Unbelievable. Sometimes, Apple really sucks! :mad:
 
I've updated the patch for Intel graphics at the site:
https://code.google.com/r/douglas-mac-pixel-clock-patch/

I've also included a patching tutorial which I'll paste below, so that in the future people don't have to wait for me.

Finally, to kanajunkey who is having the issue with the AMD graphics. In the patching file, there is an experimental fix for AMD cards on 10.9.1. You might want to try the same command on 10.9.2 to see if it fixes your problem. It may break things, so be prepared for that (a backup copy of the file is stored AMDSupport.bak), you might need to fix it in single user mode.

Experimental (try at your own risk) AMD fix with two commands:
sudo perl -i.bak -pe '$oldLimit1 = qr"\x75\x0C\x49\x81\x7E\x28\x40\xB3\xD5\x09"s;$newLimit1 = "\x75\x0C\x49\x81\x7E\x28\x00\x84\xD7\x17";$oldLimit2 = qr"\xFF\xFF\x48\x81\x7D\x80\x41\xB3\xD5\x09"s;$newLimit2 = "\xFF\xFF\x48\x81\x7D\x80\x01\x84\xD7\x17";s/$oldLimit1/$newLimit1/g;s/$oldLimit2/$newLimit2/g' /System/Library/Extensions/AMDSupport.kext/Contents/MacOS/AMDSupport
sudo touch /System/Library/Extensions


Finally, the tutorial:

# Instructions for how to reproduce the IOKit patch on a newer version of the
# binary:
#
# First, take the md5 hash of IOKit for storing in this file
# md5 -q /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
#
# For OS X 10.9.2, the result is
# 9804392bbe8ba4b589175be56889c6c7
#
# copy IOKit local and disassemble it
# cp /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit .
# otool -vt IOKit > IOKit.asm
#
# Open up that file and look for the function _CheckTimingWithRange. You can
# tell because the line begins with the function name and ends in a colon:
# _CheckTimingWithRange:
#
# Find the very first jump instruction in the function. In this case it is
# labelled JNE, which means jump if not equal. The instruction before is
# a comparison, and a literal translation to C would be expressed as:
# if(value1 != value2) goto result;
#
# Now we look at the address it's jumping to. In this case it's 0x17341
#
# Go down to that instruction, and you’ll see that there’s a gap between the
# last jump instruction before it and this block. That block is the cleanup
# section that returns a good response. This function is structured such that
# error cases and success share the same return block, with a success block
# just before the return block.
#
# We want to patch this function so that it always returns a good response,
# which means changing the first instruction to jump to the good block, which is
# the first instruction to follow the very last jump to 0x17341. The address
# of this block is 0x17327
#
# Jump instructions in this code are relative, se we need to calculate the
# offset being used by the current instruction, and also the address that will
# be used by the replacement instruction.
#
# Relative jump instructions are stored as an offset to the following
# instruction. So, in the case of the following code block:
# Address
# 1 JMP to 3
# 2 Do Nothing
# 3 Do Something
#
# The jump instruction would be encoded as 'Jump +1', since 2 is the address of
# the next instruction. This is because the processor automatically adds the
# distance to the next instruction with each instruction run, so it will be
# included into the starting calculation.
#
# For the existing code, we have the following information:
# Instruction: JNE 0x17341
# Address of instruction: 0x16f9e
# Address of next instruction: 0x16fa4
# Relative difference: 0x39d (925)
#
# Given that we want to jump to 0x17327 instead, which is 26 bytes of address
# closer (0x17341 - 0x17327), you might think that we need to work with
# a relative difference of 0x383 (899) but there's a slight catch.
#
# The instruction that is there, JNE, takes two bytes to express, and the new
# instruction, JMP, is a single byte instruction. That means that if we don't
# want to mess with the rest of the program, we have to pad with an instruction
# that does nothing, NOP, for No OPeration.
#
# Since the next instruction is now the NOP, which is now one byte closer, we
# must recalculate the offset using a relative difference of 0x384 or 900.
#
# The final two things you need to know to patch IOKit are the opcodes for the
# three instructions, and the endianness of the architecture.
#
# JNE is '0x0F 0x85', JMP is '0xE9', and NOP is '0x90'.
#
# Intel x86 is little endian, which means the small byte of a multi-byte number
# comes first (the little end comes first). This means that the four byte
# offset 0x0000039D will be in the instruction stream as 0x9D 0x03 0x00 0x00
#
# So, finally, the existing instruction is JNE +925, or JNE +0x39D, which is
# encoded as:
# (0F 85) JNE (9D 39 00 00) +925
# 0F 85 9D 39 00 00
#
# The instructions we want to replace it with are JMP +900, NOP, or JMP +0x384,
# NOP, which is encoded as:
# (E9) JMP (84 03 00 00) +900 (90) NOP
# E9 84 03 00 00 90
#
# Converting this into a perl command like below, you'll notice that the before
# and after bytes are exactly the same as in the 10.9.1 version. We test this
# by patching the local copy of IOKit with thw following command
#
# perl -i.bak -pe '$before = qr"\x0F\x85\x9D\x03\x00\x00"s;s/$before/\xE9\x84\x03\x00\x00\x90/g' IOKit
#
# We'll disassemble the newly patched file to make sure it does what we expect:
# otool -vt IOKit > IOKit_new.asm
#
# We compare the two versions:
# diff -u IOKit.asm IOKit_new.asm
#
# Looking at the output shows that the only difference is replacing the JNE
# with the two instructions, JMP (or JMPQ) and NOP.
#
# The final step is taking the md5 hash of the new version and updating this file:
# md5 -q /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
# 45d8fc0e1210f0672297a7716478990e
 
Unfortunately not working

Hi Douglas,

thank you very much for your effort, I was looking forward to it, but for some reason, the patch doesn't seem to work. I tried it on a MBA 13 2013, and everything works all right until I plug my external 4K monitor in. Then I get an uncoverable spinning wheel.
A similar issue I have with the iMac, here also a rollback of the IOKit helps (whereas the patched AMDSupport alone shows no effect).

Too bad :(
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.