How To Get Haiku Booted

Article contributed by mmlr on Thu, 2008-08-07 16:47

This article is intended to explain in a nutshell how booting works in general, what the Haiku counterparts of standard boot process elements are and how to get everything together for a working boot in case this is not done automatically. These are things you will encounter installing/booting most operating systems, so it's not entirely Haiku specific.

1. The Basic Boot Process

1.1 The BIOS

When you turn on a BIOS based (as opposed to firmware based) system, which is still the most common today, the first thing loaded will be the BIOS (Basic Input Output System). It is like a small operating system of its own and has the purpose of configuring the system hardware and provide an environment that a more high level operating system can work with. For example it configures PCI devices, harddrive controllers, USB, the processor itself and sets up ACPI tables in main memory. Current BIOSes are quite a bit more advanced than they were in the past, commonly having support for USB keyboards and USB mass storage to allow operating in so called legacy free configurations (i.e. without the old PS/2 input and maybe without some of the more traditional PC architecture components). OK, not going into more detail as that's not essential here.

So when the BIOS has done its job, it will try to find a Master Boot Record (MBR) on any of the harddisk-like medias or other boot method specific block on other media (El-Torito on CDs/DVDs for example). Something like a USB memory stick is regarded as being harddisk-like, because it really is emulating a SCSI harddisk to the system. When it finds a boot record, it then loads that into memory and instructs the CPU to start execution of the instructions present.

1.2 The Master Boot Record

Generally this is just the first block of any harddisk-like medium, usually 512 bytes in length. It contains boot code in the first part and the partition table at the end of the block. What you have there as boot code depends on what boot manager you have installed. You have either installed a boot manager explicitly, for example GRUB or the BeOS boot manager, or it was implicitly installed for you when partitioning the device (during Windows setup for example). Boot managers range from totally simple ones that are just enough to find the partition marked active and jump to the partition boot code of said partition, to almost complete operating systems with editing capabilities and other fancy features.

1.3 The Partition Boot Record

Additionally to the Master Boot Record, there can also be a partition boot record. It's located at the start of a partition and contains further boot code. Depending on the boot manager you are using and how you configured it, this boot code will be executed or not. In the case of Haiku the partition boot code does locate the "/boot/beos/system/zbeos" file which then starts the operating system boot process. Additionally it contains the partition offset needed to access this partition during boot. A wrong value for that offset is probably one of the most common reason why a Haiku installation doesn't start to boot.

As mentioned, whether or not the partition boot code is used depends on the boot manager and boot manager configuration. If you take GRUB installed as boot manager in the MBR and booting Linux. GRUB knows how to handle most Linux filesystems and it does know how to load and start a Linux kernel off of it. Therefore it can directly load Linux without the need for any additional boot code. However GRUB does neither know how to handle BFS and find the zbeos boot loader, nor would it really know how to execute it. Therefore you cannot use GRUB to directly boot Haiku. Instead you need to chainload the partition boot code of the BFS partition, as it knows how to handle both the BFS and zbeos.

1.4 The Boot Loader

After the boot loader (zbeos in case of BeOS/Haiku) has been found and loaded into memory, it is executed. The boot loader is the one providing you with the Haiku boot menu when pressing the space bar in early boot and is the one detecting basic system configuration. It also contains the logic to find and load the kernel (kernel_intel on BeOS and kernel_x86 on Haiku) as well as some boot modules required. Boot modules include the bus managers, bus and device drivers required by the kernel to successfully access the boot volume to load the rest of the modules and execute anything it needs to fully boot the system. If you boot to an ATA harddisk it would require for example the IDE or ATA bus manager, the harddisk controller driver and the helper modules used by them. Booting from USB would require the USB bus manager, the host controller drivers and the usb_disk driver for example. The boot loader also provides the kernel with configuration information and info about initial memory layout for example. This data passing between the boot loader and the kernel is specific to Haiku and the Haiku revision, it is possible that the information passed changes from one revision to another. This also makes it obvious that a zbeos from a BeOS installation cannot work with a Haiku kernel. Likewise using a BeOS bootfloppy that provides such a zbeos is not going to boot Haiku.

1.5 The Kernel

Once the kernel is loaded and starts executing it sets up a working environment. Memory management, bootstrapping and configuring non-boot CPUs, timers, interrupts, filesystems, module infrastructure, drivers... Everything that is needed for a fully working system and has not yet been loaded. Once this environment is set up, the kernel will start the bootscript, that then launches the different servers to provide a usable userland.

2. Installing Haiku

If you intend to put Haiku onto a dedicated partition on your normal harddisk, you have several options to do so depending on your host operating system and wehther or not you intend to use a pre-built image or build from source.

2.1 Building from Source

Building from source generally has the advantage that you can do modifications, include optional packages and that making everything bootable is mostly taken care of automatically. On the other hand it is of course quite a bit more time consuming and resource intensive.

