2011-05-14

Upgraded to 10.6.7, SleepEnabler needs pmIncrement=0

The PM_DISPATCH_VERSION constant did not change going from 10.6.6 to 10.6.7. This is why a SleepEnabler.kext that worked with 10.6.6 should also work with 10.6.7. You need to add pmIncrement=0 or pmVersion=21 to your com.apple.Boot.plist though.

/Extra/com.apple.Boot.plist:

<plist version="1.0">
<dict>
...
        <key>Kernel Flags</key>
        <string>arch=[i386 or x86_64] pmIncrement=0</string>
...
</dict>
</plist>

- MacFiets

2011-05-06

How to download Xcode 3

Looks like there is only information about Xcode 4 on Apple's developer site http://developer.apple.com/xcode/index.php. What's more, Xcode 4 is not free -- you need to sign up for one of the developer programs, or alternatively buy it at the Mac App Store for the outrageous sum of €3.99 (or you local equivalent).

I am cheap bastard. This whole blog is about running OS X cheap after all. Well, actually I would have spent the money, but Apple's credit card verification drives me crazy. Ever tried using a credit card issued in a country different from the store's country? I got an error message saying "this card is not valid in the Netherlands". This is nonsense of course, every other shop happily accepts it. I digress.

So, where do I get Xcode 3 from? Turns out that it's still available from the old developer's site at http://connect.apple.com. Log in with your Apple id, select "Developer Tools".

Xcode 3.2.6.jpg

- MacFiets

 

 

2011-02-27

Upgraded SleepEnabler.kext to 10.6.6

After upgrading to 10.6.6, I had to install a new version of SleepEnabler.kext. Since I have patched and built SleepEnabler from source for 10.6.5, I upgraded my own version to 10.6.6.

Version specific operating system header files

$ uname -v
Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386

I downloaded xnu-1504.9.26.tar.gz from www.opensource.apple.com and diffed the version specific operating system header files. Luckily, none of them changed so I simply pulled in the 10.6.6 changes from SleepEnabler's main source.

My Mercurial clone on googlecode.com

The name of my clone is no longer appropriate, but I didn't feel like creating another clone. If you would like to check it out:

$ hg clone https://macfiets-10-6-5.googlecode.com/hg/ macfiets-10-6-5

- MacFiets

2010-12-19

Xcode is clogging up my internet connection

Usually I notice pretty quickly when my internet connection clogs up with downloads I have not started myself. With the help of tcpdump and lsof it's pretty easy to find the receiving application -- Xcode in this case. So wtf is going on?

Today I learned two things. First, Xcode can automatically download updated documentation. Under Xcode -> Preferences -> Documentation you will find the Documentation Sets tab. This has a "Check for and install updates automatically" checkbox.

Second, Xcode has a little helper under Xcode -> Window -> Activity. This shows you what it's currently doing:

Xcode Activity Window.png

- MacFiets

 

Dell Inspiron 1018 - Unfortunately not my second Hackintosh

I am in the market for a real simple netbook whose main -- almost only purpose -- is to run Skype. In other words I am looking for a video telephone. Ideally an OS X powered one. The MacBook Air is beautiful, but it costs an arm and a leg.

One of the most OS X compatible netbooks made so far seems to be Dell Mini 10v. The Mac OS X Netbook Compatibility Chart on myMacNetbook.com states that all hardware features such as sound, sleep, audio, wireless, ..., work. The only problem is that you cannot buy a new Mini 10v anymore.

The current low-end netbook on the dell.nl is the Inspiron 1018. Yes, cheap it is.

Dell Inspiron 1018 - Dell Shop - Small.jpg

Despite having not seen any success stories, I ordered one. Well, I didn't get very far and ended up installing Linux. If anyone had more success, I would love to hear from you.

- MacFiets

 

2010-11-28

Upgraded SleepEnabler.kext to 10.6.5

The SleepEnabler.kext I used with 10.6.4 caused kernel panics with 10.6.5. I learned that this kext is kernel version specific so I grabbed one that was supposed to work with 10.6.5 from kexts.com, but I still got kernel panics. I then decided to build the SleepEnabler.kext from source myself and patch whatever has to be patched.

The main motivation was simply to find out how to do stuff like this. I understand that sleep would also work with a properly patched DSDT, but I leave for some other time.

Prerequisites

Install the Mercurial client and download the xnu-sleep-enabler sources

$ sudo port install mercurial

$ hg clone https://xnu-sleep-enabler.googlecode.com/hg/ xnu-sleep-enabler

