Newest Files

Date iconJul.22

This is a 10gb expanding VMWare disk image. I p...

Date iconJul.22

This is a Virtual Box disk image of the popular...

Date iconJul.06

InfoPopper ported to Haiku. See the project pa...

Date iconJun.27

This project was based on the popular weekly su...

Date iconJun.17

Jukebox is simple audio player.

Date iconMay.15

Two blank BFS formatted & bootable Vmware disc ...

Date iconApr.27

Be na Life is a game of life.

Date iconApr.25

This is a Parallels disk image of the popular S...

Date iconApr.25

This is a Qemu disk image of the popular weekly...

Date iconApr.20

Git is an open source version control system de...

Date iconApr.17

Niue is a basic, easy to use but powerful devel...

Date iconApr.05

Cdrecord is used to record data or audio Compac...

Date iconApr.01

Latest GCC and cross compiling tools needed to ...

Date iconMar.27

Beam (BEware, Another Mailer) is an open source...

Date iconMar.26

HotSyncs your Palm Pilot with BeOS.

Setting up Haiku on Mac OS X - Pt. 1
(7 votes)
Written by Dennis d'Entremont   
Sunday, 18 May 2008

Understanding the role of EFI/GPT on the Mac platform. 

The macintosh hardware/software platform is unique  in several ways.  A primary difference between "ordinary PC's" is that the hardware uses a bootup interface known as EFI (Extensible Firmware Interface) rather than the traditional X86 BIOS. 

The use of EFI has many advantages (beyond the scope of this document), however, it has one primary disadvantage: many operating systems lack native EFI support.  EFI, being a very new and very different way of interacting with the hardware during bootup, provides a unique challenge to pre-existing operating systems.  Windows XP and Vista, as well as Haiku, all lack native support for EFI booting.  

How, may you ask, does one see people running Windows / Linux on the Macbook? Well, Apple sometime ago released a set of BIOS emulations with a firmware update entitled 'Bootcamp'.  This, along with a set of user-friendly installation tools in OS X allows one to install Windows alongside their native Mac OSX installation.

Another primary change with the mac is the use of a different partitioning format for the disk: GPT.

The GUID partition format changes some of the legacy problems of the traditionally used master boot record, while still providing fairly useful backwards compatibility.

The GPT format provides space at the head of the drive where the MBR  was traditionally found.  This allows not only for protection, in the case of an overzealous file utility, but also allows the Mac to use this 'dummy' MBR in its Bootcamp emulation.

Okay, but why is this important? 

The Bootcamp emulation can only reference the first 4 partition entries located in the 'fake' MBR.  Two of these are traditionally used by the Mac.  The fourth is occupied by Windows in a typical Bootcamp setup.  The typical partitioning of a Haiku installation will thus be:

1) EFI system partition (necessary for firmware updates, etc)

2) Mac OS X (Leopard)  (HFS+ case sensitive? or insensitive)

3) Haiku 

4) Windows / Linux / BSD Whatever.  (fat32/ext2/3)

5) Build partitions (See below) (HFS+ Case Sens.)

Partitions beyond 4, in this case the build partition, cannot be accessed from within legacy OSs, but can be accessed by EFI / GPT aware systems. 

How can I setup these partitions on my Macbook?

A program called diskutil.

Diskutil allows you to dynamically resize your OSX partition to allow the addition of others.  To see a list of partitions simply type 'diskutil list' from within a Terminal prompt.

In my case it displays:

$ diskutil list /dev/disk0

   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *111.8 Gi   disk0
   1:                        EFI                         200.0 Mi   disk0s1
   2:                  Apple_HFS Macintosh HD            79.9 Gi    disk0s2
   3:       Microsoft Basic Data                         3.0 Gi     disk0s3
   4:       Microsoft Basic Data NO NAME                 17.0 Gi    disk0s4
   5:                  Apple_HFS Build                   10.1 Gi    disk0s5
   6:                 Linux Swap                         1.3 Gi     disk0s6

Prior to adding the other partitions I had 2 main partitions, the main EFI and the Apple HFS partition.

Additional partitions can be created using diskutil resizeVolume.  The format of the command is sudo diskutil resizeVolume (target partition) size "Format" "Name of New Partition" NewSize "Format" "Name of New Partition2" newSize2 etc.. 

For example:

sudo diskutil resizeVolume disk0s2 50G "MS-DOS FAT32" "Haiku" 5G "MS-DOS FAT32" "Windows" 30G 

Would add 2 additional partitions: Haiku (5 Gig) and Windows (30 Gig) in that order.   BFS and EXT2/3 are obviously not supported by Apple, so setting up a FAT32 partition and then changing the partition to BFS by copying an image is the easiest way to proceed.  Attaching an additional build partition can be done by specifying HFS+ and then ensuring it is case-sensitive by using Utilities->Disk Utility.

