Porting Drivers

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)?

first you need to write a driver for light pen for pc when for touchpads

https://wiki.freebsd.org/Laptops/Apple_MacBookPro9%2C2

I’m more concerned about sound than touchpad. But hopefully sometime I should get everything working. Is the process for the network drivers just rewriting them? Is there a good before/after I can look at for a done driver?

What is a driver for light pen?

No, the network drivers are imported with little to no changes. There is usally a compatibility wrapper file (usually called glue.c) to do the interfacing. You can see for yourself in src/add-ons/kernel/drivers/network and compare with the corresponding FreeBSD drivers.

But this can only work for network drivers I think. Not sure if anyone has tried it with something else.

Oh. Maybe this was answered elsewhere, but how to you view the drivers? Do you have to extract them?

If you mean in source form, the answer is no, you’ll need to clone the haiku source code to view them.

if you only want to view and compare you can go here.
network\drivers\kernel\add-ons\src - haiku - Haiku’s main repository (haiku-os.org)
Then go wlan for wifi and ether for cable connected, under the eatch driver we have dev folder where the freebsd files goes

Here you can see the drivers we have HardwareInfo – Haiku (haiku-os.org), I haven’t updated for a while (last time 2019). If you look at the network drives. say “attansic_l2 (ae)” the (ae) are the FreeBSD name for it. It’s a ethernet driver so will be under our ethernet.

here you have the freebsd drivers
freebsd-src/sys/dev at main · freebsd/freebsd-src (github.com)
and you can find the ae name here

2 Likes

Thanks for those links.

Sadly, unless someone uses my disk imaging mod this is true, but not from a limitation of Mac hardware but of Haiku that I cannot solve until Haiku supports being able to load its own images into memory like Linux has the ability to do; with a Linux-based system it’s possible to bless an ESP and boot from it as a Boot Camp drive. Haiku can’t do that which frustrated me out of working on ‘Haiku on Mac’.

These are pretty common for Mac hardware with Haiku sadly (no AirPort/Wifi or audio). Far as with the display, you might be able to set a safe resolution from Haiku’s boot menu and see if you can get it to use that.

I don’t understand how these two things are related…

You can set up an EFI system partition with our bootx64.efi in it and that should work. I don’t know what “blessing” is, is that a Mac specific thing? And how it is related to “load its own images into memory”? If you have an EFI system partition, all you need is the EFI bootloader to run the EFI executable inside that (in our case, the bootloader) and we can take it from there?

Also, do there exist bugreports about this with some detailed technical explanation? Or are you just being frustrated about it but done nothing to help improve the situation in that regard?