See the Building Haiku on Ubuntu Linux article for more details if you're building from Linux. Building from Windows is described in this tutorial, note though that under Windows you can currently only build images and not install directly to a partition. If you're building on BeOS see the tools section of of the getting started page and see this article on getting the source and building it.

2.2 Copying a Pre-Built Image

If you can't or don't want to go through building from source, you can also take an already built image. You can download those from Haiku-Files. Download a raw image, not a VMWare one. Note that these are test images, they are not complete distributions that include a lot of software, both to keep the size and complexity of building them down. Future releases will include a more complete set of software obviously.

When you've downloaded the raw image, you need to get this image to the partition or medium you intend to install it to. Under BeOS, Linux or basically everything except Windows you can use dd to just copy it over, using the partition or drive as a target.

# under BeOS to partition X on the master on the first channel
dd if=/path/to/image of=/dev/disk/ide/ata/0/master/X

# under BeOS to the raw slave on the first channel (overwriting the MBR)
dd if=/path/to/image of=/dev/disk/ide/ata/0/master/raw

# under Linux to partition X on the first harddisk
dd if=/path/to/image of=/dev/hdaX

# under Linux to the raw second SCSI disk (could be a USB drive)
dd if=/path/to/image of=/dev/sdb

Make extra sure that you have the right partition picked there, as these commands are destructive. Recheck with a partitioning tool to verify for example. Note that you'll probably need administrative rights under Linux, so use sudo or su to execute these commands.

If you want to put the image at the absolute start of the drive (so that you don't need an additional boot manager), make sure that you write to the whole raw drive and not to a partition. You do that by specifying a raw device instead of a partition. Under Linux you would for example omit the partition number resulting in "sdb" instead of "sdb1". Under BeOS you would pick the ".../raw" path instead of one with a number. If you use such a command, you overwrite the MBR containing the partition table. This means, that all the partitions on that drive will become inaccessible (not only the first part of the drive). So be sure that you want to do such a destructive operation!

Under Windows things are sadly a bit more complicated. You can try dd for Windows or use a tool like flashnul to get the image to a partition or USB drive. You should find the tools on the Internet, see this forum post about how to use flashnul to copy a Haiku image to a USB flash drive.

Note that when you just copy over an image to a partition or drive, you won't be able to use the full size of the target partition/drive. The image was built with a certain size (256MB currently) which is the size of the filesystem inside the image. So there's no real point in making a 10GB partition available for it, it won't be usable.

2.3 Copying the Contents of a Pre-Built Image

Instead of copying the image itself you can also make a separate BFS partition yourself and then copy over the contents of the image to that partition. You will need a platform supporting BFS to do that obviously, which leaves you with two possible options. Either you use a version of BeOS to do the setup with DriveSetup or mkbfs or you use Haiku itself with the Installer or DriveSetup. Once you've created and initialized the target partition you can mount the image (using tools like Mount Image or through the Terminal) and copy over all the files. If you are under Haiku, you can just as well use the Installer to make a duplicate of your currently booted installation.

3. Getting Bootable

Now that you have installed Haiku in some way or another there might remain steps to take to actually make this installation bootable. As you saw above, there are quite a few things involved when booting an OS. Some of the parts differ between OSes, not everyone might split boot loader and kernel, but essentially the steps are the same. Most of the things can and will be further automated when Haiku will be released, but others are more complicated and not within the power of Haiku.

3.1 Making the Partition Bootable

If you built from source directly to a partition the build system has most probably done the required steps to make the partition bootable automatically. If so you can skip this point and continue with configuring the boot manager below.

When you just create a plain partition and initialize it to a BFS filesystem or if you copy over a complete Haiku image, this doesn't necessarily make the partition bootable. The partition boot record may be missing, or the partition offset could be misconfigured. The prebuilt images for example contain a partition offset of 0 for example, since they are not actually partitioned. They only consist of a direct BFS filesystem, so the offset to that is 0. This will work in exactly one case, where you don't actually put it into a partition. If you for example copy such an image directly to a USB drive starting from 0, overwriting the MBR (destoying all partitions already there), then this will boot. If you however copy an image to the first partition on your harddisk, this will not work out of the box, as the boot code in the partition boot record won't find the desired filesystem at offset 0 (that's where the MBR still is).

To make sure a partition boot record is there and it contains the right partition offset, you can use the tool "makebootable". Makebootable will do both, write the partition boot code to the beginning of the partition and detect and write the partition offset to where it is needed. You can use the makebootable from BeOS if you have a BeOS installation that has access to the partition in question. To do that, mount the volume you have Haiku installed to and use:

makebootable /HaikuMountpoint

