Contribute
Register

Lenovo G500 10.9.1: Almost done, just a little bit of help needed...

Joined
Nov 26, 2013
Messages
136
Motherboard
Lenovo G500
CPU
i3-3120M 2.5GHz
Graphics
Intel HD 4000 Graphics
Mac
iMac
I got HDMI Audio working! Kind of. Using a one-line AppleIntelFramebufferCapri patch and some DSDT stuff. But only if I have AppleHDA loaded, which means I can't use the rest of my input/outputs because they are with VoodooHDA. I tried this guy's method but I couldn't get it to work because on this laptop both the HDMI audio device and the on-board audio device use the same vendor ID. I tried Codec IDs but they don't work and weirdly enough both kexts don't even seem to care about what you type in there. VoodooHDA tends to "override" AppleHDA so I can't have both at the same time. But I managed to have both extensions in the machine without crashing. What can I do?

P.S. I also tried to enable the VGA port but got a kernel panic on the first try so I backed off. At least I got a reaction from OS X.
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,075
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
I got HDMI Audio working! Kind of. Using a one-line AppleIntelFramebufferCapri patch and some DSDT stuff. But only if I have AppleHDA loaded, which means I can't use the rest of my input/outputs because they are with VoodooHDA. I tried this guy's method but I couldn't get it to work because on this laptop both the HDMI audio device and the on-board audio device use the same vendor ID. I tried Codec IDs but they don't work and weirdly enough both kexts don't even seem to care about what you type in there. VoodooHDA tends to "override" AppleHDA so I can't have both at the same time. But I managed to have both extensions in the machine without crashing. What can I do?

P.S. I also tried to enable the VGA port but got a kernel panic on the first try so I backed off. At least I got a reaction from OS X.
I think the only solution is to use patched AppleHDA instead of VoodooHDA.
 
Joined
Nov 26, 2013
Messages
136
Motherboard
Lenovo G500
CPU
i3-3120M 2.5GHz
Graphics
Intel HD 4000 Graphics
Mac
iMac
Ok, let's begin! It took 3-4 days to write, but it’s finally done. :D


Note: I wrote this guide from memory. Please try it, and let me know if something doesn’t work as it should. I might have forgotten an important detail.

Lenovo G500 - OS X 10.9.1 Mavericks

-This guide is for the Late 2012 i3-3120 model with 7-series chipset and Intel HD Graphics 4000 that came with Windows 8. There are other models with i5's, Celerons and I think discrete graphics cards. I have no idea on how the installation differs on those from this one, so that's for you to find out.
-This guide assumes you're currently using your stock Windows 8 with all the factory installed partitions.
-You also need Windows if you want to have internal Wi-Fi by replacing the half-size mini PCIe card, because you’ll have to flash the BIOS. More info later.
-This guide has a lot of explanation so you understand what we’re doing and learn. Don’t just follow instructions blindly, OSx86 is all about learning, so take your time.
-Special thanks to RehabMan for helping me get this machine working from beginning to end! I wouldn't have been able of doing this alone. He practically did all of the work.
-This isn't 100% done yet, it's more like 97% done. You can help if you want. More details later.


Pre-installation preparation
I personally want this computer for using Adobe CS5, Logic Pro, and some other specialised creative pro software, so I'll be using OS X all the time and want a big slice of the hard drive for it. But maybe I'll need Windows too so I want to keep it. A lot of this guide is because I want to keep the stock Windows 8 installation. If you have already formatted your whole hard drive, only want OS X or some other thing, then you'll surely know how to fit the guide to your needs. For starters, if you want to single-boot OS X then the use of Clover is optional. I'll assume you want to keep the stock Windows install, which is a more difficult scenario than just single-booting OS X.


When you first turned on your G500 and went to My Computer, you probably saw two big partitions, "Windows8_OS" and "LENOVO". But these aren't the only partitions on the hard drive. See, Windows 8 now boots using UEFI, which means no more MBR boot loaders, replaced by the use of a new, hidden EFI partition just like all Intel Macs since 2006. You also probably know that there's a "Lenovo Rescue System" recovery partition. So, wait, do we actually have 4 partitions? No! We have 7. I'll detail it for you as it appeared on my machine:
Partition 1, 1GB, NTFS: WINRE_DRV, Windows Recovery partition, better leave it alone
Partition 2, 272.6MB, FAT32: SYSTEM_DRV, EFI Partition, very useful for us and the system, also obligatory
Partition 3, 1GB, FAT32: LRS_ESP, Lenovo Recovery System, keep it in case you ever need to format your computer to factory settings
Partition 4, 134.2MB: Microsoft Reserved, obligatory, can't do anything about it
Partition 5, ~450GB, NTFS: Windows8_OS, where the current operating system and all user data resides
Partition 6, 20GB, NTFS: LENOVO, it's two folders: drivers you can get online and the McAfee installer
Partition 7, 13.9GB, NTFS: PBR_DRV, apparently where the backup restore image resides, better leave it alone


You can only see and move partitions 5 and 6. So what I did was to grab the two folders from the oversized LENOVO partition and move them to Windows8_OS, then delete that partition. We will use Disk Management (Computer>Manage...) for this.


1. Delete the LENOVO partition once you backed up the data to your Win8 partition.
2. Shrink the Windows8_OS partition to 60GB (or any other amount you want for Windows)
3. Create a new FAT32 (this is important) partition in the free space for your OS X install.
Remember that Windows measures storage by 1024 bytes and Mac OS 1000 bytes. 61440 megabytes are 60GB in Windows and 61.4GB in OS X for example.


Now you should be left with the same number of partitions as before, but instead of a LENOVO partition you will have an empty partition where you will install OS X later. Do this from Windows, because at least in my case, Disk Utility wasn't able to partition my hard drive.


