Jump to content

fluid | fixed

iWin32

iWin32

Member Since 21 Nov 2009
Offline Last Active May 19 2013 03:28 PM
*****

[GUIDE] How to enable custom resolution for first-gen Intel HD Graphics (0042:8086 and...

31 December 2012 - 10:58 PM

How to Enable Resolution on Intel HD Graphics (0046:8086 and 0042:8086)


Background Info:
It has been said since the dawn of time: “Ye who build a Hackintosh must select a Graphics Card that ye can find in a real Mac to ensure 100% compatibility.”  However, it appears a very rare exception is ye…I mean the infamous Intel HD Graphics.  These first-gen integrated Graphics Cards found on Core iXXX processors are the first to use the new I/O design, integrating the Northbridge into the CPU itself.  The Intel HD Graphics chips have been used in real Macs before, like the Mid-2010 MacBook Pro.  The problem: Every Mac that has the integrated Graphics chip also has a dedicated Graphics Card, like the NVIDIA GeForce GT 330M on the same MacBook Pro model.  Therefore, it’s not that Apple didn’t write drivers for the Intel HD Graphics, but their drivers are, well, buggy on PCs, resulting in either a frozen or blank screen once the framebuffer Kext loads.

People have worked out a way to enable partial Quartz Extreme in Snow Leopard 10.6.7, but even that is very buggy.  Try to launch anything Full Screen, get greeted with a surprise Kernel Panic.  There was no hope as to how to get full resolution…until now!

Manor had thought he had found a way to enable full resolution on Intel HD Graphics, but what he didn’t realize was that his VESA mode tables in his Video BIOS supported his resolution.  Everyone that his “fix” worked for them also had it supported in their Video BIOS.  Everyone else likely had the maximum of 1024x768 in their mode tables, and therefore couldn’t work.

Since then, people had suggested patching the Video BIOS on the fly with the Resolution module… a module based off of the 915resolution Linux hack that also patches NVIDIA and some ATI cards.  However, by itself, it doesn’t do a thing.  Yet, a recent patch to the module enables support for the Intel HD Graphics!  This isn’t a simple one-for-all compile, however.  Why?  The patch is full of hacks, and it requires you to insert your DTD, an 18-byte sequence extracted from your EDID, into the source code directly.  You need a little bit of programming knowledge, but it’s so trivial that just about anyone with little to no programming knowledge (like me) could patch.

So, what do you need to get this patch to work?

Requirements:
  • Access to Mountain Lion with XCode installed and network access (to compile Chameleon)
  • Access to Windows
  • Extracted EDID of the computer in question UPDATE: If you want, you can try RemC's module in this post; it should be universal and not require any source code patching on your part.  Look at the second post: http://www.insanelym...6/#entry1877529
  • A flash drive (optional, even an old 256MB flash drive would do)
You’ll also need to download these tools:
  • DTD Calculator – http://www.clevertec...roductsfree.htm
  • Attached Resolution source code IMPORTANT UPDATE (4/4/2013): If you plan on enabling QE/CI (see below), don't bother with any form of the resolution module.  The patched framebuffer will allow custom resolution without the resolution module.  The Resolution module is only needed if you want custom resolution on your boot screen.  Otherwise, don't mess with it as it may cause distortions.  The guide is below is kept for legacy purposes/for those who want to create their own Resolution Module.
How to Extract your EDID:
This is pretty self-explanatory in another thread: http://www.insanelym...s/#entry1392033

Go to Solution B.  I prefer using the Windows way, but the link to the utility there is dead.  Go here: http://www.eldim.fr/...lite-free-tools and click the link that reads “EDID Viewer utility”.  Please note, though, and I cannot stress this enough: THIS NEEDS TO BE RUN ON THE COMPUTER WITH INTEL HD GRAPHICS INSIDE.  THIS WILL EXTRACT THE EDID VALUE FROM YOUR MONITOR, SO YOU NEED TO RUN IT ON THAT COMPUTER ONLY!  (Sorry for shouting, but EDID varies from monitor to monitor, even LCD monitors from the same laptop model with the same max resolution.  Using someone else’s EDID is like using someone else’s DSDT.aml file.  Thus, run only on your computer with Intel HD Graphics on it.)

Save your EDID raw data somewhere, or copy your EDID to your clipboard if you’re using the same computer.  Now that you’ve got that saved, you’re ready to go to step 1.

Step 1 – “Convert” EDID to DTD:
I put the word convert in quotation marks because we really aren’t converting it.  All we’re doing is extracting specific 18 bytes from the EDID raw data.  Launch DTD Calculator and a text editor.  For our purposes, Notepad will do.  When you copy the raw data from ELDIM, it’ll look something like this:
0x00 00 FF FF FF FF FF FF 00 30 E4 AC 02 00 00 00 00	
0x10 00 14 01 03 80 22 13 78 0A C1 25 9D 5F 5B 9B 27	
0x20 19 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01	
0x30 01 01 01 01 01 01 12 1B 56 78 50 00 0E 30 20 20	
0x40 24 00 58 C2 10 00 00 19 00 00 00 00 00 00 00 00	
0x50 00 00 00 00 00 00 00 00 00 00 00 00 00 FE 00 4C	
0x60 47 20 44 69 73 70 6C 61 79 0A 20 20 00 00 00 FE	
0x70 00 4C 50 31 35 36 57 48 32 2D 54 4C 51 42 00 C1	


You need to have the raw hex data in a single line with only a space to separate them.  Using mine, it then should read like this:

00 FF FF FF FF FF FF 00 30 E4 AC 02 00 00 00 00 00 14 01 03 80 22 13 78 0A C1 25 9D 5F 5B 9B 27 19 50 54 00 00 00 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 12 1B 56 78 50 00 0E 30 20 20 24 00 58 C2 10 00 00 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FE 00 4C 47 20 44 69 73 70 6C 61 79 0A 20 20 00 00 00 FE 00 4C 50 31 35 36 57 48 32 2D 54 4C 51 42 00 C1

In DTD calculator, click the Interpret EDID tab, and paste the resulting string in there.  And then click Interpret EDID.

It should say the DTD on the bottom right.  Double click it.  You may get a warning that reads “Entered DTD and Generated DTD don’t match”.  Ignore it.  To make sure you’ve got it right, or if there is more than one, the right should have a value under H Active Pixels and V Active Lines.  These values should be your resolution.

Now click the Calculation tab.  On the bottom you’ll see the calculated DTD.  Click in the text box.  Press Ctrl+A to select the text and Ctrl+C to copy it to the clipboard.  This is the DTD.  Here is my DTD as an example:
12 1B 56 78 50 00 0E 30 20 20 24 00 58 C2 10 00 00 18

Paste it into a notepad window and save it as a text document.  Make sure you’ll be able to access this on the machine where you’ll be compiling Chameleon.

Speaking of which, we now need to move onto the next step, which happens to be compiling Chameleon.

Step 2: Compile Chameleon with Modified Resolution Code

Just like its mother, 915resolution, the Resolution module will modify our VBIOS on the fly to allow us to select a different resolution from the VESA tables.  Therefore, before we compile, we need to modify the code.  Thankfully (with many thanks to InsanelyMac User and Chameleon developer orlian, as well as Chameleon developer dmazar), we can patch use already modified code.  However, we still need to replace the present DTD with ours.  Remember, as this is from EDID, it will vary from monitor to monitor.  But first, we need to download and clean up Chameleon’s source code.  To do so, download XCode on Mountain Lion, and install command line tools.  You can use an already existing hackintosh with internet, a real Mac, or, like me, use a VMware virtual machine.

Once you have XCode installed, open a terminal window (don’t freak out if you’ve never used command line before; these commands are safe) and type the following commands:
mkdir chameleon-imod
cd chameleon-imod
svn co http://forge.voodooprojects.org/svn/chameleon/trunk/
cd trunk
make clean


If all goes well, there should be a folder called “chameleon-imod” in your home folder.  In there, should be only one folder called trunk.  Inside that folder should be all sorts of file, including an XCode project called Chameleon.  Navigate further into i386 > modules.  This contains the source code for the individual Chameleon modules.  Delete the folder called Resolution and empty the trash.  Then, replace it with the attached Resolution source code.

Attached File  Resolution.zip   18.5K   157 downloads

Now, in the Resolution folder, open the file called 915resolution.c.  This will open an XCode Window and navigate to line 32.  The code should be:
		 map = open_vbios(CT_UNKNOWN);
	 // if(map)
		 {
				 unlock_vbios(map);
		 char* bytes = (char *)VBIOS_START;
		 int patchlocation = 0x0254;
		 verbose("Addr: %X Before patch: %x - ", patchlocation, bytes[patchlocation] );
		 bytes[patchlocation] = 0x8A;
		 verbose("after patch: %x \n", bytes[patchlocation++] );
		 bytes[patchlocation++] = 0x25;
		 bytes[patchlocation++] = 0xA0;
		 bytes[patchlocation++] = 0x20;
		 bytes[patchlocation++] = 0x51;
		 bytes[patchlocation++] = 0x84;
		 bytes[patchlocation++] = 0x1A;
		 bytes[patchlocation++] = 0x30;
		 bytes[patchlocation++] = 0x30;
		 bytes[patchlocation++] = 0x40;
		 bytes[patchlocation++] = 0x36;
		 bytes[patchlocation++] = 0x00;
		 bytes[patchlocation++] = 0x30;
		 bytes[patchlocation++] = 0xBE;
		 bytes[patchlocation++] = 0x10;
		 bytes[patchlocation++] = 0x00;
		 bytes[patchlocation++] = 0x00;
		 bytes[patchlocation++] = 0x1E;


This is the portion we need to modify to match our DTD.  Every byte XX in our DTD is read by the source code as bytes[patchlocation++] = 0xXX;

Therefore, in my DTD code, 0x8A becomes 0x12, 0x25 becomes 0x1B, 0xA0 becomes 0x56, etc.

Once that’s modified, save it and exit XCode.  We’re now ready to compile Chameleon.  Navigate back to the terminal window and type:

make

I know it’s a pain we have to compile all of Chameleon when we only need to compile the resolution module, but we can’t just type make in the directory of the resolution module source code; I’ve tried it and it doesn’t do anything.

Once that’s taken care of, navigate back up to the trunk directory, and in the sym folder, should be the i386 folder of Chameleon binaries.  If you’re going to do step three, copy this back to a Windows computer.  I recommend compressing it into a zip file first if you do that.  If not, go straight to step 4.

Why am I suggesting you don’t have to do step 3?

Step 3: Install Chameleon to a test flash drive (optional)
This is not required, but I do recommend you do this.  Why?  There isn’t any reason to believe you can’t simply copy the resulting Resolution.dylib to /Extra/modules/ folder.  However, if something went wrong and the computer can’t boot due to wrong resolution/poor timings, the resolution module is only present on the Flash Drive and you can simply reboot off of the hard drive without issues and try compiling again.  If you skip step 3, though, you’re stuck until you boot without the module.  Therefore, I recommend you install Chameleon to the flash drive for testing purposes.  Once you go into Windows, I’ll be showing you a somewhat new way to install Chameleon using Clover’s Win32 tools.

Download the package called Win_USBTools-Fat32_Clover_v2_rL954.zip from here: http://www.osx86.net..._efi_tools.html

Extract the archive inside there called USBTools-Boot1f32.zip.  Be sure to back up everything on your flash drive that you need.  We’re going to format it with the tool HPUSBFW.EXE.  Run it as administrator, select your flash drive, and tick quick format.  Make sure it’s set to format it to FAT32.  Click start.  Confirm you want to continue and let it do its thing.

Once that’s done, and this is important, unplug it (don’t use safely remove hardware), and plug it back in.

Next, open a command prompt in the extracted directory as administrator, and type:

BootUSB.bat X:

Where X is the drive letter of your flash drive.  If it completes without errors, do the same replug method as before.

Finally, extract our compiled binaries.  Copy the file “boot” to the root directory of the flash drive and create an Extra folder.  If you need to copy any contents from your own Extra folder (especially true if FakeSMC.kext is inside /Extra/Extensions and not /System/Library/Extensions), do so now.  However, be sure to run create a modules folder inside the Extra folder and copy “Resolution.dylib” in that modules folder.

Step 3a: Testing
Once that’s done, reboot off of the flash drive.  If there was a theme inside your Extra folder, the VBIOS patch should be noticeable from the GUI.  If there isn’t a theme installed, or the resolution still appears form the GUI as 1024x768, type at the boot prompt “?video” (without quotes) to make sure that the resolution is listed in the VBIOS.  If it isn’t listed there, something went wrong.  It should patch an already present resolution.  In my case, it was 800x600.

If your resolution is listed, try typing “Graphics Mode”=”XxYx32” (WITH Quotes, where X and Y are your resolution values, i.e. 1366x768x32) with any other boot flags you need to successfully boot OS X.  If all goes well, you should see full resolution.  If something looks funny, but the resolution is correct, then the timings are wrong.  Make sure that the DTD was copied correctly in step 2 and try compiling again.

If, however, it isn’t listed, boot using the flags “-v Wait=Yes” (without quotes), and before it loads OS X, you’ll see a screen with all startup logs by Chameleon.  Scroll down (With theme/GUI, use arrow keys, without theme, space bar to go to next page, p to go to previous page) to where it says “Resolution.dylib by Unknown loaded”.  This is the log of Chameleon loading the resolution module.  If it shows any errors, take a screenshot of the log and feel free to upload an image here.

If you’ve got your full resolution within Mac OS X, you’re ready to install the Resolution module to your Chameleon installation.

Step 4: Install the Resolution Module to your existing Chameleon/OS X installation
Copy the file Resolution.dylib from your flash drive (or your compiled binary extracted from the zip folder) to /Extra/modules.  If there isn’t a “modules” folder in the /Extra folder, create it.

Also, be sure to modify org.chameleon.Boot.plist to have these lines in:


<key>Graphics Mode</key>
<string>1366x768x32</string>



Of course, be sure to change the resolution to match your own if it’s different.

Once that’s done, reboot and you’ll have your resolution in OS X.  If something goes wrong, use the same steps in step 3a to debug the error.

Step 5: Enabling Acceleration in Mac OS X
Mountain Lion TBD.   UPDATE (2/5/2013): Mountain Lion now is capable of enabling Core Image on our Graphics Card.  Still no Quartz Extreme, but if you try it out, check out Part 2 in this post: http://www.insanelym...s/#entry1885544  Thanks goes to GhostRaider for the guide, and Mehdymehdy for his discovery!
MAJOR UPDATE (3/10/2013): We have made history: a patch for the Mountain Lion Framebuffer was made, and it works now on our machine.  Look at this thread: http://www.insanelym...-fixed-sl-1068/ and this post: http://www.insanelym...20#entry1895588 Special thanks to verteks and warraisraw for their discoveries!! :)

However, if you don’t have a problem using an older version of OS X, follow these guides to enable partial QE/CI in Snow Leopard:

http://www.insanelym...0/#entry1504066

http://www.insanelym...d/#entry1827443

And that’s it!  I hope this guide has been of use to you, and that you’ll be able to use your Intel HD Graphics once and for all!

Special Thanks To:

Lion 10.7.2 Installed, Ethernet Kext Installed and Loaded, but Ethernet Won't Work

24 August 2012 - 06:39 PM

Hi!  I am using the Realtek PCIe FE Family Controller on Lion 10.7.2 (8136:10EC), and my device ID is in this kext's Info.plist: http://www.osx86.net..._x86_-_x64.html

I've also tried the fix suggested in the link above by mimo797 to iancilos, no luck.  Basically, the ethernet light lights up, but System Report still says I don't have any PCI Ethernet Cards.  No internet, or anything.  My computer is the HP Pavilion g6-1b71he.  Can you help me?  Thanks in advanced!

P.S. My DSDT (on the GMA 5700 thread) is causing a Kernel Panic, so I can't use a fix for that for now.

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