Where "/HaikuMountpoint" is where you have mounted your Haiku volume to. Note that the BeOS makebootable can be used, because the partition boot record does only load the zbeos boot loader. As Haiku does provide a zbeos as well and there is no information passed from the partition boot code to the boot loader, this is compatible between BeOS and Haiku and you can use a BeOS makebootable with a Haiku boot loader and the other way around.

If you already have some Haiku medium capable of booting Haiku (like a USB drive) you could also boot into Haiku and run makebootable from there. Note that there is currently a bug in makebootable that will require you to run it from the location it resides in like so:

cd /bin
makebootable /MountpointOfNewHaikuInstallation

If you are on Linux or another build platform that has support for makebootable and have the sources available you can run:

jam run ":<build>makebootable" /dev/sdaX

Where the "/dev/sdaX" is the partition that is supposed to be made bootable. Under Windows this is currently not possible.

3.2 Configuring the Boot Manager

When the partition itself is bootable, i.e. contains a partition boot record and the correct partition offset, there needs to be a way to get it executed. If you installed Haiku by copying an image to the complete beginning of a disk or USB drive, this will already be the case. There is no boot manager and no MBR at all, but straight the partition boot code, which should then work out of the box. So if you have it installed this way, go right ahead and boot.

If you use a boot manager like GRUB however, you need to instruct it to load from that partition. You do that for GRUB by adding an entry to its menu.lst usually located at "/boot/grub/menu.lst". The following would instruct it to switch to the partition and then just chainload the partition boot record:

title Haiku
rootnoverify (hd0,3)
chainloader +1

That would work if you installed to disk "0" and partition "3". Note that the GRUB naming is one-off the Linux one, so if you have it installed to "/dev/sda4" that would translate to disk "0" (sda == 0, sdb == 1, ...) and partition "3" (4 - 1).

In case you are using the BeOS boot manager, just re-run the "bootman" command and add the new Haiku partition to the boot menu.

If you have another boot manager consult its documentation on how to chainload partitions, most should support such a thing, possibly named a bit different. In doubt just add an entry for the partition, probably this will cause it to chainload, even if not explicitly named so.

4. Easy Installation through USB Drives

The above steps should get you going in most cases, but maybe sound a bit scary or involved. My personally recommended method that should work on most current hardware would be to make a dedicated USB drive like a USB memory stick to boot Haiku. To do that, you can take a relatively small USB drive that has enough space to fit the image onto. Then you just copy that image directly to the raw drive, not to a partition, replacing everything including the MBR, destroying all the partitions that were on there (see above as to tools to use). This is destructive and you can't use anything after the image size of that drive, but if you get some cheap small USB memory stick just for that purpose it's certainly one of the easiest ways to boot Haiku. Once you've booted Haiku you can also do an installation from there, initializing partitions with BFS using DriveSetup and using the Installer to do a proper installation. Note that you cannot currently create partitions under Haiku. Use your preferred partition tool to create a dedicated partition before booting Haiku. Note also that the Installer doesn't have a link in the Haiku menu, therefore just run it from the Terminal. If you additionally execute it from "/bin" this works around the makebootable problem, giving you the commands:

cd /bin
Installer

That should work and be pretty usable to boot devices that you have no other means to put Haiku onto otherwise. This works for example out of the box on the Asus EEE, but really should work for every USB bootable x86 machine. If it doesn't, please make sure that your issue is documented in a bug report at our bug tracker. We cannot fix it if we don't know that it's broken.

I hope this clears up some things. If nothing else this should get you a better starting point for troubleshooting if it indeed doesn't boot.

Comments

Re: How To Get Haiku Booted

I have taken the liberty of promoting this document to the front page for increased visibility. I hope you don't mind.

Re: How To Get Haiku Booted

I haven't read the entire article, but it appears to touch on most of the major points that are constantly asked about in #haiku and the forums :)

This is a great piece of documentation!

Thanks for putting the time and effort into writing it and publishing it on the website.

Re: How To Get Haiku Booted

That's mostly the reason for writing it. I'm reading most of the IRC logs and some of the forums, so I know the common topics :-)

Re: How To Get Haiku Booted

wow thanks for this article!

i had quite a good understanding of the general bios stuff but no clue about beos
and struggled a few times with haiku... will try it again soon :)

oh btw is there somewhere an explanation of the actual boot record? i might try playing with c or java to get some sort of a makeboot clone for win (even i doubt i will manage to do this with my rusty programming skills :-D )

thanks to all of you haiku folks!

Re: How To Get Haiku Booted

I formatted a 512Mb USB stick in Vista x64, then used flashnul, and then tried to boot it on my Intel DG33BU motherboard. When the USB was formatted (w/ system) using Win98's install diskette, it booted fine. But Haiku won't. I made sure that USB boot was enabled and that the 512Mb USB was the first thing on the boot list. All I get is an endless blinking cursor in the upper left corner.

If I try to boot via IDE HD, I get the Haiku boot splash screen and the icons go half way. But USB does nothing but "blink" the cursor at me.

