Oh no.. Haiku on a Phone (or Tablet)

So, it looks like there’s a few Qualcomm Snapdragon ARM phones out there with a full UEFI bios implementation. (the target of the project is to boot Windows ARM64)

https://renegade-project.tech/en/devices

I’ve confirmed the bootloader works on an old OnePlus 6t I had laying around giving a full graphical UEFI environment. In THEORY, if it implements a full standard UEFI boot environment, Haiku ARM64 might MIGHT MIGHT at least try to boot under it.

Which means… Haiku running on a phone may not be that crazy after all.

  • Need to see if Renegade passes a proper FDT to the booted OS
  • We would need FDT discovered drivers for… everything
  • Need to figure out screen framebuffer support… though UEFI framebuffer might be “enough”
  • Need to figure out how to get debug data from the devices since all we get is “one USB port” on phones lol.

The process would be something like…

  1. fastboot flash boot (EFI bootloader).img
  2. fastboot flash userdata haiku.mmc

Keep in mind, everything above is theoretical. @davidkaroly might want to validate my statements above since he’s put more ARM64 work in than I have at this point :slight_smile:

Also keep in mind, Haiku’s not Android. Literally nothing would function. This is purely a “wouldn’t it be neat” conversation :wink:

13 Likes

We might need to lower the compile target, not sure if it was already done with the rebootstrap packages. Zstd seems to be less picky with floating point on ARM64 now.

I’d poke around with a UEFI shell first. Not that hard to compile yourself and place in root (IIRC) of UEFI partition.
Also USB3 based docks tend to work on modern phones.

2 Likes

Renegade includes a built-in UEFI shell too :slight_smile:

Haven’t gotten a USB-C keyboard working yet though, limiting me to their touch-screen selections (none of which seem to detect Haiku’s ARM64 image flashed to userdata.

EDIT: WAIT! plugging a USB-C keyboard before you boot makes it work! Hell. Lets try to boot Haiku :grin:

3 Likes

hm. doesn’t see Haiku’s loader / ESP partition when you flash haiku-mmc.image to userdata with fastboot fastboot flash userdata haiku-mmc.image

Here’s the worlds worst picture of the phone’s screen with me poking around.

1 Like
  1. Connect USB C hub to phone.
  2. Connect USB serial adapter to USB hub. Also connect mouse/keyboard/USB disk if needed.

Phone may use standard XHCI controller that makes easier to support.

2 Likes

aah. I have a USB C hub. Let me try it… maybe it will be more willing to detect haiku flashed to a usb flash drive.

Is it even a GPT formatted disk on the phone? fastboot probably does something else?

Our MMC image is MBR + ESP + Haiku partition. (riding on that default BOOTXXX.EFI)
The fastboot partitions on the phone are… who knows.

I’ve gotten some luck with a “basic” USB hub (no PD passthough, etc) and a USB drive with Haiku plugged.

I saw the Haiku EFI loader via EFI shell, but wasn’t able to try starting before the battery died.
Waiting on the dead phone to charge a little before trying again in a few hours.

EDIT: A small note. I got fastboot flash userdata ... from the postmarketos folks. That’s how they slap their Linux / non-Android images on the phones.

1 Like

If it sees it as a fs it is a good sign, you should be able to launch the bootloader but maybe it needs to be signed.

Welp. Theory confirmed :slight_smile:

  • USB 3 Hub attached via USB C adapter to OnePlus 6t
    • Haiku ARM64 minimum-mmc written to a usb drive plugged into hub
    • USB Keyboard
    • Make sure everything plugged in on power-on.
  • Boot phone, boot Haiku:
    • Manual: fs2: , cd EFI/BOOT , BOOTAA64.EFI
    • Automatic: click “UEFI OS on Device #7” within EFI bootloader

I’m afraid without serial output debugging will be… difficult. Sorry for the video quality, it’s hard to capture the screen of a cell phone without an OS running on it.

To be clear, i’m probably not going to work a lot on this (too many projects, etc) figured it might be motivation for someone to take a crack at it though :slight_smile:

9 Likes

Here’s the device tree for the device:

Looks like we need GICv3 Interrupt Controller support for ARM64. We only have GICv2 today.
https://dev.haiku-os.org/ticket/18596

2 Likes

I know it’s about Haiku on Phones 2 :))

but sorry,

as Android tablets just some kind of

bigger or

giant phones

practically …

… Can a Samsung Tab S9 be a target as well ? :star_struck: :wink:

The only real requirement is an UEFI bios environment. That’s what really opens the doors to booting Haiku. (and why seeing Renegade made me go “huh, I wonder if we would work there”)

Unfortunately most consumer devices are targeting Android / Linux kernel in a really closed / proprietary way.

Find an ARM64 tablet with a UEFI implementation (Tianocore like Renegade, or u-boot) and Haiku has a somewhat reasonable chance of trying to boot on it.

3 Likes

Thanks. Seeing the possible devices … I understand all above.
Well, it was just a faint, shallow hope for a usable mobile Haiku (tablet) device.
As HW the Galaxy Tab S8/S9 Ultra is an attractive device for me as a used one in the future.

This way I should turn to other, non Android, but Windows based, non ARM, mobile devices to check out for such purposes.

The main reason I had not spent a lot to an Android device the same – not possible to easily install an alternate OS after Android support had run out or I want to replace it.
Also I hate that previously when I had one … an another machine needed to upgrade to a newer version of Android.
I do not know how it goes nowadays - at last time I had Android with a 4.4.x.x versio. It had not upgraded just updated, but I would have a Windows PC with installed Sony SW to execute the upgrade - this way I used it with the original version. I’ve just updated the OS on it with OTA - using WiFi.
Now I have a different financial situation … so no fancy new goodies on the table. ;-))

Anyway , it was interesting – against the sobering reality :-j

Nice story BRO!
We still have a long way to go. The phone market is shrinking, more and more small companies are going bankrupt, the largest will remain.

Might also be worth looking into Tow-Boot as well as common firmware for ARM. It tries to be consistent feature-wise across supported hardware and has an interface for configuration. Tried it out on a PinePhone and it works rather well.

With regards to debuggability, perhaps targeting the PinePhone line would be a good idea? Their 3.5mm jacks can be set to serial with a HW switch and usable with a USB adapter. I do want to try and boot Haiku on a PinePhone and see how far it goes, what needs to be done to do this?

1 Like

I think the problem will be more on the GUI side than on the kernel side. Phones are just smaller computer, so the hardware programming is the same or very similar, but the user interface conventions, not so much.

I guess let’s see if we get the kernel to run, and then we can talk about what to do with the GUI (if anything at all)?

And probably needs better power handling than haikus.

2 Likes

At least with USB-C becoming prevalent on phones now, the GUI can prolly stay the same when an external display is plugged in. As for a mobile GUI, there have been prior discussions in another thread:

Agree. However, it shows that the compatibility of our ARM64 port is already pretty strong. IF someone could find a nice ARM64 Android tablet (Maybe one with a pen input), and that has a UEFI bootloader, the use case is a lot stronger.

I have a nice Samsung Galaxy tablet, the blocker is no UEFI bios ports yet :wink: