Porting Drivers

Hi. I was wondering what the porting process is for drivers. I hope this isn’t annoying if discussed before, but I couldn’t find much about drivers in general. I currently use Haiku in virtualbox, but was going to install it on my 2012 Macbook pro (i5 2.5ghz). I was going to see what I could do about using the broadcom wireless drivers to get wireless working. I might also try installing on a 2010 mac mini, but will start with the laptop. Any tips?


I’m sure others will pipe in, but I do know that Broadcom chipsets seem to be unsupported.

Mostly unsupported, yes.

However, OpenBSD has a driver for the newer classes of WiFi hardware. I think you will still be out of luck for a 2010 Apple device, but much more recent hardware might be more in luck…

1 Like

there’s a few blog’s from devs on the main haiku page about drivers and wifi, most of it is old, Waddlesplash is the current fulltime contract dev and I’ve seen a lot of commits with his name and the bsd compatibility layer.

Hmm. Thanks. I managed to install Haiku fine. I can’t seem to get a dual boot solution. I know grub seems to be the official recommendation. Is there some boot camp method I can use? I would like to be able to hold down the option key, and select either Mac or Haiku. I tried manually adding the efi file to /efi/EFI/BOOT. If I bless that, will it remove the boot option for Mac?

Edit: I am using High Sierra on an APFS drive. I created a partition, formatted as FAT. Then I booted Haiku usb, formatted that partition BeFS. Then installed to it.

From whom??

I’d strongly advice against using grub(2).
If you want to dual boot on efi and have no graphical menu in your firmware rEFInd is a good choice to use.

1 Like

Here it mentions it, it also mentions it when it talks about booting when you install Haiku.

I don’t want to use grub however. I was hoping there was a way I can just have a startup option in Mac.

We should clarify that this page is for legacy BIOS. On a Mac system you are running EFI instead and so you should rather follow this: UEFI Booting Haiku | Haiku Project

You can use rEFInd as a boot manager to select the OS on a graphical screen with a nice icon for each.

1 Like

This is an help page and on most of GNU/linux distros grub(2) is installed. So the page has to explain how to deal with it but, it doesn’t make it a recommendation.
In fact, from what I’ve seen on the forum, in some cases (mostly on Apple hardware), rEFInd is the only solution.

Alright. I might try that if I can’t figure it out. It doesn’t sound ideal. I might also try manually doing things using boot camp and replacing windows files and boot information with Haiku. I’ll let you all know how it goes.

Well I managed to boot without rEFInd. I first installed a windows 10 boot camp (no license needed because I was getting rid of it anyway). Then I booted the Haiku thumb drive. Then I formatted the ntfs boot camp drive, and installed Haiku to it. Then I copied the loose files (Deskbar, haiku_loader.bios_ia32,
kernel_x86_64, runtime_loader, Tracker) from the booted usb drive to the Haiku install drive.

I think there was something else I copied from the usb to there Haiku partition, not sure if it was necessary though. (Something in data maybe). Anyone can let me know if they are stumped there. Then I could boot from the regular Mac boot select menu. It’s listed as “Windows”. Idk if it’s OSX doing that or if it’s something else.

EDIT: It was the platform loaders folder, in the data folder. I think I just copied the data folder over.

Copying files “loosely” is not the way to go, you should only ever need to copy the contents of the /system/packages directory.

I didn’t say I copied them loosely. I meant that I had copied the files that were not in folders: (Deskbar, haiku_loader.bios_ia32, kernel_x86_64, runtime_loader, Tracker). I know Tracker probably wasn’t relevant.
While it might not be the best way to do things, for a mac user, it might be preferable to do that as opposed to installing rEFInd. I am not entirely sure doing a boot camp windows install was needed to make this work. Next mac I install on I’ll try without, but I don’t want to fix what isn’t broke and have to reinstall. (Windows that is, Haiku installs so fast. :slight_smile:

On 2012 Macbook Pro (9,2), so far I still need to boot with the fail-safe graphics driver. So far no wi-fi, bluetooth, or sound. Touchpad behaves like a single button mouse basically. No way I can see yet to adjust brightness. Battery level displays correctly. Ethernet works. (That’s how I am able to type here now :slight_smile: )

What is the process for always using vesa graphics. In BeOS I modified a config file, but here I am not sure.

Yes, and you don’t need to, and moreover should not, modify any files /system except ones inside /system/packages and /system/settings. This is because all other files except those, including Tracker, Deskbar, the loader, the kernel, etc. are stored inside .hpkg files, which are then mounted during the boot process.

I imagine I needed to move one or two, but of the 8-10 I did move, I didn’t know which one did the trick. But for Haiku on a Mac, there is some file moving needed to make it bootable on a Mac. Although from the Mac side I imagine you can “bless” a file maybe.

Where are the actual loader and/or efi file needed to boot stored?

Thanks for the advice so far.

As developers, we tell you you don’t need to move or copy any of these files. So I don’t know what you did, but that’s not the part that got things working.

The only file that needs manual intervention currently is the EFI bootloader because we have not yet integrated that into the installation process. You can find it in /system/data/platform_loaders/haiku_loader.efi and it needs to be copied to the EFI system partition.

I did move the whole platforms loader folder into the same path on the OS drive, to make it match the USB installer drive. So the haiku_loader.efi was probably what got it working. I didn’t copy it to the EFI partition, but the Mac boot menu doesn’t put anything in the EFI for dual-boot. Thanks for the information, should make things smoother next Mac I try on.

I found some solutions to fixing sound and touchpad issues on a macbook pro 9,2. But for FreeBSD. Is there a way for me to use FreeBSD drivers, or to recompile them for Haiku?

No, not for touchpads. The only FreeBSD drivers we can use currently is for network devices.

But that “no” all depends on how much doe you’re ready to write to get it going, of course.

Can you link to the relevant FreeBSD info? (code, documentation, bug report on their side)?