Get version specific operating system header files

$ uname -v
Darwin Kernel Version 10.5.0: Fri Nov  5 23:20:39 PDT 2010; root:xnu-1504.9.17~1/RELEASE_I386

This tells you exactly which version of the xnu kernel to download. Navigate to www.opensource.apple.com, click on Mac OS X 10.6.5 and scroll down. Near the bottom of the page you will find this link http://www.opensource.apple.com/tarballs/xnu/xnu-1504.9.17.tar.gz. Download and install next to the sleep enabler.

Patching

The sleep enabler has version specific directories called Headers_10.x.y for the different kernel versions 10.x.y. I created a new one called Headers_10.5.0. There are two files called pmCPU.h and cpu_topology.h in the existing directories:

$ ls -l Headers_10.3.0
total 40
-rw-r--r--  1 macfiets  macfiets  9615 Nov 28 15:56 cpu_topology.h
-rw-r--r--  1 macfiets  macfiets  5208 Nov 28 15:56 pmCPU.h

In the xnu kernel source, those files reside in the osfmk/i386 directory so I copied them from ../xnu-1504.9.17/osfmk/i386 to Headers_10.5.0. It turned out that pmCPU.h also needs rtclock.h so I copied this one too.

$ ls -l Headers_10.5.0
total 56
-rw-r--r-- 1 macfiets  macfiets  9747 Nov 28 15:56 cpu_topology.h
-rw-r--r-- 1 macfiets  macfiets  5634 Nov 28 15:56 pmCPU.h
-rw-r--r-- 1 macfiets  macfiets  4211 Nov 28 15:56 rtclock.h

Next, I fixed the references in pmCPU.h to the two other files.

$ diff ../xnu-1504.9.17/osfmk/i386/pmCPU.h Headers_10.5.0/pmCPU.h
32,33c32,34
< #include <i386/cpu_topology.h>
< #include <i386/rtclock.h>
---
> #include "cpu_topology.h"
> #include "rtclock.h"
>

Building

The last step before actually building this project was to create a new Xcode configuration that would tell Xcode to use the include files from Headers_10.5.0. I copied the Debug configuration to "Debug 10.6.5" and change the KERNEL_VERSION.

sleepenabler 10.6.5.jpg

Now you can build from the Xcode gui or alternatively from the command line

$ xcodebuild -configuration 'Debug 10.6.5'

Check that the resulting binaries contains code for both 32 and 64-bit:

$ file build/Debug\ 10.6.5/SleepEnabler.kext/Contents/MacOS/SleepEnabler
build/Debug 10.6.5/SleepEnabler.kext/Contents/MacOS/SleepEnabler: Mach-O universal binary with 2 architectures
build/Debug 10.6.5/SleepEnabler.kext/Contents/MacOS/SleepEnabler (for architecture x86_64):     Mach-O 64-bit kext bundle x86_64
build/Debug 10.6.5/SleepEnabler.kext/Contents/MacOS/SleepEnabler (for architecture i386):       Mach-O object i386

Done. Install the SleepEnabler.kext in /System/Library/Extensions and reboot.

My Mercurial clone on googlecode.com

I have created a Mercurial clone of the xnu-sleep-enabler project and pushed my changed. If you would like to check it out:

$ hg clone https://macfiets-10-6-5.googlecode.com/hg/ macfiets-10-6-5

- MacFiets

 

2010-11-21

Updating the BIOS of a gigabyte board without the help of Windows

GIGABYTE's support is pretty good. There have been a number of BIOS upgrades since I bought the board for my first hackintosh. However, the BIOS files all come as self-extracing Windows .exe files. I don't have a Windows machine anywhere in my house. Honest.

I found two programs to uncompress those files on a Mac though. Zipeg has has a simple gui and works a treat.

download.zipeg.free.256x82.png

If you prefer to use the command line, then there is http://p7zip.sourceforge.net. If you have the MacPorts installed, then it's simply

sudo port install p7zip

This will install the 7z program in /opt/local/bin.

How to upgrade the BIOS

  1. Download the BIOS from gigabyte.com
  2. Download either zipeg or p7zip
  3. Unpack the .exe file and put the BIOS file on a MS-DOS formatted USB stick
  4. Restart your computer and hit the "end key". In case you have an Apple keyboard, then you may not have a key labelled "end". It's the one to the right of the "delete".
  5. This will start the Q-Flash utility. Select the file you want and let it do its job

CIMG0658.JPG

Success. The "F6" version is installed.

CIMG0663.JPG