Menu Content/Inhalt
Home

Navigation

Polls

Would you purchase DRM protected media?
 
The MacBook Pro Latch
Hardware
Tuesday, 21 October 2008

If you've been following my blog (I don't post often do I don't blame you if you don't Wink) you know that I've become a pretty big fan of Apple. Even though you do end up paying a slight premium for Apple hardware compared to a Dell let's say, the peace of mind from using OS X and the bundled software is well worth the extra cost.

I've only have three complains about my MacBook Pro 4,1 (early 2008 model): A small and very bright white dot on the screen that only appears when displaying white pixels, small amounts of corrosion on the hand rest area near the trackpad, and finally the latch button has been stuck pressed in for the past two days and so the screen wouldn't stay close properly.

Turns out that there isn't much I can do about the first - many other owners of MacBook models with LED-backlit screens also seem to have the problem. The second is slightly annoying, but after some reading I discovered some good news - only the first layer will oxidize/corrode, and the case as a whole will be fine. The last one also seems to be a relatively common problem, and fortunately it's an easy fix! After two hours of fidgeting with a paperclip and protractor trying to push the latch forward, I finally decided to shine a flashlight into the small holes near the trackpad and latch mechanism. Sure enough, there was a small piece of plastic that had fallen into the hole and was blocking the latch from springing forward. I used a small metal hook to carefully move the piece of plastic upwards and not slide it across (where it would eventually just obstruct the latch again) and then removed it. Voila, the latch was working again!

 
MacBook and MacBook Pro 4,1 + Fedora 9
Hardware
Sunday, 01 June 2008
I recently bought a new MacBook Pro and had some trouble getting it to work in Fedora - Here's how I did it :)
 

Before we start

I've discovered three useful tips from playing around and a bit of web research that I should share before we begin. The first is that no matter how many OSs you install on your Mac, you're going to have to put Windows on the last partition of the disk. I have no idea why, but XP SP2 seems to bug out if you don't.
 
The second useful tip is that because of the way the EFI+MBR overlap when booting multiple operating systems, no extended partitions are supported. Mac also takes its own partition as part of the MBR compatability scheme, so that leaves you with a maximum of 3 OS partitions.
 
Finally and most importantly, it's very difficult to change the partitioning scheme once it's been finalized/the OSs are installed. I would recommend that if you think you're going to triple-boot later on, you leave the empty partiton in between for Linux or at the end for Windows to save you lots of headaches later... I hope this can help someone, since I almost had to format the entire HD (at that point, Windows AND Mac OS X) when I realized it would be very difficult to repartition and preserve data.
 

Step 1: Resize your Macintosh HD (HFS+ partition)

If you'd like to dual boot, simply open up the Boot Camp assistant and use it to partition your Mac Drive. When asked to insert the Windows installation disk, simply insert a Linux one and it will do the rest (skip step 2a). I recommend a kernel >= 2.6.24.

If you'd like to triple boot, it would be a good move to create the three partitions ahead of time. Fortunately for us, HFS+ partitions support resizing so it's a breeze to shrink OSX and add two new partitions. Simply boot from your Mac OSX install CD and select Terminal from the Utilities menu once it boots. Resize Macintish HD with this command:

diskutil resizeVolume disk0s2 100G "MS-DOS FAT32" "FormatToLinux" 15G "MS-DOS FAT32" "Windows" 50G

Change the volume sizes to match your preferred setup and hard drive size. Since both Linux can read to NTFS and read HFS+ safely, I figured it didn't need to be that big and so I left the Mac and Windows partitions larger.

When you're done, quit Terminal and reboot back into OS X. Insert the Windows install CD, reboot and hold the left "alt/option" key as the Mac boots. This will offer you the choice of booting from the CD named "Windows".

 

Step 2a: Install Windows

When it comes to the partition selection, select the last FAT32 partition ("Partition 4"). It should be labelled "Windows" - format it to NTFS (Quick format) and install onto that partition. Hint: One of the two OS X installation disks included with the Mac has Windows drivers for the keyboard backlight, trackpad, graphics card and more. When you're done setting up Windows, reboot holding the left "alt/option" key and boot into Mac OS X.

Step 2b: Install Fedora 9

Since the new Intel CPUs in the Macs have the EM64T extension, they support 64bit operating systems (x86_64). I chose the x86_64 variant of Fedora, however the 32bit (i386) version would work just as well. The installation, either off DVD of live media, goes pretty smoothly until partitioning. You must select "Custom Partition Layout". You'll find /dev/sda3 is type vfat - This is the drive we made that we need to format to ext3. Select it mount as "/", formatting to ext3 as well (you can use xfs or whatever filesystem you prefer here as well, I just like ext3 since it's well supported and tested). From here on you can follow the rest of the installation as usual.

 