What am I doing wrong and/or why is it not working for me?

Re: How To Get Haiku Booted

Thanks for the article. This and all the alpha talk finally got me to try building and installing Haiku. After some trouble I managed to run it and it looks nice. But having some trouble leads me to my question: Is there some article on finding out what went wrong and how to report it?
For example after I got it boot Haiku used some strange resolution, that my monitor couldn't handle. Safe mode resolution worked, but how do I find what resolution was used? Is there some log written on boot? And how should I report it?

Luposian: I have Intel board (a different one - DQ965GF) too and I couldn't get Haiku to boot until I set SATA mode to RAID. Even though you are using IDE it's still worth trying. Had no luck with USB yet too, though.

Re: How To Get Haiku Booted

diego18ch: The makebootable program is quite easy to understand. I've rewritten a part of it for Linux to let it compile standalone without all the libraries: http://stefanschramm.net/dev/makebootabletiny/makebootabletiny.c
It reads out the offset of the specified partition and writes it into the bootrecord of this partition at a defined offset (506).

Re: How To Get Haiku Booted

Luposian wrote:

I formatted a 512Mb USB stick in Vista x64, then used flashnul, and then tried to boot it on my Intel DG33BU motherboard. When the USB was formatted (w/ system) using Win98's install diskette, it booted fine. But Haiku won't. I made sure that USB boot was enabled and that the 512Mb USB was the first thing on the boot list. All I get is an endless blinking cursor in the upper left corner.

You don't need to format or partition the USB stick. You need to essentially destroy the partition map and filesystem that is there already. If you have partitions on that device, then the offset won't be 0 and you have to install a boot manager to the MBR and use makebootable to install a partition boot record with the correct offset - that's not what you want. When you use flashnul to copy the image you should copy it to the whole physical device, not a single partition of it. If you do so, the partitions should get overwritten.

If flashnul is not working for you, you could also try using dd for windows. Search for "dd for windows" and you'll find it. You should use "dd --list" to list the available devices and then use something like "dd if=haiku.image of=\\?\HarddiskX\Partition0" where X is the disk that represents your USB drive. The "Partition0" part is a bit misleading, but partition 0 really means the entire disk.

Re: How To Get Haiku Booted

Thanks for this nice howto!

From Ubuntu, I successfully put a Haiku raw image via

dd if=/haiku.image.r26666 of=/dev/sdb1

onto an usb stick.

After telling the BIOS to boot from USB, I get the error "No bootable partition in table".
I reverted the BIOS setting and added an item to grub, as suggested in the article. Since the usb stick is /dev/sb1, the grub line reads

rootnoverify (hd1,0)

Now I get a "Failed to load OS."
Any idea where I go wrong?

Thanks
Humdinger

--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=-=--=--

Deutsche Haiku News @ http://haiku-gazette.blogspot.com

Re: How To Get Haiku Booted

Humdinger wrote:

dd if=/haiku.image.r26666 of=/dev/sdb1

That's not exactly writing it to the whole USB drive. Using "sdb1" means "scsi" (transparent SCSI over USB in that case) "disk b", "partition 1". With that you write the image to the first partition on that drive, not the entire drive. If you want to do what is stated in point 4 above, you would instead write to the whole drive by using "/dev/sdb" (without any number). Will make this more clear in the article. Note that this will overwrite the partition table and destroy all the other data on that USB drive (it will become inaccessible).

If you intentionally put it on the first partition (because you want to keep other partitions on there for example), you need to get the MBR of that drive bootable. You can do that by installing a boot manager onto that device. GRUB or the BeOS boot manager for example.

Humdinger wrote:

I reverted the BIOS setting and added an item to grub, as suggested in the article. Since the usb stick is /dev/sb1, the grub line reads

rootnoverify (hd1,0)

Now I get a "Failed to load OS."
Any idea where I go wrong?

That's probably because it's a USB device. It is probably enumerated differently than under Linux, getting a different number. Maybe GRUB doesn't find it at all. You could try the edit option in GRUB to change that line to "rootnoverify (" and then hit tab for tab completion so you see what disks are available from a GRUB standpoint of view.

Re: How To Get Haiku Booted

Hi all,

I tried installing the raw haiku image in windows with flashnul (flashnul 1 -L haiku.img) but it gave me "Failed to load OS".

I also tried from linux with dd and it didn't boot also.

Since I've read somewhere that some BIOS and even some USB pens could be unable to boot, then i decided to install and boot puppy linux on the same pen and PC and everything ran fine, although the installation method was quite different since I've booted a live CD and ran an installer.

Any extra suggestions you could have you'd be very appreciated.

Re: How To Get Haiku Booted

Hey, that actually did the trick! Doing dd with sdb instead of sdb1, and the Haiku bootloader appears. Thanks Michael!
Now I only have to figure out why it all ends with a black screen after the last icon lit up. I'll do more boot options testing tomorrow.

