Installing 10.4.3 for nForce SATA hard drives
Note: there is now a patch for the install DVD which apparently pre-hacks the kext file for you, allowing you to install natively directly from the DVD. I've not tried this yet, if anyone has feel free to edit this comment here and note how well it worked for you!
The following is a guide for installing OS X 10.4.3 (and possibly newer releases) on machines which only have a SATA hard drive, not supported by OSX by default - certainly nForce motherboards, and also applicable to other situations where OSX won't install without certain kext's being modified/loaded which don't normally. VMWare is used to first install the OS to a virtual partition (avoiding problems with the Installer not liking certain partitions), and to then modify the kext(s), and a Linux live CD is used to transfer the image across. This wouldn't have been possible without the helpful folk in the IRC channel, and joblo10 who discovered the kext hack for SATA on nForce motherboards.
- A patched OSX x86 10.4.3 ISO image (newer versions may also work, not tried)
- The AppleVIAATA.kext directory from OSX 10.4.4 (don't ask where to find this!)
- A Linux live CD / CD image (pretty much any should be fine, I like Ubuntu but Damn Small Linux does the job in 50MB)
- VMWare Workstation
- Daemon Tools or similar (e.g. Alcohol 120%)
- Suffficient unpartitioned hard disk space to install (approx. 6.5GB)
1. To begin, you need to find the hardware ID of your SATA controller:
- Right click on My Computer, select Properties, go to the Hardware tab and click Device Manager.
- Expand the "IDE ATA/ATAPI Controllers" tree, locate the "Serial ATA Controller", right click it and select Properties.
- Go to the Details tab. You will see a string, starting "PCI\VEN...". To find your hardware ID, note the four characters after "VEN_" and the four after "DEV_". Your hardware ID consists of "0x" followed by the characters after "DEV_" followed by the characters after "VEN_".
For example, if the "Device Instance ID" starts "PCI\VEN_10DE&DEV_003E...", the hardware ID would be "0x003E10DE".
- Make a note of this, you'll need it later.
2. The next step is to install OSX to a VMWare disk image:
- Mount the OSX ISO with Daemon Tools, so it appears as a CD drive in Windows.
- Open VMWare and create a new virtual machine. Set the Guest OS to Other > FreeBSD, select "Use bridged networking", and allocate about 6.5 GB hard disk space.
- Edit the virtual machine settings - remove all the devices except the Memory, CD drive, Ethernet and hard disk. Set the memory to around half your RAM (it's tempting to set it higher, but the increased swap file use will slow things down), and set the CD drive to use the physical drive you mapped to the OSX ISO image with Daemon Tools.
- Start the virtual machine, click in the window to give it focus as soon as it starts, and press ESC to enter the boot menu and select the CD-ROM as the boot device.
- Go through the installer, deselecting any extras you don't need. It will likely take around one hour to install.
3. Hopefully, the virtual machine should reboot. Let it boot from the hard disk, and you should enter OSX. Follow the setup instructions, and then configure OSX to detect the nForce SATA (advanced users can edit anything else they need here too):
- 10.4.3 does not contain the required AppleVIAATA.kext by default. There are several methods to get the kext into OSX, but the easiest is to give the virtual machine access to your Windows partitions - shut down OSX by choosing Shut Down from the "Apple Menu", edit the VM settings again, and add a new hard disk. Select "Use a physical disk", and select "Use entire disk". Start the virtual machine again, and when OSX boots, you should see your Windows partitions mounted on the desktop.
- Locate the 10.4.4 AppleVIAATA.kext folder on your Windows drive (if you have the complete set of 10.4.4 extensions, it is located in Extensions/IOATAFamily.kext/Contents/Plugins) and drag it to your desktop to temporarily copy it there.
- Open a terminal window (Go to your Mac hard drive > Applications > Utilities > Terminal) and type the following commands (remember, capital letters matter!):
(Enter your password here)
(Note that you can press Tab to complete file/directory names)
cp -R /Users/<your username>/Desktop/AppleVIAATA.kext/ .
(Note the dot at the end)
- At this point, the "Info.plist" file is open in the "nano" text editor. Scroll down the file until you see "<key>VIA SATA Controller</key>". Locate the line below this which says "<key>IOPCIPrimaryMatch</key>" and go the line below ("<string>0x31491106</string>"), move the cursor to the "<" after the "6" and type " (your hardware ID)" - so using the hardware ID from before, the line would now read "<string>0x31491106 0x00e310de"</string>".
- Press Ctrl + O to save the file, press Enter, and then press Ctrl + X to exit nano.
- The kext is now modified to detect your SATA controller, but you need to repair it so that OSX doesn't spot that it has been altered. Type the following commands:
chown -R root:wheel /System/Library/Extensions
chmod -R 755 /System/Library/Extensions/IOATAFamily.kext/Contents/PlugIns
- To check that everything has been changed OK, try loading the kext by typing the following:
cd /System/Library/Extensions/IOATAFamily.kext/Contents/PlugIns kextload AppleVIAATA.kext
It should say that it loaded successfully. If not, go back and check you carried out all the previous steps correctly.
- Now the modified kext needs to be inserted in to the kext cache, so that it is loaded on startup. I used the following commands (some may not be needed however - open to correction here!)
kextcache -k /System/Library/Extensions/
kextcache -m /System/Library/Extensions.mkext /System/Library/Extensions/IOATAFamily.kext/Contents/Plugins/AppleVIAATA.kext
kextcache -L -N -e
4. The kext is now inserted so that the SATA controller will be detected on startup. All that remains is to transfer the virtual disk image to a real partition:
- Shutdown the virtual machine. Create a partition of the same size as (or greater than) the virtual disk image, either using a tool such as Partition Magic (the easy way!) or a guide such as this (the type isn't important for now, but set it to type AF if your software lets you - if not, set it to a partition type you don't otherwise have on your disk, e.g. Linux Swap, to allow you identify it from any other partitions).
Note: the partition must be a primary partition (I think? Check please!). If your paritioning software won't let you create one, you need to play around with the current order of your partitions until you can create a primary partition (anyone know about this in better detail?).
- Edit the virtual machine settings again. Change the CD-ROM drive to point to your Linux live CD - either a real one (physical drive) or an ISO file. Make sure that both the virtual drive and your physical hard drive are still enabled. Boot the virtual machine from the CD as in part 2.
- This varies depending upon your Linux distribution, but now get to a terminal window in Linux (Applications > System Tools > Root Console in Ubuntu, in DSL you can use the ATerminal icon). Become root if you aren't already (try sudo -s, or su). Now it is necessary to determine which drive is your OSX virtual drive, and which is the correct partition on the real hard drive.
- Type fdisk /dev/hda, and at the prompt type "p". Look at the partition table it prints out. Quit fdisk, by typing "q", and repeat the process but typing fdisk /dev/hdb instead. Your partition tables will vary, but it is quite easy to identify which of hda and hdb is your real disk, and which is the image:
The virtual drive image will look something like: (note: only one partition, of type AF)
Device Boot Start End Blocks Id System /dev/hda1 * 1 784 6291400+ af Unknown
and the real hard disk will look something like: (depending on your setup! - more partitions, probably some NTFS/FAT32 ones)
Device Boot Start End Blocks Id System /dev/hdb1 * 1 6527 52428096 7 HPFS/NTFS /dev/hdb2 6528 23711 123456789+ 7 HPFS/NTFS /dev/hdb3 23712 24622 7317607+ af Unknown
- At this point, if you were unable to set the partition type to "AF" when you created the partition, type fdisk <OSX hard disk> - in this case that'd be fdisk /dev/hda - then type "t", enter the partition number "1" and enter the partition type "af". Now type "w" to write the partition table and exit. If your partition was already of type "AF", ignore this step!
- Look at the real disk partition table, and figure out which is the partition you want to install OSX too. In this case, it'd be /dev/hdb3, as it's ID is of type af (if you created it as a different type, look out for that type instead). Make sure you know which partition this is - pick the wrong one and you'll overwrite your data, without warning.
- Now all that remains is to transfer the virtual image to the disk. To do this, use the command dd, with the syntax:
dd if=<Virtual OSX Partition> of=<Target Disk Partition> bs=4k
In this example, the command we would type would be:
dd if=/dev/hda1 of=/dev/hdb3 bs=4k
but note that your hda and hdb may be swapped round, and your partition number for the target may be different. Check, double check and triple check before pressing enter and making yourself a coffee. The time taken varies, but with a block size of 4,096 it took about ten minutes for me. Be patient, dd does not give you any feedback until it has finished (unless you interupt it with a signal of USR1, but if you don't know what that means don't worry ;)). You'll know it's done when you see something like:
12581793+0 records in 12581793+0 records out %
- Once dd has finished, shut down the Linux image (type shutdown now if you are at a text console) and power off the virtual machine.
5. The final step (hopefully!) is to set up your system so it can boot OSX:
- There are several ways to do this, including using a bootloader such as grub or using the Darwin bootloader, but the easiest way is to use the chain0 file, and the Windows bootloader. Feel free to ignore this if you know what you are doing otherwise!
- First, you need the file chain0. This isn't freely available, but there is quite an easy way to get it: start a command prompt in Windows (Start > Run > cmd) and type cd \, then debug. Now copy the code starting N CHAIN0 from here to the clipboard, and paste it in to the command window (right click on the title bar and choose Edit > Paste). Let it do it's thing, and then press enter after it displays Q to quit. If you now check in your C:\ directory, you should find a file called chain0, 512 bytes big.
- Now you need to let Windows know about this. Open notepad, and open the file C:\boot.ini. Add the following line to the end of the file:
C:\chain0="Mac OS X86"
and save it.
- All done! Now you can reboot, and when the Windows bootloader appears, select Mac OS X86. If you find that it goes straight back to the Windows bootloader, you need to press F8 quickly after pressing Enter on the Mac OS X86 option. This will bring up the Darwin bootloader, from which you can select the OSX partition with up/down (you'll know you have the right one when the boot: prompt appeas), and then press Enter to boot it.
Hopefully you are now in OSX, with your SATA hard disk working. If you're having problems, look around or post on the forums or IRC channel, after double checking you followed the guide properly.
Tested on the following system:
- AMD Athlon64 3000+
- Gigabyte K8NS-Pro motherboard with nForce3 chipset
- 200GB Western Digital SATA hard drive
- 512MB RAM
The author of this guide accepts no responsibilty for any damage caused by following it. It worked for me, but it might not for you - be careful, and make sure you understand what you are doing at each step. Ask for help if not because one wrong move, especially in Linux, could kill your data! And on that happy note... :) .
This page was last modified on 29 March 2009, at 16:12.
This page has been accessed 98,783 times.