Because of the large number of partitions on this disk, we won't be able to use an MBR boot loader (i.e. Chameleon/Chimera) to boot from the hard drive, but we can in the meanwhile boot using our old school MBR-based Unibeast usb drive. Don't worry, we'll sort it out soon. So, get access to a working Mac OS system, download OS X Mavericks 10.9.1 from the Mac App Store and make a Unibeast USB. Now, don't yet plug it on and try to boot from it! There are a couple things you'll have to tweak first so it works:


1. Use the AppleShowAllFiles command to see the /Extra folder in the Unibeast USB.
2. Open org.chameleon.Boot.plist with TextWrangler or some other editor and change:
2a. GraphicsEnabler, from No to Yes
2b. Remove the default kernel flags if any
2c. Add IGPlatformID=01660003 and Graphics Mode=1366x768x32


Now go to your BIOS:
1. Disable Secure Boot
2. Enter Setup Mode (I'm not sure if this is necessary)
3. Enable Legacy support/Legacy mode/Legacy first


OS X Installation
Plug in your Unibeast USB to one of your left-side 3.0 ports and use these flags to boot: -x -v -f
If everything went right you should be on the OS X Installer welcome screen.


Go to Disk Utility:
1. Locate your blank FAT32 partition reserved for OS X in the messy list.
2. Go to the Erase tab.
3. Choose Mac OS Extended (Journaled) and type in "Hackintosh HD" or some other cool name.
4. Click Erase.


Now close Disk Utility, go back to the OS X installer, and proceed to install OS X on your newly-formatted partition. This took exactly 20 minutes on my machine.


Post-Installation Configuration
Part 1: Clover Installation
If everything went right, you will now be able to boot to your hard drive’s OS X install using our slightly modded UniBeast USB. You will most likely still need to use these flags: “-x -v -f”. First of all we need to install Clover so we can boot directly from our hard drive. So go ahead and download the latest version (latest tested version as of now is 2428) from here:
http://sourceforge.net/projects/cloverefiboot/files/latest/download


Now run the installer and select only the following options under “Customize”:
1. Bootloader: Don’t update MBR and PBR sectors
2. CloverEFI: CloverEFI 64-bits SATA
3. Themes: Your choice. Remember you’ll see it every time you boot.
4. Drivers64UEFI: EmuVariableUefi-64, OsxLowMemFixDrv-64, ParititionDxe-64
5. Install RC scripts on target volume
6. Install all RC scripts on all other bootable OSX volumes
7. Install Clover Preference Pane


Click Install, and wait for it to finish. Is it really installed yet? NO! We have to move this to our EFI partition. Why didn’t we use the “Install Clover in the ESP” option? Because the installer is hard-coded to mount the first partition on the selected drive and try to install it there. But our drive’s first partition isn’t the EFI partition, it’s a recovery one, which won’t even be mounted correctly.


1. First, let’s mount our EFI partition. Open Terminal and type:
Code:
mkdir /Volumes/EFI
sudo mount -t msdos /dev/disk0s2 /Volumes/EFI
This will mount a partition called SYSTEM_DRV which you can access from Finder now.
2. Go to your OS X partition root. You’ll see two new items: a file named boot and a folder named EFI. In that EFI folder is where Clover is. We’ll move the EFI folder and you can hide the boot file (sudo chflags hidden boot) if it bothers you.
3. Open the folder EFI and you’ll find another folder named CLOVER.
4. In another Finder window, open the SYSTEM_DRV partition and then the EFI folder you’ll find inside. There should be three folders in there, APPLE, Microsoft and BOOT.
5. Move the CLOVER folder to SYSTEM_DRV’s EFI folder. Now you should have four folders in there.
The Lenovo BIOS/UEFI won’t load EFI/BOOT/BOOTX64.efi if there’s a Microsoft/Boot/bootmgr.efi present, so:
6. Rename the “Microsoft” folder to “Micr0s0ft” or something else temporarily. No, we won’t be able to boot into Windows in the meanwhile.
7. Go to the CLOVER folder which should be inside SYSTEM_DRV now (we’ll do all of our hackintosh work in this partition from now on) and locate CLOVERX64.efi
8. Copy CLOVERX64.efi to /EFI/BOOT and rename it to BOOTX64.efi, replacing the file with the same name that was already there. You can backup the original BOOTX64.efi file or trash it.


Now we can boot to Clover but we can’t boot OS X from it, so it’s pretty much useless at this point. Actually, even Clover will probably fail to load correctly if we leave it like this. We are now going to configure it so we can boot.


Part 2: Clover Configuration
Go to SYSTEM_DRV>EFI>CLOVER. Here you will find a lot of folders that allow us to configure Clover. I won’t go into a lot of detail because that’s what the Clover Wiki is for (http://clover-wiki.zetam.org/), but we’ll mainly work on the config.plist file, and the ACPI, drivers64UEFI, and kexts folders. Also a little bit on the OEM folder.


OEM folder:
1. Go to the OEM folder. You’ll find a folder called SystemProductName inside.
2. Unless you want to boot this hard drive on multiple, different computers, delete it. It’s just taking up space. More details on: http://clover-wiki.zetam.org/What-is-what#Directory-structure


drivers64UEFI folder:
1. Now go back a folder and open drivers64UEFI. There should be the following files inside:
-EmuVariableUefi-64.efi
-FSInject-64.efi
-OsxFatBinaryDrv-64.efi
-OsxLowMemFixDrv-64.efi
-PartitionDxe-64.efi
-VBoxHfs-64.efi
-XhciDxe-64.efi
We need these drivers so Clover works correctly. But there’s one that isn’t here, NTFS.efi, needed to boot Windows installations.
2. You can get NTFS.efi from here: https://github.com/JrCs/CloverGrowerPro/blob/master/Files/NTFS/x64/NTFS.efi (View Raw)
3. Move it to drivers64UEFI.


config.plist file:
Editing this file according to our machine’s needs is very important, and a typo can cause crashes or render our installation unbootable so be very careful. I don’t know if it’s related to having Xcode installed or not, but for me it won’t open correctly in TextEdit. I’ll be using TextWrangler. If you have any doubt about where things go, consult the Clover wiki: http://clover-wiki.zetam.org/Configuration#Config.plist-structure


1. First, there’s the DSDT Fixes section. These will cause problems so we are going to disable them all by setting them to false. Example:
Code:
                <key>AddDTGP_0001</key>
                <false/>
2. Locate these sections and fix as needed:
Code:
            <key>Name</key>
            <string>DSDT.aml</string>
            <key>ReuseFFFF</key>
            <false/>


Code:
        <key>DropTables</key>
        <array>
            <dict>
                <key>Signature</key>
                <string>DMAR</string>
            </dict>
            <dict>
                <key>Signature</key>
                <string>SSDT</string>
                <key>TableId</key>
                <string>CpuPm</string>
            </dict>
            <dict>
                <key>Signature</key>
                <string>SSDT</string>
                <key>TableId</key>
                <string>Cpu0Ist</string>
            </dict>
        </array>


3. Dropping the SSDT and not generating CStates and PStates is needed for proper power management:
Code:
        <key>FixDsdtMask</key>
        <string>0</string>
        <key>SSDT</key>
        <dict>
            <key>DropOem</key>
            <true/>
            <key>Generate</key>
            <dict>
                <key>CStates</key>
                <false/>
                <key>PStates</key>
                <false/>
            </dict>
            <key>MinMultiplier</key>
            <integer>8</integer>
            <key>PLimitDict</key>
            <integer>0</integer>
            <key>UnderVoltStep</key>
            <integer>0</integer>
        </dict>


4. EHCIacquire=Yes and -gux_defer_usb2 are needed for proper USB functionality. I have disabled Logging but you can enable it for debugging purposes. I have set a timeout of 1 second so I can access the GUI if I press any key and still boot quickly. If you set this to 0, there will be no way to access the GUI and therefore boot in safe mode or verbose mode, access your other partitions, etc. It takes 36 seconds for me to boot from power button to desktop with a timeout of 1 second, so it doesn’t bother me.
Code:
    <key>Boot</key>
    <dict>
        <key>Arguments</key>
        <string>EHCIacquire=Yes -gux_defer_usb2</string>
        <key>BlackList</key>
        <array/>
        <key>DefaultVolume</key>
        <string>MacHDD</string>
        <key>Legacy</key>
        <string>PBR</string>
        <key>Log</key>
        <false/>
        <key>Secure</key>
        <false/>
        <key>Timeout</key>
        <integer>1</integer>
        <key>WhiteList</key>
        <array/>
        <key>XMPDetection</key>
        <string>No</string>
    </dict>


5. There’s no need to inject an audio layout (set it to “No”), and there’s no need to apply any fake IDs (keep them as 0x0). USB needs these to be enabled:
Code:
        <key>USB</key>
        <dict>
            <key>AddClockID</key>
            <true/>
            <key>FixOwnership</key>
            <true/>
            <key>Inject</key>
            <true/>
        </dict>


6. The G500’s trackpad won’t work on the boot prompt, so let’s disable it (only while we’re on the Clover prompt) in order to remove the useless cursor:
Code:
        <key>Mouse</key>
        <dict>
            <key>DoubleClick</key>
            <integer>500</integer>
            <key>Enabled</key>
            <false/>
            <key>Speed</key>
            <integer>4</integer>
        </dict>


7. Let’s add our screen resolution:
Code:
        <key>ScreenResolution</key>
        <string>1366x768</string>


8. This section is needed to have working graphics:
Code:
    <key>Graphics</key>
    <dict>
        <key>Inject</key>
        <dict>
            <key>ATI</key>
            <false/>
            <key>Intel</key>
            <true/>
            <key>NVidia</key>
            <false/>
        </dict>
        <key>ig-platform-id</key>
        <string>0x01660003</string>
    </dict>


9. A great feature of Clover is the ability to patch kexts on-the-fly, thus reducing the amount of modifications we have to make to the OS X System folder in order to make it work on our non-Mac computer. Here we patch AppleIntelCPUPowerManagement and AppleRTC by just setting them to true, and disable AppleHDA without having to delete it from /System/Library/Extensions. AppleHDA is Apple’s audio driver for OS X, it is high quality, very stable, and works with HDMI. It is used in a lot of hackintoshes by the use of patches. Since nobody on the internet seems to have bothered to make a patch for the CX20757 (the G500’s audio card), there is no patch available yet, and we’re going to use VoodooHDA 2.8.1 (a completely different open source audio driver brought over from FreeBSD) instead. You can’t have both enabled at the same time, that’s why we’re disabling AppleHDA. This isn’t the best solution available, instead, we should try to make a patch for AppleHDA, but in the meanwhile, we can use this.
Code:
    <key>KernelAndKextPatches</key>
    <dict>
        <key>AppleRTC</key>
        <true/>
        <key>AsusAICPUPM</key>
        <true/>
        <key>KextsToPatch</key>
        <array>
            <dict>
                <key>Name</key>
                <string>AppleHDAController</string>
                <key>Comment</key>
                <string>Do not load</string>
                <key>InfoPlistPatch</key>
                <true/>
                <key>Find</key>
                <string>0x04020000</string>
                <key>Replace</key>
                <string>0x44220000</string>
            </dict>
        </array>
    </dict>


10. Then there’s the SMBIOS section. I won’t post mine because you should get a unique serial number and other information for your hackintosh, but you should use a MacBookPro9,2 definition. The easiest way to generate this information formatted for Clover is using Clover Configurator, but that program tends to add and modify other sections that we don’t want, so we will only use it to generate another configuration file with a SMBIOS, then just grab the section from there and add it to our real config.plist file.


11. The last section, SystemParameters, should be like this:
Code:
    <key>SystemParameters</key>
    <dict>
        <key>InjectKexts</key>
        <string>Yes</string>
        <key>InjectSystemID</key>
        <true/>
    </dict>


That’s all for now in this file. Later, we’ll come back to this file to hide the unnecessary boot entries that appear because all those partitions in our hard drive.


Part 3: Kernel Extensions
Now is the time to install all the kernel extensions (kexts) needed to enable keyboard, trackpad, audio, ethernet, battery status, USB, screen backlight, hardware sensors, and Wi-Fi (if you’ve replaced your card with a compatible one). Instead of just linking you to a zipped file with all the needed files, I’ll tell you where to find them, because they are updated very often and you should know where they come from. Since we are using Clover, we can forget about modifying the System folder and instead install them to SYSTEM_DRV>EFI>CLOVER>kexts>10.9, which will give us the ability to boot other vanilla OS X 10.9.1 installs in our hackintosh and boot this OS X install in a real Mac. For example, I have an emergency external hard drive with DiskWarrior and thanks to Clover, I can now use it on both my iMac and my G500.


1/8: ACPIBacklight.kext
By default, the G500’s screen backlight will be stuck at full brightness in OS X with no way to lower it. A DSDT patch that we’ll also use adds a brightness slider, but with a very limited range. What this kext does (together with more DSDT patches, specific to our machine) is to fix that and give us the full brightness range.
Get it here: https://github.com/RehabMan/OS-X-ACPI-Backlight


2/8: ACPIBatteryManager.kext
You might have noticed that we don’t have a battery meter on our menu bar yet. This kext will implement it, but it needs a system-specific DSDT patch as well. RehabMan found out that there’s a patch for another Lenovo laptop that is a perfect fit for ours, so it’s readily available. All the DSDT patching will be done in the next part of this guide.
Get it here: https://github.com/RehabMan/OS-X-ACPI-Battery-Driver


3/8: ALXEthernet.kext
After booting with Unibeast, you’ll already have working Ethernet, but the method used by Unibeast to enable it is less than optimal. We’ll use Shailua’s ALXEthernet v1.0.2, which can be found in MultiBeast, but MultiBeast is 25MB and it’ll try to install it to /S/L/E, so let’s download it from somewhere else.
Get it here: https://code.google.com/p/iats/downloads/detail?name=ALXEthernet-1.0.2.zip&can=2&q=


4/8: FakeSMC.kext
This kext is what makes in essence a hackintosh possible. I think the only motherboard that doesn’t need it is the projectQ one, and that’s with a custom BIOS. Otherwise it is obligatory to trick OS X’s Apple hardware check. Install HWSensors.app and move ACPISensors.kext, CPUSensors.kext, GPUSensors.kext, and LPCSensors.kext inside FakeSMC.kext/Contents/Plugins if you wish to monitor your temperatures, power consumption, and CPU speed from your menu bar. Otherwise just install FakeSMC.kext and delete the other files.
Get it here: http://sourceforge.net/projects/hwsensors/files/HWSensors.5.3.820.Binaries.zip/download


5/8: GenericUSBXHCI.kext
Right now, only your USB 3.0 ports (the ones in the left) will work, and only if something was plugged in since you booted. Since the webcam is connected to a USB 2.0 hub, it won’t be detected like this. GenericUSBXHCI, together with EHCIacquire=Yes -gux_defer_usb2, will give us perfect USB functionality, and yes, your webcam will work.
Get it here: https://github.com/RehabMan/OS-X-Generic-USB3


6/8: toledaARPT.kext
The Lenovo G500 can either come with the AR9425 or the BCM4313. Both are unsupported by OS X. Yes, you’ll have to replace your Wi-Fi card. It’s a very simple procedure and it won’t take you more than 5 minutes. Check the compatible cards here: http://www.tonymacx86.com/network/104850-guide-airport-pcie-half-mini-v2.html. I used the BCM943225, which is cheap and adds Bluetooth 3.0 to a computer that otherwise needs an external dongle. You’ll have to flash your BIOS to remove Lenovo’s Wi-Fi card whitelist. Backup your BIOS under Windows with Universal BIOS Backup ToolKit 2.0. To get your BIOS’ whitelist removed ask nicely and politely in the bios-mods forum, follow their instructions to flash. If you get “Error 28, PDR Region does not exist, GBE Region does not exist”, just hit enter anyway. It will work. Just remember to have your battery fully charged and the power adapter plugged in to avoid accidents. This kext is an enabler for the cards before mentioned.
Get it here: https://github.com/toleda/airport_pcie-hm/blob/master/airport_kext_enabler/toledaARPT.kext.zip


7/8: VoodooHDA.kext
As I mentioned before, nobody has tried to make an AppleHDA patch for the CX20757, which is the Lenovo G500’s audio card. Most likely, a patch can be made, it just hasn’t been made yet. A temporary solution is to use VoodooHDA 2.8.1, an alternative open source audio driver based on FreeBSD’s hdac. The issue with VoodooHDA is that it HDMI audio won’t work with it, and the line-in 3.5mm jack will deliver pure noise. Only the internal speakers, headphone output, and internal microphone will work. Automatic switching between the internal speakers and headphones won’t work either, you’ll have to manually choose what output to use, which can actually be a good thing sometimes. Other versions haven’t been tested. VoodooHDA also comes with a preference pane to configure some settings. Right click it, choose Open, and install it.
Get it here: http://www.mediafire.com/download/zevnxrw98tl51ih/VoodooHDA_2.8.1.tar.gz


8/8: VoodooPS2Controller.kext/ApplePS2Controller.kext and ApplePS2ElanTouchpad.kext
In order to get your keyboard and trackpad to work properly, you’ll need a PS/2 driver, since they are internally connected using PS/2 and of course Macs have never used that connector. The kext(s) you’ll use will vary, since the Lenovo G500 can either have a Synaptics or an Elan trackpad. They are not compatible with one another. You’ll get different gestures working depending on which trackpad you have. The most complete seems to be the Elan one. If your model has a chromed trackpad border, it’s probably Elan. If it doesn’t, it’s probably Synaptics. The Synaptics one needs a couple files to be installed as well on your OS X partition, which is detailed on the linked page.
Get the Elan driver here: http://forum.osxlatitude.com/index.php?/topic/1948-elan-touchpad-driver-mac-os-x/
Get the Synaptics driver here: http://github.com/RehabMan/OS-X-Voodoo-PS2-Controller


Part 4: DSDT Patches
The DSDT (Differentiated System Description Table) is, in simple terms, a table with lots of information about your specific computer’s hardware. By default, it’s inside your motherboard’s BIOS and it’s grabbed directly from there. But it tends to have errors, which usually don’t matter because Windows doesn’t use DSDT that much, but OS X relies on it a lot. Another problem is that OS X expects things in the DSDT to be written in a different way than they usually are, so that brings problems as well. Because of this, using the DSDT straight out of the BIOS is not a good idea. It won’t help much and it might even cause crashes. That’s why we need to patch it to correct the mistakes and make it readable for OS X. Since flashing the BIOS every time we want to modify the DSDT is extremely risky and could brick your motherboard, we hackintoshers instead inject a patched DSDT to OS X in the form of an .aml file on every boot by means of the boot loader. Most of the hard work has been done already. All you’ll have to do is to follow simple instructions.


1. First, download RehabMan’s version of MaciASL from here: https://github.com/RehabMan/OS-X-MaciASL-patchmatic
2. Open it, and choose File>New from ACPI>DSDT. We have now extracted our system’s DSDT and will now start to patch it, but where will we get the patches from?
3. From RehabMan’s GitHub of course! Go here: https://github.com/RehabMan/Laptop-DSDT-Patch and here: https://github.com/RehabMan/HP-ProBook-4x30s-DSDT-Patch and click on “Download ZIP” on both pages to download the repositories.
4. Unzip both files
5. Go to MaciASL>Preferences>Sources and click the “+” button. Write some name, and on URL type “file://“ then drag from Finder one of the folders to the “URL” text field to get the full path. Click “+” again, and repeat the process for the other folder.


Now we can actually start patching our DSDT. Choose “Patch” on MaciASL’s main window and from the left column, select each of these patches and then click on “Patch” each time. Be sure to do it in the correct order.


1. USB (ECHI) Patches > 7-series USB
2. System Patches > Fix _WAK Arg0 v2
3. Battery Patches > Lenovo y580
4. Intel Graphics Patches (HD3000/HD4000) > Brightness fix
5. Intel Graphics Patches (HD3000/HD4000) > Rename GFX0 to IGPU (Important Note: On this one, you should only leave the first group. In other words, delete everything from “# and its aliases: VID” before applying.)
6. ACPI backlight control > ACPI backlight control
7. Custom patch time! This patch has the Lenovo G500’s screen backlight levels from absolute zero to absolute brightest, with a nice exponential curve to have balanced variation across the slider. Numbers found and calculated by yours truly. Paste it to MaciASL’s patch window (make sure it is blank first) and apply it.
Code:
into device label PNLF code_regex Name\s\(_BCL,\sPackage[^\}]*\}\) remove_matched;into device label PNLF code_regex Name\s\(XRGL,.*\)\n removeall_matched;
into device label PNLF code_regex Name\s\(XRGH,.*\)\n removeall_matched;
into device label PNLF code_regex Name\s\(KLVX,.*\)\n removeall_matched;
into device label PNLF code_regex . insert
begin
    // XRGL/XRGH: defines the valid range\n
    Name (XRGL, Zero)\n
    Name (XRGH, 976)\n
    // KLVX is initialization value for LEVX\n
    Name (KLVX, 0x03d003d0)\n
    // _BCL: returns list of valid brightness levels\n
    // first two entries describe ac/battery power levels\n
    Name (_BCL, Package()\n
    {\n
        976,\n
        70,\n
        0,\n
        2, 3, 5, 7,\n
        8, 9, 10, 11,\n
        12, 13, 14, 15,\n
        16, 17, 18, 19,\n
        20, 22, 24, 26,\n
        28, 31, 33, 36,\n
        39, 43, 46, 50,\n
        55, 59, 65, 70,\n
        76, 83, 90, 97,\n
        106, 115, 125, 135,\n
        147, 160, 173, 188,\n
        204, 222, 241, 262,\n
        284, 308, 335, 364,\n
        395, 429, 465, 505,\n
        549, 596, 647, 702,\n
        763, 828, 899, 976,\n
    })\n
end;
8. System Patches > HPET Fix
9. System Patches > OS Check Fix
10. System Patches > IRQ Fix
11. System Patches > SMBUS Fix
12. System Patches > RTC Fix
13. System Patches > Add MCHC
14. Custom patch time! We’ll remove a couple things that cause our screen’s backlight to stay off after waking up when we close the lid before the computer enters sleep mode. Very important fix. Close the Patch window, click anywhere in the main DSDT editor panel, go to Edit > Find > Find, and search for “LID0” without the commas. First result should be this line:
Code:
Notify (\_SB.LID0, 0x80)
Select it and delete it.
Next and last result should be this:
Code:
    Scope (_SB)
    {
        Device (LID0)
        {
            Name (_HID, EisaId ("PNP0C0D"))
            Method (_LID, 0, NotSerialized)
            {
                Return (GP15)
            }


            Name (_PRW, Package (0x02)
            {
                0x1F, 
                0x03
            })
        }
    }
From here, select ONLY this part and delete it:
Code:
            Name (_PRW, Package (0x02)
            {
                0x1F, 
                0x03
            })
That section should look like this now:
Code:
    Scope (_SB)
    {
        Device (LID0)
        {
            Name (_HID, EisaId ("PNP0C0D"))
            Method (_LID, 0, NotSerialized)
            {
                Return (GP15)
            }


        }
    }
15. We’re done patching our DSDT! Click on “Compile” and make sure there are 0 errors. Then go to File > Save As, and save it to SYSTEM_DRV>EFI>CLOVER>ACPI>patched as “DSDT.aml” without the commas of course.
16. One more step, though. On MaciASL, choose File > New from ACPI > SSDT. Then go to File > Save As, and save it to SYSTEM_DRV>EFI>CLOVER>ACPI>patched as “SSDT.aml”.


Part 5: Disabling Safe Sleep/Hibernate Mode
Safe Sleep is the mode where a copy of the RAM is written to your hard drive every time a Mac goes to sleep in order to preserve the current state of the computer, even if the battery dies/is removed or power is lost in desktop machines. The issue is that this function causes random reboots in the G500 after waking up. Sometimes it will wake up correctly, sometimes it will reboot one minute or two after waking up. The exact scenario where these reboots happen is unknown, though we know it is related to the Safe Sleep function. That’s why we’re going to disable it with just two Terminal commands, so…


1. Launch Terminal
2. Type these two commands, pressing enter after each line, typing your password when prompted.
Code:
sudo rm -rf /var/vm/sleepimage
sudo pmset hibernatemode 0


Guess what, we’re now ready to reboot to our almost fully configured OS X install. So go to the Apple Menu, and select Shut Down. Then remove your Unibeast USB.


Part 6: Finishing Clover/EFI configuration
1. Press that power button and wait to enter Clover for the first time.
2. Since we set the timeout to 1 second, as soon as you see the theme you selected on the screen, press any key to stop the countdown.
3. Now, press the right arrow key until you reach the icons at the bottom. Select the one that says “Clover Boot Options”, press enter, then select “Add as UEFI boot option”.
4. Press F4 (or Fn+F4) to dump our ACPI tables, we’ll need them.
5. Put the cursor on the leftmost boot entry (Boot Microsoft EFI boot menu from SYSTEM_DRV) and press the space bar. On the screen that appears, press F10 (Fn+F10) to take a screenshot. We will use it to hide this useless entry. Now select Return and go back to the main screen.
6. Put the cursor on the second boot entry from the left (Boot UEFI internal from LRS_ESP) and press the space bar. On the screen that appears, press F10 (Fn+F10) to take a screenshot. We will use it to hide this useless entry.
7. Now let’s boot OS X by moving back to the boot entry list and selecting your OS X partition by its name. Do not try to choose any other entry yet.
8. You should now boot into OS X and we’re almost done. I say almost because there are a couple crucial things that we have to fix first.
9. Go to Terminal and mount your EFI partition. You already know how to do it, don’t you?
10. Go to the EFI folder.
11. Delete the BOOT folder with BOOTX64.efi inside and rename the “Micr0s0ft” folder back to “Microsoft” as it was before.
12. Go to the CLOVER folder, then to the ACPI folder, then to the origin folder.
13. There should be a lot of files in there, which are the ACPI tables we dumped by pressing F4. If the folder is empty, you pressed the F4 hotkey, not the actual F4. Remember it actually is Fn+F4. From here, we need to grab SLIC.aml which is apparently used to boot Windows. So copy SLIC.aml and paste it on SYSTEM_DRV>EFI>CLOVER>ACPI>WINDOWS.


We will now hide all those boot entries that appeared on Clover. From all those, only three are useful, maybe only two or even one if you think that way. So we have to clean this up.
1. Most of the work will be done on config.plist, so open it with TextWrangler or other editor.
2. Scroll to the GUI section. If there are no “Custom” or “Hide” sections, we’ll add them now. If they are there, we’ll replace them anyway.
3. This code below is the “Custom” section. The first two entries are for Windows 8 and the Lenovo Rescue System that allows you to format your hard drive to factory state. You’ll have to put your UUIDs in there for it to work. Where do you get the UUIDs from? From the screenshots we took, of course! They are located in SYSTEM_DRV>EFI>CLOVER>misc. The other two, under “Legacy”, hide two entries that are “duplicates” and do nothing.
Code:
        <key>Custom</key>
        <dict>
            <key>Entries</key>
            <array>
                <dict>
                    <key>Arguments</key>
                    <string></string>
                    <key>Disabled</key>
                    <false/>
                    <key>Hidden</key>
                    <false/>
                    <key>Path</key>
                    <string>\EFI\Microsoft\Boot\bootmgfw.efi</string>
                    <key>SubEntries</key>
                    <false/>
                    <key>Title</key>
                    <string>Windows 8</string>
                    <key>Type</key>
                    <string>Windows</string>
                    <key>Volume</key>
                    <string>Your SYSTEM_DRV UUID according to Clover</string>
                </dict>
                <dict>
                    <key>Arguments</key>
                    <string></string>
                    <key>Disabled</key>
                    <false/>
                    <key>Hidden</key>
                    <false/>
                    <key>Path</key>
                    <string>\EFI\BOOT\BOOTX64.efi</string>
                    <key>SubEntries</key>
                    <false/>
                    <key>Title</key>
                    <string>Lenovo Rescue System</string>
                    <key>Type</key>
                    <string>Windows</string>
                    <key>Volume</key>
                    <string>Your LRS_ESP UUID according to Clover</string>
                </dict>
            </array>
            <key>Legacy</key>
            <array>
                <dict>
                    <key>Disabled</key>
                    <true/>
                    <key>Hidden</key>
                    <false/>
                    <key>Title</key>
                    <string>LRS_ESP (Nothing)</string>
                    <key>Type</key>
                    <string>Windows</string>
                    <key>Volume</key>
                    <string>LRS_ESP</string>
                </dict>
                <dict>
                    <key>Disabled</key>
                    <true/>
                    <key>Hidden</key>
                    <false/>
                    <key>Title</key>
                    <string>SYSTEM_DRV (Nothing)</string>
                    <key>Type</key>
                    <string>Windows</string>
                    <key>Volume</key>
                    <string>SYSTEM_DRV</string>
                </dict>
            </array>
        </dict>
4. After “Custom” and before “Language”, let’s add this to hide the remaining useless “legacy” (non-EFI) partitions. We actually boot Windows 8 from the EFI partition, not from the partition where it’s installed, that’s why we’re hiding it.
Code:
        <key>Hide</key>
        <array>
            <string>Legacy HD1</string>
            <string>Windows8_OS</string>
            <string>Legacy HD7</string>
        </array>
And we’re done setting up Clover.


After this, you’ll probably still have two LRS_ESP entries in your boot loader. This is because there’s both a bootmgr.efi and a BOOTX64.efi on that partition (two ways of booting a Windows install), and they appear as separate items. But since the only one that actually works is BOOTX64.efi, it’s completely safe to delete bootmgr.efi.
1. To do this, let’s first mount LRS_ESP from Terminal with the following commands:
Code:
mkdir /Volumes/LRS
sudo mount -t msdos /dev/disk0s3 /Volumes/LRS
2. Now access LRS_ESP from Finder and go to LRS_ESP>EFI>Microsoft>Boot.
3. Here, locate bootmgr.efi and delete it, remembering to empty the Trash.


We’re now done cleaning up our boot loader. You can now go to your BIOS, move the Clover entry to the top, set boot mode to UEFI only to skip the network boot prompt thing, remembering to keep Secure Boot disabled. Clover should be neat and tidy now, with only three selectable entries, Windows 8, the Lenovo Rescue System, and OS X 10.9.1 Mavericks.


Now what? (notes workarounds colour profiles tips tricks tweaks)
Aren’t we done now? Yes, we are, but there are some things you have to know about our hackintosh and how it works.
Keyboard shortcuts/brightness slider: You can use the first three F-keys for volume control right out of the box just as in Windows. If you have a Synaptics trackpad, you can control the screen backlight using Fn+Home (Pause) to increase brightness and Fn+PgUp (ScrLk) to decrease brightness. Yes, it’s awkward, but it works all the time. If you have an Elan trackpad, you can download a small, free utility called Brightness Slider from the Mac App Store that will allow you to set a custom hotkey to control brightness. Get it here: http://itunes.apple.com/us/app/brightness-control/id456624497?ls=1&mt=12
Color profiles: You might have noticed that the colors on your G500’s screen look very off. For example, the iTunes icon on the dock looks purple instead of blue. This is because of the color profile for the display, which is completely wrong. If you go to System Preferences>Displays>Color>Calibrate… you can easily make a calibrated profile for your screen. For optimum results, one should use a monitor calibrator, but these are expensive, and maybe overkill depending on what you’ll use your computer for. If you just want average, but somewhat accurate colors, you can use the sRGB IEC61966-2.1 profile, which is the one used by your stock Windows 8 installation by default.
Lid: Sleep by closing the lid will not work, but the screen will turn off. You should either use the Apple Menu or quickly press the power button (don’t keep it held down) to sleep.
Sleep/Hibernation: As of now, sleep is somewhat unreliable, leading to random reboots, but testing is yet to be done with the new Safe Sleep disabling fix. If you want to help fix this, use sleep as much as possible on every possible scenario and tell us in this thread what happens, of course, after disabling Safe Sleep. If you want to be safe and not lose your work, try not to use sleep if you don’t need it until we as a team have sorted this out. To disable sleep quickly, even with the lid closed, there’s an excellent utility called InsomniaX. Get it here: https://www.macupdate.com/app/mac/22211/insomniax
Battery Cycle Count: If you go to System Report>Power and check Cycle Count, you will see it’s always 0. Apparently it’s normal. It seems that this laptop/battery does not support logging cycle counts, since checking with Windows 8’s Battery Report shows “Cycle Count: --” as well.
Battery Life: Thanks to OS X Mavericks’ power optimization features, we can get up to 34% longer battery life than the advertised by Lenovo for Windows 8! Instead of 5 hours, one can get a good 7 hours and 30 minutes of low-power word processing work, and some 6:30 hours of music playback from iTunes Radio, streamed using AirPlay. Either way, it’s much more than 5 hours.
How does this compare to a real Mac? 1366x768 display, Intel HD Graphics 4000, optional Intel Core i5 Ivy Bridge CPU, 4GB of 1600 MHz DDR3 SDRAM, 720p Webcam, USB 3.0, no audio line-in… Hey, this sounds a lot like a Mid 2012 11” MacBook Air! The differences are in the lack of Thunderbolt, a backlit keyboard, and a super-fast SSD for our G500, as well as the thinner and sexier design. But we have an optical drive, an extra USB port, Ethernet, HDMI, and lots of upgradeability (up to 32GB RAM!) instead. The card reader and VGA port only work under Windows, but that’s still a plus since the 11” MBA doesn’t have either integrated.


What doesn’t work… yet (Help Wanted)
AppleHDA audio (Line-In, HDMI audio, automatic switching): Remember I said we are currently using VoodooHDA? That’s because nobody has made a patch for this audio card yet, the Conexant CX20757. Is it impossible? No! It just hasn’t been found yet. It’s all trial and error, anyone with time can do it. I invite you to try and work on a patch for our G500, so we can have better sound support. Guides on how to do this are all over the internet, but a popular one is the one written by EMlyinEsH (http://forum.osxlatitude.com/index.php?/topic/1946-complete-applehda-patching-guide/). You will need the linux codec dumps, which I will supply for you since I’ve already extracted them. Get them here: View attachment Lenovo G500 codec dumps.zip. Also, having to manually replace the layout-id and Platforms files and patch the AppleHDA binary is no longer needed, and we can now instead use Clover’s on-the-fly patching feature to take care of the binary and a dummy kext to inject the layout-id and Platforms files (http://www.tonymacx86.com/hp-probook-mavericks/118877-patch-applehda-kext-fly-clover-bootloader.html). Getting HDMI audio to work requires a patch to AppleIntelFramebufferCapri which I’ve already found. You can add it to Clover by adding this code to KextsToPatch:
Code:
            <dict>
                <key>Comment</key>
                <string>HDMI connector audio fix</string>
                <key>Find</key>
                <data>
                AgUAAAAEAAAHBAAA
                </data>
                <key>Name</key>
                <string>AppleIntelFramebufferCapri</string>
                <key>Replace</key>
                <data>
                AgUAAAAIAAAHBAAA
                </data>
            </dict>
Remember, don’t conform to using VoodooHDA forever, we have to make AppleHDA work! Practically nobody knew how Mac OS X made hardware work when the OSx86 project began, and the reason it all has come this far is because people like you and me have had a desire to learn how OS X works and make it run on our non-Apple PCs. We’ve been dedicating our time and combining our efforts to a single cause and this is the result. You can help and lots of people will thank your efforts and make more hardware work because to it, so don’t give up! It will all be worth it in the end.
VGA port: This is supposed to work with an AppleIntelFramebufferCapri patch, but apparently support for the VGA port on the HD4000 has been broken since 10.8.2. Real Macs don’t have one since a long time ago anyway.
Card Reader: The integrated card reader (USB2.0-CRW) is detected under OS X, but it doesn’t work. It’s supposed to be a matter of injecting it’s ID to Apple’s card reader driver, but that has been tried as well, and it doesn’t work, so it probably never will. A very complicated and not-so-worth-it workaround to use the internal card reader while booting on OS X is to boot your Windows partition using Parallels Desktop (payware, first enable VT-x first on BIOS), mount the card reader to the virtual machine, then copy whatever data you need to your OS X partition or vice versa. Mounting the Windows card reader partition to OS X won't allow you to open anything unless it's already open in the Windows virtual machine for some reason.


That’s all folks!
 
Joined
Nov 26, 2013
Messages
136
Motherboard
Lenovo G500
CPU
i3-3120M 2.5GHz
Graphics
Intel HD 4000 Graphics
Mac
iMac
For some reason, the guide is taking a while to get posted, but I've already submitted it...

In the meanwhile, I want to add that I tried disabling the sleepimage and so far so good. I have one last question. Every time I boot, my Clover settings look like this:

screenshot.png

What's that "S??" thing? It seems to be a bug in Clover since it's not in my config.plist file. Is it safe to boot with it? I've always been removing it in every boot just in case...

Edit: Nope, the reboots aren't gone yet.
 
Joined
Nov 24, 2011
Messages
25
Motherboard
P5K-R (cross-flashed)
CPU
Q6600
Graphics
Ati Radeon 5450
Mac
MacBook, MacBook Pro
Classic Mac
iBook
Mobile Phone
Android, iOS
Thanks for the guide! You r my hero xD

For the sake of clarity, since there are many g500, you could declare your precise model in the title (or subtitle... ie. Lenovo G500 xxxxxxx)
However you've done a right job explaining that there are different versions and this guide is only an indication for these ones.

I would like to thanks you and Rehab for your great efforts put in this notebook!

EDIT:
I've read the guide. MARVELLOUS!

Only one question for now, not stricktly related with your guide: I've downloaded voodoohda from your link, what program did you use to extract it? I've tried utility inside osx, unarchiver, stuffit, unrarx, but no one of these help me.

Really really thanks for your guide, is awesome!

I'll try it as soon as possible and I'll report feedbacks
 
Joined
Nov 26, 2013
Messages
136
Motherboard
Lenovo G500
CPU
i3-3120M 2.5GHz
Graphics
Intel HD 4000 Graphics
Mac
iMac
The OS X Archive Utility usually does the trick… you double-click it, a .tar file pops up, wait about 3 seconds, then the uncompressed folder appears.

My G500 is the "Late 2012 i3-3120 model with 7-series chipset and Intel HD Graphics 4000 that came with Windows 8", with a Synaptics (not Elan, though I linked to the appropriate drivers) trackpad that looks like this:

lenovo-laptop-g400-textured-front-detail-3.jpg
Picture by Lenovo

Edit: I also made an specific thread for discussion about this install guide on the Mavericks Laptop forum: [GUIDE!] Lenovo G500 10.9.1 & OEM Windows 8 dual boot using Clover
 
Joined
Nov 24, 2011
Messages
25
Motherboard
P5K-R (cross-flashed)
CPU
Q6600
Graphics
Ati Radeon 5450
Mac
MacBook, MacBook Pro
Classic Mac
iBook
Mobile Phone
Android, iOS
The OS X Archive Utility usually does the trick… you double-click it, a .tar file pops up, wait about 3 seconds, then the uncompressed folder appears.
Yeah, I've used it but I face a strange loop:
VoodooHDA_2-1.8.1.tar.gz using OS X Archive Ut gives me VoodooHDA_2-1.8.1.tar
VoodooHDA_2-1.8.1.tar using OS X Archive Ut gives me VoodooHDA_2-1.8.1.tar.cpgz
VoodooHDA_2-1.8.1.tar.cpgz using OS X Archive Ut gives me VoodooHDA_2-1.8.1.tar

Repeat the last two lines in an endless loop.
I've redownloaded it many times but same result. It's the first time I face this thing.
However I'll try doing it with osx on my lenovo, maybe this strange loop is due to the fact I have 10.6.8 here.


Thanks however!

I hope I could helps in some way in the future, you did my day with this clear guide.
 
Joined
Dec 12, 2013
Messages
23
Motherboard
Lenovo U310
CPU
i5-3317
Graphics
intel HD4000
Mac
Classic Mac
Mobile Phone
iOS
I cant mount EFI partition, just can mount clover folder, boot & microsoft/windows folder not appear, i try via terminal and show
Untitled.jpg
Can u help me?
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,075
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
I cant mount EFI partition, just can mount clover folder, boot & microsoft/windows folder not appear, i try via terminal and show
View attachment 79787
Can u help me?
Are you booting in safe mode (-x)? Not sure FAT32 mounting works in safe mode.
 
Top