Regards
Babystepping Humdinger

Could not mount boot device

Hi all,

I flashnul'ed my 256 MB Kingston key with revision 26922.
Either on my Dell D620 Laptop or on the Fujitsu-Siemens S7020 I receive a "Could not mount boot device" in a pretty Kernel Panic :-).

I got a serial debug output for the Dell one (not on Fujitsu because no built-in serial port...) and I can open a Trac ticket if necessary.

Did I got something wrong ? Shoud I open a ticket ?

Regards,

Emmanuel

Re: How To Get Haiku Booted

Hello!

Can anybody make available the makebootable binary for linux (32bits)??

Simply dd'ing didn't work for my usb pen, and I want to try it with makebootable to see if it makes any difference.

Regards
PedroEloy

Re: How To Get Haiku Booted

Make sure: you should be dd'ing it to the entire device, not just the first partition.

Makebootable should have no additional affect as long as you're doing that.

Re: How To Get Haiku Booted

Thanks, but I'm doing it to the disk for sure and tried both from windows (with flashnul 1 -L haiku.img) and with linux (with something like dd ... of=/dev/sdb)

For the record I can boot puppy linux on the same PC and pen.

So makebootable is my last hope!

Regards

Re: How To Get Haiku Booted

The image currently is 250MB size. Which is too big to fit on 256MB USB drive.

Michael has requested for the image to be decreased to 230MB size. This way it should fit/work on 256MB USB key / memory stick.

This could be the reason why it isn't working for some of you? ( if you're using 256MB media - otherwise can't say why )

If you dd the image to the entire drive ( ie: sda, sdb, sdc ) then it should boot without having to use makebootable. You'll be limited to the size of the image - ie: 250MB.

Re: How To Get Haiku Booted

FWIW, my USB stick with Haiku on it doesn't boot on all machines either - only a few that I have here.

I'm not sure why, I haven't explored it enough.

Re: How To Get Haiku Booted

Hi Everyone

I have a 2GB Transcend pen drive. I downloaded haiku.image.r26970.bz2 image, bunzipped it, and then wrote the same to my pen drive using following command

dd if=haiku.image.r26970 of=/dev/sdc.

Then I rebooted and pressed F8 to bring up the bios boot menu and chose to boot my pen drive from there. I could see the haiku logo and colouring icons but then it suddendly brought up kernel debugging prompt saying can't find partition to boot.

Please help.

Thanks and regards.

Re: How To Get Haiku Booted

Here's my latest situation: I have Haiku running great on an AMD Athlon64 Sempron rig (booted off an IDE hard drive). Haiku saw the 120Gb SATA drive I had attached, so I used DriveSetup and initialized it for BFS. Then I ran Installer and that copied all the files over in a few seconds. Then I ran bootman.

In the end, when I reboot, I get the boot menu and it tried to start Haiku.

It says "Starting Haiku..." but then it says it can't boot because it's not a startup disk or something. I hit Return and it says not a bootable drive. I hit Return again and we're back to the boot menu again... and the whole process starts over.

Apparently Haiku has all the programs I need to make the SATA drive bootable, but what do I need to type in the Terminal to do that? The SATA drive, right now, is labelled "no name". It has Haiku on it, but I can't boot from that disk, for some reason.

HELP!

Re: How To Get Haiku Booted

Make sure you run Installer from the /bin directory in Terminal - otherwise the makebootable part may fail.

Re: How To Get Haiku Booted

So I can't just run Installer from the /beos/apps directory, by double-clicking on the application itself?

Maybe you could give me a step-by-step guide, for getting Haiku on (and bootable from) the SATA drive, from WITHIN Haiku (which is what I'm trying to do, except it's not working), since BeOS R5 (obviously) won't run on an AMD Athlon64 system. :-) You can send the instructions directly to me via Email, if that would be easier for you. ;-)

Re: How To Get Haiku Booted

Why? the instructions are right here in this article - see section 4 where it tells you to cd /bin and run Installer.

I certainly don't have time to create custom install instructions for your particular scenario...

Re: How To Get Haiku Booted

When you say "...the makebootable part may fail." (if I don't run Installer from /bin (via the Terminal)), do you mean that Installer won't DO the makebootable part (I didn't know that was part of it's job) or that when I run "makebootable", it won't work?

Re: How To Get Haiku Booted

I'm just repeating what's in the article :)

I haven't actually tried using the installer yet to put haiku on another partition - instead I have only compiled Haiku onto another partition from within Haiku using the "install-haiku" jam target.

I know people have done it successfully, however.

Re: How To Get Haiku Booted

Ok, this is what I did... I booted Haiku off the IDE drive. I typed cd /bin in the Terminal. I typed "DriveSetup" and I initialized the connected 120Gb SATA drive as "drive" with a block size of 2048 bytes (Recommended). I quit DriveSetup. I then typed Installer. It installed everything to the SATA drive, and said something about it being made bootable with an offset of 32xxx bytes (I don't remember the exact number). I quit Installer. I then typed Makebootable. It did the same thing that Installer did at the very end (same boot sector byte offset whatever of 32xxx bytes). I then ran Bootman.

When all was said and done, I shut down, unplugged the IDE drive, and restarted.

All I get is "Starting drive" ("drive" is the name of the Haiku partition) and a blinking cursor beneath it.

Why is Haiku perfectly bootable off an IDE drive, but completely unbootable via a SATA drive?

Anyone know?

Someone, in another thread, said something about running Makebootable and specifying the exact drive path... (not just the mount point) of the RAW drive, not the formatted partition, and it actually WORKED! Anyone able to confirm/explain this?

Re: How To Get Haiku Booted

Luposian wrote:

I then typed Installer. It installed everything to the SATA drive, and said something about it being made bootable with an offset of 32xxx bytes (I don't remember the exact number). I quit Installer. I then typed Makebootable. It did the same thing that Installer did at the very end (same boot sector byte offset whatever of 32xxx bytes).

It's not necessary to run makebootable again. The Installer is doing that as part of the installation process. That's why you have to run it from /bin after all, because makebootable currently has a problem finding its binary otherwise (though these problems should be fixed as of r26987).

Luposian wrote:

I then ran Bootman.

When all was said and done, I shut down, unplugged the IDE drive, and restarted.

All I get is "Starting drive" ("drive" is the name of the Haiku partition) and a blinking cursor beneath it.

Why is Haiku perfectly bootable off an IDE drive, but completely unbootable via a SATA drive?

Anyone know?

If you read the article and think about what happens when you use bootman it should be obvious why this doesn't work. What does bootman do? It installs a boot manager. How does it do that? It writes boot code into the MBR. What MBR? The MBR of the current boot drive! If you boot from the IDE drive then that is your boot drive! So the boot manager is installed to the IDE drive. If you unplug it then it cannot work anymore, because you unplugged the drive where your boot manager was installed to. As far as I know there is currently no way to install the boot manager to another drive than the boot drive. Also if you look at the bootman wizard, it will probably not even show you the partition on the other drive. Generally I think the boot manager is not heavily tested, so you're probably better off using a different one.

You could for example use a Linux live CD or some such to install GRUB to the MBR of the SATA disk instead. Other than that you could also use a hex editor to copy over the needed blocks and hand edit the menu, but that's not really what you'd want to do.

Luposian wrote:

Someone, in another thread, said something about running Makebootable and specifying the exact drive path... (not just the mount point) of the RAW drive, not the formatted partition, and it actually WORKED! Anyone able to confirm/explain this?

No that cannot work. There is one exact case where this might work, and that is (as described in the article) that you don't actually have a partition table, but just a filesystem image directly at offset 0. Then makebootable on the raw device is the same as it would otherwise be for a partition. But if you have a partitioned drive, it cannot work installing the partition boot code to the MBR of a drive.

Regards
Michael

Re: How To Get Haiku Booted

mmlr wrote:

(though these problems should be fixed as of r26987).

Well, not quite yet :(

I was helping Rene test that last night and it screws up the 2nd block when it to runs from the Installer now, but seems to work fine if you run makebootable by itself (from any directory).

Hopefully that will get fixed soon, maybe today ;)

Re: How To Get Haiku Booted

When I run Bootman, the drive it sees is NOT the boot drive, but the SATA drive. The ONLY option is "drive" (or whatever I named the SATA disk when I Initialized it) as far as menu choices. I found this rather strange, as this did not happen the very first time I tried Bootman a day or two earlier. The only drive menu choices it found, then, were "BeOS" and "Haiku" (which are on my IDE drive).

This is using the exact same revision of Haiku, too. So, what changed?

It's apparently writing (backing up) the MBR to the main drive (/boot/home...), but if it's writing the boot manager to the SATA drive (as evidenced by the boot menu when the SATA drive is the only drive I'm starting up from), then why is it not booting, when it times out in 5 seconds or I hit Enter?

Is it writing the boot code to the IDE drive and the boot menu to the SATA drive? Can I direct it where it should be writing stuff, so that it puts BOTH onto the SATA drive, so the thing actually starts up from the SATA drive? :-)

This is quite an adventure, I must say. Onward to the fray!

Re: How To Get Haiku Booted

Haiku works like a charm on my Athlon 64 X2 3600+ machine, booting off a USB drive. Everything works out of the box except for my wireless (expected, Linux only supports it through a Windows wrapper) and sound, which I'm sure OSS will have no problem with.

The only other problem is it boots into 1024x800 instead of 1440x900, but 1440x900 is listed in the Screen preflet and with a simple click works beautifully. This really surprised me as this monitor/video card combination has always required a frustrating amount of tweaking in Linux.

Boot time is reasonably fast, the desktop is snappy and overall seems stable enough, especially when compared to the last revision I tried.

Bravo to the Haiku team and roll on the alpha! Although I realise this isn't going to be a huge priority, a little visual polish prior to the alpha; HVIF icons where they're missing (Tracker navigational mode, Mail), a couple of nice backgrounds rather than a Win95-ish solid colour and those mysterious dots under the Home icon on the desktop disappearing would help Haiku make the best possible first impression.

Re: How To Get Haiku Booted

Ok, I got it working... on my SATA drive, no less!

Except my 120Gb drive is now a 250Mb drive. What a tradeoff, huh? It works, but I lost all my diskspace.

Ok, what I did was dd to the entire drive (/dev/disk/ata/2/master/raw)

No Installer, makebootable, or bootman required. It works, but... was it worth it?

Now I just have to figure how to get the image installed to the drive while MAINTAINING my diskspace.

Aye, thar's the rub, matey!

... and onward to the fray!

Re: How To Get Haiku Booted

Luposian,

I was also thinking that you try to "dd" the image and see if that works off the SATA.

Glad you're using the entire drive, 1 partition - makes things simple.

You can try this out ( Running Haiku off PATA )
1) Download Haiku image
2) Run DriveSetup or "mkbfs" to create BFS filesystem on SATA
3) Mount your SATA drive
4) Use "mount" to mount haiku image to a mount point ( create haiku-image folder in home and mount to that )
5) copy, either with "cp" or tracker, the files from the mounted haiku-image to your SATA drive.
6) Reboot

If above does not work then try with this instead:
6) Boot Haiku off PATA
7) Mount SATA drive
8) On PATA, cd /bin
9) Run "makebootable" ( this might be where you're having issues because you must choose the correct volume; ie: you might be running makebootable PATA ( instead of SATA ) - be sure to specify the correct mounted SATA volume or use makebootable /dev/disk/ata/... to be sure ).
10) Reboot

The 2nd method should get Haiku working for you though the 1st may work also.

Re: How To Get Haiku Booted

In the revision of Haiku I've been using (r2695x, I believe), I tried to "mount" the same haiku.image (in Terminal) and it never worked. Until I put it in the /boot/home folder. Then, it worked... for all of about 1 second before KDL'ing the system. Something like a file cabinet appears on the desktop and then Haiku KDL's. I tried this 2 or 3 times with the exact same result. So I'm assuming it's a problem with the revision of Haiku I was using.

I can't, obviously, use BeOS R5 on Athlonica64; (my Athlon64 Sempron system), so I need to get a revision of Haiku on the PATA drive first, that will allow me to "mount" a haiku.image file first, on Athlonica (my Athlon XP 2000+ system), before I try running Haiku off the PATA, on Athlonica64, to try and "mount" a haiku.image file and copy it's contents onto the SATA drive.

So I'm going to try "mount", using r26999, which I just downloaded last night, once I've JAM'd it. Unless a pre-built copy exists here already. Will have to check.

Re: How To Get Haiku Booted

Quote:

I can't, obviously, use BeOS R5 on Athlonica64; (my Athlon64 Sempron system)

Really? There are documented ways and tools to patch your kernel in order to do this. BeOS Max v4b1 already comes with a patched kernel on the boot CD.

But, before you ask, I don't have time to send you explicit instructions - I bet google can help you with that :)

Re: How To Get Haiku Booted

If BeOS Max v4b1 is easily downloadable and I can burn it to CD, then I shall give it a try. Given that I installed Ubuntu Gutsy Gibbon onto Athlonica64 last night (had to restore the SATA drive to 120Gb normalcy somehow and that was the easiest method I could think of), I can use UGG (Ubuntu Gusty Gibbon) to download the file and burn it to CD-R and go from there.

The question I have is... are there any SATA drivers for BeOS, even BeOS Max v4b1? If not, then I have to do everything in two stages... but... at least I'll have a more modern system to do it in. :-)

Re: How To Get Haiku Booted

Quote:

So I'm going to try "mount", using r26999, which I just downloaded last night, once I've JAM'd it. Unless a pre-built copy exists here already. Will have to check.

If you're building Haiku, from source, then there is an easier way to install it to a partition and get it to work.

Follow this thread:
http://www.haiku-os.org/documents/dev/installing_haiku_to_a_partition_fr...

PS BeOS MAX4 has no SATA. Only Haiku has SATA support.

Re: How To Get Haiku Booted

This related in general to USB Drive booting of Haiku. I've use the flashnul option on a Cruzer Mini 256 (very old, had for many years) with my Windows system. After which I rebooted and set my bios to boot from USB. That's it. I'd of course like to note, that yes it does seem impossible to put a 250mb image on a 256 drive when you only end up with like 249 after formatting, but it works. Haiku will not use all the space, rather after booting the leftover MB(s) is accessible to you. The boot time was not as speedy as I thought it should be, but I just chalked that up to the fact that the USB drive is not USB 2.0. I haven't gotten into testing alot of the features, but have had no problem following the most simplest of the steps.

BTW I'm running an AMD Athlon 3200 (939 chip), at the time (which was a few months ago) was only running 512mb RAM, I have a Gigabyte MB, that allows booting from just about anything that can store information given it has an OS.

Re: How To Get Haiku Booted

Just wanted you to know that haiku boots successfully from a USB pendrive on a Asus EeePc 901... Evviva!

Re: How To Get Haiku Booted

I am running Haiku R28350 on native hardware (Jetway V266B). It runs great. However, I want to be able to download the Haiku source tree and JAM Haiku from within Haiku. I have tried various things, to no avail.

I can't even JAM Haiku from within BeOS R5 PE (WIND distro) anymore. I download the latest sources from svn. But when I try to run "configure" (using the cross-platform bone version GCC, which used to work up til now), I get an error message telling me I need the latest version of GCC... some version numbered 081024. Couldn't find it on BeBits. And not anywhere here on Haiku-os.org. It was over at HaikuWare.

But, oddly enough, I try to install it to /boot (where I installed the prior version (which now gives me the error message)) and it refuses to (the unzip process says it can't continue).

Building Haiku from *within* Haiku would be the ideal thing, but if I can get BeOS to build Haiku again, I'll be plenty happy as well.

Advice based around those using emulators or Linux or other routes of building Haiku are not desired. I want to know what I need to do, to build Haiku from within Haiku (or from BeOS, as before).

I need to know exact locations (web sites), filenames (of the programs), and placement (where I install the files to). I suspect something is no longer acceptable about the way I'm doing it now. And it must be on native hardware, running BeOS R5 PE or Haiku R28350 or greater.

Thank you.

Re: How To Get Haiku Booted

Luposian, check this thread: http://www.freelists.org/archives/haiku-development/10-2008/msg00490.html
I think it sounds similar to your problem.

Re: How To Get Haiku Booted

I've always used the method as described under 2.3, but this doesn't seem to work any more.
After copying the contents from the mounted newer (pre-alpha) image onto/into the old Haiku install, the screen shows a message at boot talking of a OS boot failure. Strangely enough the size indicator already indicated something's wrong even before trying, as the size of the new Haiku install was shown as being less than 8MB.
The latest available plain vanilla build let's itself be installed nicely, though.

Re: How To Get Haiku Booted

I had this problem too.
Last working was the vanilla image.

There is no more zbeos, they changed something in the bootloader, now haikuloader.

You need to run the new makebootable to make the newer images work.
I copied the new makebootable from the new image to zeta and installed it there /boot/home/config/bin/ if I am not wrong then I ran makebootable from the terminal and made the Haiku partition bootable. Now it works again.

Maybe someone of the developer will be more clear about the change they made then me, sorry.

Read the post from Stephan:
http://www.haiku-os.org/blog/stippi/2008-10-21/coding_sprint_results

Re: How To Get Haiku Booted

Okay, thanks for the info. I always use BeOS to work from, but apparently the problem remains the same.
I'll just forget about keeping pace with Haiku until it's available on CD as R1.

Re: How To Get Haiku Booted

In my experience, when it said "boot failed" (or whatever), that's because the Offset was 0. In order for an image to go on a partition properly, it must have the proper offset. I've JAM'd many a Haiku and ended up with an offset of 0. And in ALL those cases, when I tried to JAM it to my Haiku partition, it failed to boot. When it actually HAS the proper offset, it works fine.

I have read that, with an offset of 0, you can "dd" the haiku.image to a USB thumb drive (anything slightly larger than the image itself, as the image makes the device conform to it's size, thus a 250Mb Haiku image would make a 1Gb USB thumb drive into a 250Mb USB thumb drive... until you reformat the USB thumb drive, that is) and it will work ok.

Hope this helps.

Re: How To Get Haiku Booted

Hi Meanwhile,

yes I would like to suggest you to just wait for the R1 CD. Looks like they are working hard on the installer now.

I finally got the new versions work on my computer here. I have 3 BeOs, Haiku, and another Haiku test-partitions here. After spending lot of time through try and error... it is not worth the hassle.

The after vanilla test images, Haiku-pre alpha, still looks and feel the same for us common user.
And I am a bit disappointed with it. The new version is running only on my P4 System (with the 3 partitions) without problems.

Re: How To Get Haiku Booted

I haven't been able to boot Haiku since about May. It looks like that's when they changed the directory structure. (no beos folder)

It would be nice if somebody explained the new procedure for booting Haiku.