Howto: Dual Boot BeOS [Unfinished]

Write tutorials here
There are more tutorials here
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
User avatar
Level 6
Level 6
Posts: 1052
Joined: Fri Feb 16, 2007 2:26 am

Howto: Dual Boot BeOS [Unfinished]

Postby grimdestripador » Sun Feb 08, 2009 6:20 pm

In the new light of a new BeOS GCC4 compiler I wish to doccument my process making my current Quad core Mint Box dual boot with linux and the open sourced BeOS named Haiku-os. Image

Prepare Files
Download the alpha cycle dev release with Gcc4. Select a Raw HDD image. The URL I used was this zip file

DD & Bootloader
These Steps are based on Read makebootable - What and why and how to do it manually from's website and comments thereafter

The Stage 1 Bootloader
This can be accomplished using the following script.

Code: Select all

 * Tiny version of Haiku's makebootable for Linux
 * Copyright 2008, Stefan Schramm,
 * Distributed under the terms of the MIT license.
 * Changelog:
 * 2008-12-08: replaced example "hda4" with "hdaX" for safety
 * Compiling: gcc makebootabletiny.c -o makebootabletiny

#include <stdio.h>
#include <fcntl.h>
#include <linux/hdreg.h>

static const int partitionOffsetOffset = 506;

int main(int argc, const char *const *argv) {

   // check argument count
   if (argc < 2) {
      printf("Usage: %s <partition>\n", argv[0]);
      printf("Example: %s /dev/hdaX\n", argv[0]);
      return 1;

   // open handle to partition
   int part = open(argv[1], O_RDWR);
   if (part < 0) {
      fprintf(stderr, "Error: Failed to open partition %s\n", argv[1]);
      return 1;

   // get geometry
   struct hd_geometry geom;
   if (ioctl(part, HDIO_GETGEO, &geom) < 0) {
      fprintf(stderr, "Error: Failed to get device geometry\n");
      return 1;

   // display geometry
   printf("determined partition start (sectors): 0x%x\n", geom.start);

   // go to partition offset offset and read current configuration
   lseek(part, partitionOffsetOffset, 0);
   long buf = 0;
   read(part, &buf, 4);
   printf("old bootcode configuration:           0x%x\n", buf);

   if (buf == geom.start) {
      printf("bootcode already configured correctly - exiting.\n");
      return 0;

   // write partition offset
   lseek(part, partitionOffsetOffset, 0);
   write(part, &geom.start, 4);

   printf("bootcode configured - exiting.\n");
   return 0;


Return to “Tutorials”

Who is online

Users browsing this forum: No registered users and 3 guests