omsarti

November 13, 2007

Solaris on a Macbook

Filed under: Apple, Mac, Solaris — omsarti @ 6:28 pm

After getting a macbook, it was with the hope that I would be able to get OpenSolaris running on it and I was fairly successful. Here’s a quick rundown:

What works
Dual-booting!
Ethernet
Wireless
X (at 1280×800 with XOrg)
CD Burner, Just Works with cdrw
Keyboard
battery applet (in frkit, in snv_63+)
What doesn’t work
Trackpad
Camera (made no effort as of yet)
Sound Card (had partial success with oss)
Reading OSX partition (not aware of any way of doing this)

Steps
0. I started with a fresh install of OSX as I had tried a bunch of different things to try and get it dual-booting and wanted a clean slate. I got the details on how to set it up to dual boot from Paul Mitchell’s blog, see link below. I have a 150G disk in my system.

1. From OSX, shrink the HFS+ partition that OSX is installed into to make room. Like this:
diskutil resizeVolume disk0s2 100G “MS-DOS FAT32” “Windows” 48G

You will either need to sudo the above or enable the root account in OSX like I did. Bear in mind that the sizes I have above correspond to my disk, you will likely have different values.

2. Boot from the OSX install disk. When the installer starts, fire up a terminal from the tools menu. Unmount the internal disk:
umount /dev/disk0

Change the EFI partition’s ID:
fdisk -e /dev/rdisk0
setpid 1
AF
write
quit
3. Boot from the Nevada install DVD/CD. You need to power on the system and as soon as you see the grey screen hold down the option key (alt for people from PC world). You will see two icons, one for OSX and one labeled Windows for the CD/DVD. Select the “Windows” disk. You should be able to proceed almost all the way through the install, it will fail right at the end though when it starts to actually write to the disk. This is OK though. You just need to reboot the system and start the install again. It seems that fdisk writes something to the disk that is useful, but still fails out. When you boot off the disk again and start the install again, it should work.

4. Boot the OS by holding the option key again and select Windows – only this time it will be a hard disk icon rather than a CD icon.

5. Installing the Ethernet driver: This machine uses the a Marvell Yukon card:
bash-3.00# /usr/X11/bin/scanpci

pci bus 0x0001 cardnum 0x00 function 0x00: vendor 0x11ab device 0x4362
Marvell Technology Group Ltd. 88E8053 PCI-E Gigabit Ethernet Controller

Install the driver from here. You have to remove the SK98sol package before you install the new SKGEsol package. After that, you need to attach the driver to the device:
update_drv -a -i ‘”pci11ab,5321″‘ skge

The interface name is skge, so:
bash-3.00# ifconfig skge0 plumb
bash-3.00# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
skge0: flags=1004843 mtu 1500 index 2
inet 0.0.0.0 netmask ffffff00 broadcast 255.255.255.255

You can now configure it for DHCP or use the, rather nifty, inetmenu utility.

6. Wireless driver. The Atheros driver from opensolaris.org work very nicely with the macbook’s card. You can get it here. Just pkagadd it and then> attach it to the device:
bash-3.00# rem_drv ath
bash-3.00# add_drv -i ‘”pci106b,86″‘ ath
bash-3.00# ifconfig ath0 plumb
bash-3.00# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
skge0: flags=1004843 mtu 1500 index 2
inet 129.156.226.170 netmask ffffff00 broadcast 129.156.226.255
ether 0:16:cb:8f:cd:a5
ath0: flags=1000842 mtu 1500 index 3
inet 0.0.0.0 netmask 0
ether 0:16:cb:b9:93:98

7. Battery status
Download and install the frkit from here. Battery applet is in there by default now.

8. Getting Xorg working at 1280×800
You need to use the 915resolution app to set the resolution correctly – and believe me, its worth the effort – the screen is so much crisper at the correct resolution. If you want to build this app yourself, you can follow the instructions here to patch the FreeBSD version for Solaris. I had to do this by hand (its not a very big patch), but that could be a lack of ability on my part, rather than a faulty patch. I have a binary here you can use, but don’t blame me if anything goes wrong.

You can list the modes the card can do like this:
bash-3.00# ./915resolution -l
Intel 800/900 Series VBIOS Hack : version 0.5

Chipset: 915GM
BIOS: TYPE 1
Mode Table Offset: $C0000 + $269
Mode Table Entries: 36

Mode 30 : 640×480, 8 bits/pixel
Mode 32 : 800×600, 8 bits/pixel
Mode 34 : 1024×768, 8 bits/pixel
Mode 38 : 1280×800, 8 bits/pixel
Mode 3a : 1600×1200, 8 bits/pixel
Mode 3c : 1920×1440, 8 bits/pixel
Mode 41 : 640×480, 16 bits/pixel
Mode 43 : 800×600, 16 bits/pixel
Mode 45 : 1024×768, 16 bits/pixel
Mode 49 : 1280×800, 16 bits/pixel
Mode 4b : 1600×1200, 16 bits/pixel
Mode 4d : 1920×1440, 16 bits/pixel
Mode 50 : 640×480, 32 bits/pixel
Mode 52 : 800×600, 32 bits/pixel
Mode 54 : 1024×768, 32 bits/pixel
Mode 58 : 1280×1024, 32 bits/pixel
Mode 5a : 1600×1200, 32 bits/pixel
Mode 5c : 1920×1440, 32 bits/pixel

above is my output. You can set the resolution like this:
bash-3.00# ./915resolution 58 1280 800

You need to run this every time you boot. Xorg, at least in b62, will auto-detect the proper 1280×800 resolution of the screen once 915resolution is run.
ToDo
Camera – I believe it firewire based, so maybe dcam stuff will work
Trackpad
Sound Card

Some other pages on similar topics:
Solaris on the Macbook
Installing Solaris on a Mac Mini
Dual Partitioning a Macbook Pro

Blog at WordPress.com.