Partitioning to Build the Source 

The first necessary step in compiling the Haiku source on the Mac is to setup the build 
environment. The Haiku source requires that you build from a case-sensitive partition.  This is 
necessary as several header files have similar, but different names, such as <String.h> and 
<string.h>.  You can achieve this setup by one of two main setups:

1) Install MacOSX on a case-sensitive HFS partition by selecting this in the partition setup.

2) Setup an additional partition  on your drive, define it as case-sensitive, and build from there. 

Option 1 is the easiest way to integrate the build environment  into your pre-existing Mac development tree, but Option 2 is probably the easiest way to go without installing MacOSX over again.

By using the diskutil command as described above you can easily accomplish this and have your case-sensitive partition ready to go.

The XCode tools located on your Leopard DVD must then be installed on your system. 

Installing MacPorts

The next step is to install several ported unix utilities found as part of the Macports project. Macports can be found here and installed from the disk image.  

Following the installation it is then necessary to install several ports via the command line.

'sudo port install expat gawk gettext libiconv and gnuregex' will do the trick. 

The next step is checking out the source as detailed in other related posts 

The build setup is then roughly identical to linux, except GCC4 must be used.  The current makebootable found in the SVN will currently not allow you to build to a partition from linux. Building to a file or vmware image should now be successful.

The next blog post will overview how to build to a partition using a modified makebootable, and running Haiku on the Macbook.

Please email me (chrisjp) with any questions, comments, errors, or omissions. 




Reddit!Del.icio.us!Facebook!Slashdot!Netscape!Technorati!StumbleUpon!Newsvine!Furl!Yahoo!Ma.gnolia!Free social bookmarking plugins and extensions for Joomla! websites!
Hits: 826
Comments (3)add comment

axeld said:

I hope you noticed that Haiku already has some preliminary support for EFI GPT partions - I could only test it with an image I got, and there is no official UUID for BFS partitions, but other than that, it should work.
 
report abuse
vote down
vote up
May 26, 2008
Votes: +0

zenja said:

I used VM Fusion to install Haiku to my MBP. The first step is to use Bootcamp to prepare a parition for Windows, but without actually installing windows. VM Fusion allows mounting of a physical partition, so the VMX configuration file would list ide0:0 as a Haiku image file, and ide0:1 as the physical partition. Once you boot into Haiku/BeOS/Zeta, use Disk Setup to initialise the physical partition to BFS format, and then copy all the files from Haiku drive to the newly formatted BFS physical partition.

Reboot, hold down the OPTION key, and select the Haiku partition, and Haiku will start booting. The boot process will fail at the 4th icon (mounting disks), probably due to lack of native SATA drivers in Haiku. From here you can either join in the coding effort and write a ICH8/9 SATA driver, or sponser a Haiku developer to write a driver.
 
report abuse
vote down
vote up
June 09, 2008
Votes: +0

chrisjp said:

Fortunately rewriting an entire ICH8/9 sata driver isn't necessary. The problem with the hard drive loading lies within the vendor ID reported by the macbook (and I presume the macbook pro?). Marcus had some code previously that would force the reported driver to SATA mode, but I don't believe that is currently enabled in the tree.

Aside from that, fairly serious interrupt problems exist with the macbook setup, that may also be present in the macbook pro.
 
report abuse
vote down
vote up
June 09, 2008
Votes: +0

Write comment
You must be logged in to a comment. Please register if you do not have an account yet.

busy
 

Login

File Search

Search For: 
File Titles: 
File Description: 

Most Popular Files

Jul.22
Downloads
File iconSenryu Personal Edition Vmware Image - Weekly
5398
Jul.22
Downloads
File iconSenryu Virtual Box Edition
847
May.21
Downloads
File iconOpera
824
Jul.09
Downloads
File iconAbiWord
810
Jun.27
Downloads
File iconSenryu Developer Edition Vmware Image
641
Jul.08
Downloads
File iconBeOS 5 PE Max Edition
326
Aug.15
Downloads
File iconICH AC97 Driver
306
Aug.24
Downloads
File iconAti Radeon Graphics Driver
278
Apr.25
Downloads
File iconSenryu Qemu Edition
229
Jun.06
Downloads
File iconHaikuPC-Info
218
Apr.17
Downloads
File iconNiue
164
Oct.28
Downloads
File iconHaikuLiveCDScript
157
May.21
Downloads
File iconLinks
152
Oct.04
Downloads
File iconHaiku Radeon Driver
145
Jun.06
Downloads
File iconJammin
106
Sep.15
Downloads
File iconBeFar
96
Sep.15
Downloads
File iconAural Illusion
96
Apr.25
Downloads
File iconSenryu Parallels Edition
90

Who's Online

Guests: 6
Members: 1
Hits Today: 289
Hits Yesterday: 626
Hits Total: 150338
Since: 2007-07-25