Step 3: Wireless & Sound

Wireless is actually pretty easy for the Mac. The drivers included on the installation disc work perfectly, but Dell offers a driver form the same card that's easier to install than extracting it off the exes. First, download these RPMs on anther computer and transfer them to your home:

32bit (i386):
kmod-ndiswrapper-1.52-30.lvn9.i686.rpm

kmod-ndiswrapper-2.6.25-14.fc9.i686-1.52-30.lvn9.i686.rpm
ndiswrapper-1.52-1.lvn9.i386.rpm
R151517.EXE

 

64it (x86_64):
kmod-ndiswrapper-1.52-30.lvn9.x86_64.rpm

kmod-ndiswrapper-2.6.25-14.fc9.x86_64-1.52-30.lvn9.x86_64.rpm
ndiswrapper-1.52-1.lvn9.x86_64.rpm
R151517.EXE


Next, run this to install the wifi driver:

mkdir wifidriver
unzip -a R151517.EXE -d wifidriver/
cd wifidriver/DRIVER/
su
# install ndiswrapper and the wifi driver
rpm -Uhv *ndiswrapper*rpm && rm -i *ndiswrapper*rpm
/sbin/modprobe ndiswrapper
ndiswrapper -i bcmwl5.inf && rm -rf wifidriver && rm -i R151517.EXE
echo "options snd_hda_intel model=mbp3" >> /etc/modprobe.d/soundcard
echo "blacklist bcm43xx" >> /etc/modprobe.d/blacklist
echo "blacklist ssb" >> /etc/modprobe.d/blacklist
echo "blacklist b43" >> /etc/modprobe.d/blacklist
# ndiswrapper is used for wlan0
echo "modprobe ndiswrapper" >> /etc/rc.d/rc.local
echo "alias wlan0 ndiswrapper" >> /etc/modprobe.d/ndiswrapper
/sbin/service NetworkManager restart

Step 5: Akmods

Since we plan on upgrading the kernel in a second, let's install akmods so that the kernel modules (ie, for wireless and nvidia if you're on a Pro) will create themselves when we update the kernel:

su
rpm -Uhv http://rpm.livna.org/livna-release-9.rpm
yum install akmods-ndiswrapper

If you're on a MacBook Pro, install the nvidia driver as well:

yum install akmods-nvidia 

Step 6: Kernel

Kernels 2.6.25.4-35 and newer include a fix for the fn-keys, which enables you to control the current song, volume and backlight, etc. At the moment this kernel hasn't been released to updates or updates-testing so we can use the a more recent koji build here. When a newer kernel is released to updates, just do a "yum update" to update the system (or do it via PackageKit if you prefere a GUI) and skip this entire step.
 
For 32bit systems, download it with this command:
wget http://koji.fedoraproject.org/packages/kernel/2.6.25.4/39.fc9/i686/\
kernel-2.6.25.4-39.fc9.i686.rpm http://koji.fedoraproject.org/packages/kernel\
/2.6.25.4/39.fc9/i686/kernel-devel-2.6.25.4-39.fc9.i686.rpm
For 64bit systems, download it with this command:
wget http://koji.fedoraproject.org/packages/kernel/2.6.25.4/39.fc9/x86_64/\
kernel-2.6.25.4-39.fc9.x86_64.rpm http://koji.fedoraproject.org/packages/kernel/\
2.6.25.4/39.fc9/x86_64/kernel-devel-2.6.25.4-39.fc9.x86_64.rpm
Next, install it:
su
rpm -ihv kernel*2.6.25.4-39*.rpm 
Reboot and let the akmods work their magic. If you don't have the nVidia driver and wireless working the first try, reboot again and things should return to normal.
 

Step 7: Pommed

Pommed lets you control the LED and keyboard backlight, soundcard, infrared remote and more. It will (hopefully) soon be included in Fedora, but until then, if you'd like to install it run this:

su
wget http://downloads.diffingo.com/diffingo-repo/diffingo.repo -O \
/etc/yum.repos.d/diffingo.repo
yum install pommed

 

Enjoy Linux (and Windows if applicable) on your new MacBook!

 
NexStar3 eSATA+USB2.0 Enclosure
Hardware
Thursday, 16 August 2007
I recently bought a Vantec NexStar3 eSATA+USB2.0 enclosure plus a Western Digital 500GB SATA2 drive to go inside it. The enclosure and the drive are great, but when I put the two together I was having some really, really annoying problems.
 
