I’ve pushed the changes I think are needed to reproduce my progress. Lets try to explain how to build.
Packages
I am using a Debian Buster container for building so these are packages I install:
apt-get install --no-install-recommends bc attr git nasm autoconf automake texinfo flex bison gawk build-essential unzip wget zip less zlib1g-dev libtool mtools gcc-multilib xorriso python python3 u-boot-tools device-tree-compiler ca-certificates libncurses-dev cmake autopoint pkg-config
cmake for haikuporter, autopoint for make build
pkg-config for make
libncurses-dev for texinfo host tools
Get the Code:
Then I have a base directory haiku-projects where I setup git repos:
git clone https://review.haiku-os.org/buildtools
git clone https://review.haiku-os.org/haiku
git clone git@github.com:haikuports/haikuports.git
git clone git@github.com:haikuports/haikuports.cross.git
git clone git@github.com:haikuports/haikuporter.git
Build and Install jam
(from haiku-projects dir)
cd buildtools/jam
make
sudo ./jam0 install
Configure cross-compiler
(from haiku-projects dir)
cd haiku
mkdir arm64
cd arm64
../configure --build-cross-tools arm64 --cross-tools-source ../../buildtools --distro-compatibility official -j4 --use-gcc-pipe --bootstrap ../../haikuporter/haikuporter ../../haikuports.cross ../../haikuports
Build Bootstrap Packages and Haiku
Note: It will fail before full haiku image atm
(still in arm64 dir from previous step)
jam -j4 -q @bootstrap-raw
This will take a very long time, but rerunning it should be much faster as bootstrap packages should have been built and it is more like an ordinary Haiku build.
Install QEMU
Note: Debian QEMU is very outdated in buster so we use buster-backports
apt-get install -t buster-backports qemu-system-aarch64 qemu-efi-aarch64
The qemu-efi-aarch64 will install the UEFI firmware in /usr/share/qemu-efi-aarch64/
Running the Bootloader
(still in arm64 dir from above steps)
Create a Fake UEFI Boot Partition
mkdir disk
cd disk
ln -s ../objects/haiku/arm64/release/system/boot/efi/haiku_loader.efi
cd ..
Copy UEFI fw to dir
cp /usr/share/qemu-efi-aarch64/QEMU_EFI.fd .
Just to make sure that we don’t mess with the original.
Launch QEMU
qemu-system-aarch64 -m 256M -cpu cortex-a57 -M virt -bios QEMU_EFI.fd \
-device virtio-gpu-pci -device qemu-xhci \
-usb -device usb-kbd -device usb-tablet \
-display gtk,grab-on-hover=on,zoom-to-fit=off \
-net none -no-reboot -serial stdio \
-drive file=fat:rw:disk,format=raw
The fake disk we created above is used as a fat drive.
Launch haiku_loader.efi
You should now be in UEFI shell. It will countdown or you can press ESC.
Here you can type help for info about commands in the shell.
We are going to change to our disk called fs0 as it is the first filesystem found.
fs0:
Then you can do ls if you want to see what is there, but lets run, start typing hai and press TAB, for auto-completion. Or do:
haiku_loader.efi
This should bring you to the bootloader and where the port is currently at. Here is how it looks like: