Haiku on Macbook Pro 2019 T2 chip

I’m trying to convert a MacBook Pro 2019 (Intel i5) to be an haiku machine.
The oddity that I’m encountering is that when I try to boot from the USB pendrive, the screen just goes black and the laptop is stuck. It goes black immediately, no Haiku icons and no SHIFT or SPACEBAR key to open the boot menu.

I tried both using the bootx64.efi from the pendrive and copying it to my own EFI partition. In both cases it’s just black screen as soon as I choose to book from it.

Is there anything I should check or do to progress further?

2 Likes

Apple machines are usually a bit tricky to get going. You can search the forum archives for topics about this. It may involve using rEFInd as a bootloader and using its “spoof_osx_version” setting to make the computer think it is booting some specific version of Mac OS, and then things will run a bit better.

Thanks, tried the spoof_osx_version = 10.9 in refind, sadly didn’t change much. Still a black screen as soon as I choose the haiku bootloader

1 Like

You can look into our hardware database too. Here some mac books are listed with infos to get them running (for example mac book pro 2020 and younger ones).

https://hardware.besly.de/index.php?systeme=list

Or search the forum for “hardware list complete systems

A couple of threads pop right up in search

1 Like

Thanks,

I had took a look at those posts, but the problem most people have is that the system gets stuck during loading process or doesn’t recognize some hardware.

My problem seems to be that the boot loader itself doesn’t work, haikuloader seems just to freeze when started in my Mac, and that makes very hard to understand or debug what’s going wrong.

Unless a development version of the bootx64.efi of haiku with additional debugging is available somewhere, I doubt I’ll be able to understand much of what’s going on :thinking:

1 Like

Have you tried this:

"When starting up, press a key (like return) to unfreeze the splash screen. "

Yes, does nothing. I tried also pressing and keeping pressed the SHIFT and SPACEBAR keys to try to access the bootloader menu. I fear the T2 chip is causing major problems and is somehow preventing the bootloader to even load.

1 Like

Maybe I completely missed something that was already discussed, but did you boot into recovery mode (Command + R at power-on) and disable the security settings?

image

Yes, without disabling that you can’t even install rEFInd.

I’ll try one more thing of partitioning the disk and somehow installing haiku on it without booting from the live. I have my doubts given that the boot loader seems to not even reach the point where it looks for boot volumes, but maybe it will change something.

1 Like

I wonder if you could try what I did with installing a boot camp Windows, then installing Haiku over that…

But you’re problem is different. Mine is a 2012 mac, and also I had no problems with booting from the USB drive.

Why would the T2 chip prevent the boot loader from loading?

If you have the Secure Boot option set to No Security and the Allowed Boot Media option set to Allow booting from external or removable media then it shouldn’t be interfering with the boot media.

https://www.haiku-os.org/docs/userguide/en/bootloader.html

I assume that you mean that you cannot even enter the the " Boot Loader Options" part (this is before you would be shown the Haiku logo and icons) as described on the above page?

Just speculation, but I would be suspicious of it hanging/crashing in the hardware initialization somewhere…

Some people have also mentioned issues with UEFI/EFI before related to whether the system has 32-bit or 64-bit firmware and it not playing nice somehow with particular hardware+software configurations. So maybe there’s something funky going on,.

UEFI requires the firmware and operating system loader (or kernel) to be size-matched; that is, a 64-bit UEFI firmware implementation can load only a 64-bit operating system (OS) boot loader or kernel (unless the CSM-based Legacy boot is used) and the same applies to 32-bit. After the system transitions from “Boot Services” to “Runtime Services”, the operating system kernel takes over. At this point, the kernel can change processor modes if it desires, but this bars usage of the runtime services (unless the kernel switches back again)
UEFI - Wikipedia (see also UEFIBOOT, CSMBOOT sections)

EFI system partition - Wikipedia
EFIBootLoaders - Ubuntu Wiki

P.S.

Presumably you have one of these two models?

MacBook Pro "Core i5" 1.4 13" Touch/2019 2 TB 3 Specs (2019 13" (Touch Bar, 2 TB 3)*, MUHN2LL/A*, MacBookPro15,4, A2159, 3301): EveryMac.com

MacBook Pro "Core i5" 2.4 13" Touch/2019 Specs (2019 13" (Touch Bar)*, MV962LL/A*, MacBookPro15,2, A1989, 3358): EveryMac.com

If you have the Secure Boot option set to No Security and the Allowed Boot Media option set to Allow booting from external or removable media then it shouldn’t be interfering with the boot media.

They are set that way, or it wouldn’t even recognise Haiku as bootable options. But those are settings for T2, they don’t “remove” the existence of the T2 chip. So I wouldn’t be surprised if it did still somehow mess with the bootloader.

I assume that you mean that you cannot even enter the the " Boot Loader Options" part (this is before you would be shown the Haiku logo and icons) as described on the above page?

Correct, the computer freezes before it even has the opportunity to handle the bootloader hotkeys to open the boot loader options.

Just speculation, but I would be suspicious of it hanging/crashing in the hardware initialization somewhere

I would need someone with a better understanding of the Haiku boot process to evaluate if that’s a possibility. From what I can see the kernel doesn’t even get loaded at all, so unless the haikuloader itself does a lot of hardware setup not much should be happening.

Some people have also mentioned issues with UEFI/EFI before related to whether the system has 32-bit or 64-bit firmware and it not playing nice somehow with particular hardware+software configurations

Yes, both the EFI, the bootloader and the system are all 64bit. Unless I’m missing something.

Presumably you have one of these two models?

It’s the first one ( MacBook Pro "Core i5" 1.4 13" Touch/2019 2 TB 3 Specs (2019 13" (Touch Bar, 2 TB 3)*, MUHN2LL/A*, MacBookPro15,4, A2159, 3301): EveryMac.com )

Anyway I bought a used HP EliteBook 830 G5 i5-8250U 16GB Ram 256GB SSD on eBay as a 13", that should be more compatible with Haiku than the Macbook 13" so I will just try to solve my Haiku install problems that way :man_shrugging:

That’s the other thing. Go into the kernel file, and set safe mode options from there.

Edit: I don’t know if it was already said, but I mean use the usb drive to boot on another computer, and use that to set the kernel file options on the usb.

1 Like

Thanks. :smiley:

It can be hard sometimes hard to understand what the problem is exactly when the details are spread over a conversation going back and forth between three or more people.

The two links below seem relevant to understanding the boot process, although they don’t constitute much more than a broad overview

Hopefully your Macbook Pro is making it as far as TSL – Transient System Load because that would imply that the problem is largely with something that haiku_loader is doing.

In addition it would likely be useful to know whether Apple’s firmware for the Macbook Pro conforms to either v1.1 (Intel’s original EFI) or some v2.x of the spec (called UEFI at this point), as the author of this topic (on Apple’s discussion/community pages) points out.

my attempt to cut down the information about boot stages a little

Boot stages
A. SEC – Security Phase (page says " This is the first stage of the UEFI boot but may have platform specific binary code that precedes it. (e.g., [Intel ME], [AMD PSP], CPU [microcode]).“)
B. PEI – Pre-EFI Initialization (page says " The second stage of UEFI boot consists of a dependency-aware dispatcher that loads and runs PEI modules (PEIMs) to handle early hardware initialization tasks such as [main memory] initialization and firmware recovery operations”)
C. DXE – Driver Execution Environment
C - a. BDS – Boot Device Select (page says " BDS is a part of the DXE.[84][85] In this stage, boot devices are initialized, UEFI drivers or [Option ROMs] of PCI devices are executed according to system configuration, and boot options are processed.“)
C - a - i. initialize boot devices
C - a - ii. execute UEFI drivers (or Option ROMs) of PCI devices, according to system configuration
C - a - iii. process boot options
D. TSL – Transient System Load (page says “This is the stage between boot device selection and hand-off to the OS. At this point one may enter UEFI shell, or execute an UEFI application such as the OS boot loader.”)
E. RT - Runtime (page says " The UEFI hands off to the [operating system] (OS) after ExitBootServices() is executed. A UEFI compatible OS is now responsible for exiting boot services triggering the firmware to unload all no longer needed code and data, leaving only runtime services code/data, e.g. [SMM] and [ACPI].[86]”)


https://www.haiku-os.org/docs/develop/kernel/boot/boot_process_specs.html

section on EFI booting

EFI

On EFI systems, there is no need for a stage1 loader as there is for BIOS. Instead, our stage2 loader (haiku_loader) can be executed directly from the EFI firmware.

The EFI firmware only knows how to run executables in the PE format (as used by Windows) because Microsoft was involved in specifying it. On x86_64, we can use binutils to output a PE file directly. But on other platforms, this is not supported by binutils. So, what we do is generate a “fake” PE header and wrap our elf file inside it. The bootloader then parses the embedded ELF header and relocates itself, so the other parts of the code can be run.

After this initial loading phase, the process is very similar to the Open Firmware one. EFI provides us with all the tools we need to do disk access and both text mode and framebuffer output.

@javanx have you tried with another thumb drive? On a different usb-c port? or a combination of the two?

1 Like

Building off of that, perhaps you can burn a Haiku CD and if you can use an external cd drive if you have one available.

I may try that. I just tested on a 2019 Macbook pro (i7). Had the same black screen. External monitor didn’t help. Also I saw two efi boot options on my Haiku boot drive. I don’t know if that was something I did previously to the drive.

Anything to update? Progress? I just started trying this on the same exact MacBook Pro and after about 10 tries of different things I found this thread. Definitely think it has to do with the T2 chip as I hear that messes up some hardware interaction with alternate os’es.

Had the exact same problem with an iMac 2015. Boot gets stuck on a black screen, does not go further and hitting space does not work either. Was able to successfully boot elementaryOS from the same USB stick so I guess it’s something Haiku specific. May try later changing the boot options on my laptop and report back. Btw also could not get reFind to work correctly either…