My BIOS detected the drive fine, AHCI or IDE mode, and could bootup into Linux (I tried with Fedora, Ubuntu, PCLinuxOS). It's detected in the OS too, but not usable:
Aug 15 23:32:56 LinuxBox kernel: ata7.00: exception Emask 0x10 SAct 0xff SErr 0x780100 action 0x2
Aug 15 23:32:56 LinuxBox kernel: ata7.00: irq_stat 0x08000000
Aug 15 23:32:56 LinuxBox kernel: ata7.00: cmd 60/20:00:af:96:bc/00:00:05:00:00/40 tag 0 cdb 0x0 data 16384 in
Aug 15 23:32:56 LinuxBox kernel: res 40/00:3c:e5:70:cc/00:00:1e:00:00/40 Emask 0x10 (ATA bus error)
Aug 15 23:32:56 LinuxBox kernel: ata7.00: cmd 60/80:08:d0:86:cc/00:00:05:00:00/40 tag 1 cdb 0x0 data 65536 in
Aug 15 23:32:56 LinuxBox kernel: res 40/00:3c:e5:70:cc/00:00:1e:00:00/40 Emask 0x10 (ATA bus error)
Aug 15 23:32:56 LinuxBox kernel: ata7.00: cmd 60/7f:10:50:87:cc/00:00:05:00:00/40 tag 2 cdb 0x0 data 65024 in
Aug 15 23:32:56 LinuxBox kernel: res 40/00:3c:e5:70:cc/00:00:1e:00:00/40 Emask 0x10 (ATA bus error)
Aug 15 23:32:56 LinuxBox kernel: ata7.00: cmd 60/08:18:e7:87:cc/00:00:05:00:00/40 tag 3 cdb 0x0 data 4096 in
Aug 15 23:32:56 LinuxBox kernel: res 40/00:3c:e5:70:cc/00:00:1e:00:00/40 Emask 0x10 (ATA bus error)
Aug 15 23:32:56 LinuxBox kernel: ata7.00: cmd 60/07:20:66:7b:4c/00:00:12:00:00/40 tag 4 cdb 0x0 data 3584 in
Aug 15 23:32:56 LinuxBox kernel: res 40/00:3c:e5:70:cc/00:00:1e:00:00/40 Emask 0x10 (ATA bus error)
Aug 15 23:32:56 LinuxBox kernel: ata7.00: cmd 60/02:28:e3:70:cc/00:00:1e:00:00/40 tag 5 cdb 0x0 data 1024 in
Aug 15 23:32:56 LinuxBox kernel: res 40/00:3c:e5:70:cc/00:00:1e:00:00/40 Emask 0x10 (ATA bus error)
Aug 15 23:32:56 LinuxBox kernel: ata7.00: cmd 60/07:30:79:b1:d4/00:00:01:00:00/40 tag 6 cdb 0x0 data 3584 in
Aug 15 23:32:56 LinuxBox kernel: res 40/00:3c:e5:70:cc/00:00:1e:00:00/40 Emask 0x10 (ATA bus error)
Aug 15 23:32:56 LinuxBox kernel: ata7.00: cmd 60/06:38:e5:70:cc/00:00:1e:00:00/40 tag 7 cdb 0x0 data 3072 in
Aug 15 23:32:56 LinuxBox kernel: res 40/00:3c:e5:70:cc/00:00:1e:00:00/40 Emask 0x10 (ATA bus error)
Aug 15 23:32:56 LinuxBox kernel: ata7: soft resetting port
Aug 15 23:32:56 LinuxBox kernel: ata7: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
Aug 15 23:32:56 LinuxBox kernel: ata7.00: configured for UDMA/133
Aug 15 23:32:56 LinuxBox kernel: ata7: EH complete
Aug 15 23:32:56 LinuxBox kernel: sd 7:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB)
Aug 15 23:32:56 LinuxBox kernel: sd 7:0:0:0: [sdb] Write Protect is off
Aug 15 23:32:56 LinuxBox kernel: sd 7:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Aug 15 23:32:56 LinuxBox kernel: scsi 6:0:0:0: Direct-Access DMI WD1600BB-00GUC0 3.52 PQ: 0 ANSI: 0
Aug 15 23:32:56 LinuxBox kernel: sd 6:0:0:0: [sdc] 312581808 512-byte hardware sectors (160042 MB)
Aug 15 23:32:56 LinuxBox kernel: sd 6:0:0:0: [sdc] Write Protect is off
Aug 15 23:32:56 LinuxBox kernel: sd 6:0:0:0: [sdc] Assuming drive cache: write through
Aug 15 23:32:56 LinuxBox kernel: sd 6:0:0:0: [sdc] 312581808 512-byte hardware sectors (160042 MB)
Aug 15 23:32:56 LinuxBox kernel: sd 6:0:0:0: [sdc] Write Protect is off
Aug 15 23:32:56 LinuxBox kernel: sd 6:0:0:0: [sdc] Assuming drive cache: write through
Aug 15 23:32:56 LinuxBox kernel: sdc: sdc1 sdc2 < sdc5 sdc6 > sdc3
Aug 15 23:32:56 LinuxBox kernel: sd 6:0:0:0: [sdc] Attached SCSI disk
Aug 15 23:32:56 LinuxBox kernel: sd 6:0:0:0: Attached scsi generic sg3 type 0
Aug 15 23:32:56 LinuxBox kernel: NET: Registered protocol family 10
Aug 15 23:32:56 LinuxBox kernel: lo: Disabled Privacy Extensions
Aug 15 23:32:56 LinuxBox kernel: floppy0: no floppy controllers found
Aug 15 23:32:56 LinuxBox kernel: No dock devices found.
Aug 15 23:32:56 LinuxBox kernel: device-mapper: ioctl: 4.11.0-ioctl (2006-10-12) initialised: This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
Aug 15 23:32:56 LinuxBox kernel: device-mapper: multipath: version 1.0.5 loaded
Aug 15 23:32:56 LinuxBox kernel: EXT3 FS on sda1, internal journal
Aug 15 23:32:56 LinuxBox kernel: ata7.00: exception Emask 0x10 SAct 0x2 SErr 0x580100 action 0x2
Aug 15 23:32:56 LinuxBox kernel: ata7.00: irq_stat 0x08000000
Aug 15 23:32:56 LinuxBox kernel: ata7.00: cmd 60/80:08:27:97:bc/00:00:05:00:00/40 tag 1 cdb 0x0 data 65536 in
Aug 15 23:32:56 LinuxBox kernel: res 40/00:0c:27:97:bc/00:00:05:00:00/40 Emask 0x10 (ATA bus error)
Aug 15 23:32:56 LinuxBox kernel: ata7: soft resetting port
Aug 15 23:32:56 LinuxBox kernel: ata7: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
Aug 15 23:32:56 LinuxBox kernel: ata7.00: configured for UDMA/133
Aug 15 23:32:56 LinuxBox kernel: ata7: EH complete
Aug 15 23:32:56 LinuxBox kernel: sd 7:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB)
Aug 15 23:32:56 LinuxBox kernel: sd 7:0:0:0: [sdb] Write Protect is off
Aug 15 23:32:56 LinuxBox kernel: sd 7:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA

After tons of messages like that and a few minutes, a "soft reset" and "EH complete" would occur and only then would a tiny bit of data get through. Right after that the link froze up again with tons of errors. 

So I googled, changed ports, changed wires, used different eSATA wires, nothing chaned. I tried the drive internally and it's perfectly fine, it operated at full 3.0Gbps - SATA II speed.

 

After hours of searching I learned this:

  • The ICH8 SATA controller on the GA-965P-S3 (rev 1.0) doesn't actually support AHCI. Later revisions of the ICH8, example the ones on the GA-965P-S3 rev 3.3 do though. (/me grumbles...)

  • The one time the drive did work without the link failing was when it was reset enough times and auto-negotiated the link down to 1.5Gbps - Perhaps electrical interference was the problem.

  • All SATA II Western Digital drives have a manual override for the SATA link speed using the jumpers - Putting a jumper on the second column of pins will limit the drive to 1.5Gbps (regular SATA speed)
As you can probably guess, the first point is just a major annoyance and the last two solved the problem. My drive now boots up with a 1.5Gbps link, so no need to let it fail for a while before using it.
 
As for the enclosure, it's a great buy for it's value - I got it for 40$ CAD. It features SATA connectors inside and as mentioned above can be plugged in via USB or eSATA. Vantec even supplies you with an eSATA cable and an SATA --> eSATA bracket!
 
My ramblings on Marvell 88E8056, 2.6.21, sky2
Hardware
Monday, 14 May 2007
The Marvell LAN on my GA-965P-S3 board stopped working all of a sudden after a reboot the other day, and I franticly tried falshing the BIOS & firmware, I undid my overclock, even rewired everything inside. No luck.
 
Turns out the problem is due to the semi-broken sky2 driver - From what I've heard it's been broken for a while and people know it but it works pretty well from my experience... Apart from this.
 
Anyways the cause was the new 2.6.21 kernels, which is why it only started happening after a reboot - When I used the new kernel. Reverting to 2.6.20 (in my case, the FC6 kernel) worked perfectly.
 
$ /sbin/lspci | grep Ethernet
04:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8056 PCI-E Gigabit Ethernet Controller (rev 14)