Progress on running Haiku on VisionFive 2

Binaries are not published yet, but can be built with HaikuPorter (build process may be not trivial and may need to solve various obscure problems). I can upload binaries if needed.

FreeBSD compat. layer is not yet ported to DM v2 USB API, so only PCI devices will work with it.

2 Likes

Hi X512

Netsurf isnā€™t the best browser but its certainly better than no browser and itā€™d be better to test networking with Netsurf than just having wget and ping so yeah, binaries would be handy thanks!

Hereā€™s the KDL that happens as soon as I remove a USB device:

Is it easy to configure Haikuporter under x64 Haiku to cross compile rv64 hpkgs? Have you written a guide on how to set this up?

Can you remind me what I need to change to create a bigger disk image? I think it was a setting in the jam file?

gcc?

No. It is currently not possible at all. riscv64 HaikuPorts packages should be compiled on riscv64 machine (real or virtual). This is why it is currently difficult to compile large projects such as LLVM or WebKit, it will take more that one day to compile on riscv64 machine (unless you have something like Milk-V Pioneer). I also experienced some troubles with updated Python versions when attempting to build LLVM.

1 Like

All the more need for an easy to install (or included by default in the nightly build) gcc then.

Can you remind me what I need to change to create a bigger disk image? I think it was a setting in the jam file?

PulkoMandy described how to do it here:
Progress on running Haiku on VisionFive 2 - #111 by PulkoMandy

In short, set HAIKU_IMAGE_SIZE in UserBuildConfig

You do also seem to get some installable gcc packages with the @nightly-mmc build within the image currently and you can install them after boot. I have not tried compiling anything though.

1 Like

Note that it is possible to use Installer app to install Haiku from disk image to actual disk. Installer app is arch-independent, you can use x86_64 Installer to install riscv64 system. It also should allow to install GCC.

1 Like

Note that it is possible to use Installer app to install Haiku from disk image to actual disk.

How might that work then? AFAIK, the VF2 can only boot Haiku off nvme and we only have the one m.2 slot so what would I install the image to?

I mean that you can connect NVMe disk to x86_64 Haiku computer and run Installer with mounted Haiku image as source and NVMe volume as destination. device_manager2 branch also support booting from SD card.

5 Likes

Didnā€™t you once say that Haiku RiscV (or the VF2 version) was now installable to/bootable off of the microSD card? Or did I misunderstand?

Apparently it is now although Iā€™ve not tested that yet.

Has anyone been successful in creating a custom sized nightly image that boots? I havenā€™t.

I can get it to almost work as in it seemigly builds without error but the image doesnā€™t boot. I do this by creating a file called UserBuildConfig in haiku/generated.riscv64 containing the line:

HAIKU_IMAGE_SIZE = 4096 ;

or maybe a bit bigger. The image seems to build OK and its the right size (4 GB) but when I use balenaEtcher to copy it onto my nvme I get a ā€œMissing Partition Tableā€ error.

I tred the other suggested method too of using the installer on a Haiku x64 machine to install Haiku from a microSD card, in my case, of Haiku rv64 nightly onto a pre-inited and formatted with BeFS nvme disk. The installer seems to work and it clams it installed the bootloader OK but I havenā€™t had a VF2 Haiku installation created this way successfuly boot.

well its been awhile but I used to set the haiku image to a literal partition and do rebuilds that wayā€¦ it doesnā€™t build a partition table because it is supposed to be pointed at a partition.

So create your partition table on your NVMe drive, then dd the image to an existing correctly sized partition. Youā€™ll also have to make it the active partition potentially not sure if that is a x86/BIOS ism thoughā€¦ its probably still valid to do that on UEFI.

1 Like

Hi cb88

That didnā€™t work for me but the following process has allowed me to create a larger Haiku rv64 image that successfully boots on my VF2. Hopefully X512 can fix the build scripts so that doing all this isnā€™t necessary in the future.

Creating a larger Haiku rv64 disk

First, build a regular (nightly) Haiku rv64 image then dd/BelenaEtcher or whatever this image onto your disk. Replace /dev/sdb with the correct device for your NVME disk.

dd if=haiku-mmc.image of=/dev/sdb bs=8M

Delete the images. You might want to backup haiku-mmc.image somewhere first:

~/src/haiku/generated.riscv64$ rm haiku-mmc.image haiku-nightly.mmc

Create a UserBuildConfig file in haiku/generated.riscv64 containing one line defining the size of your new disk image eg:

HAIKU_IMAGE_SIZE = 8192 ;

Rebuild the image:

jam -j8 -q @nightly-mmc

Use drive setup to delete the Be partition off your target disk and replace it with a partition as big as (or bigger than) the larger image you just built. Now you can dd the larger image onto the empty Be partition:

dd if=haiku-nightly.mmc of=/dev/sdb2 bs=8M

Hereā€™s the jam error I get when I specify a different size disk image using HAIKU_IMAGE_SIZE:

Creating image ...
Creating filesystem indices...
Populating image ...
Resolving package dependencies ...
Extracting download/openssh-8.8p1-1-riscv64.hpkg ...
Extracting download/wget-1.21.1-1-riscv64.hpkg ...
Extracting download/git-2.30.2-3-riscv64.hpkg ...
Unmounting ...
warning: using independent target boot.scr
BuildEfiSDImage1 haiku-mmc.image
32770+0 records in
32770+0 records out
33556480 bytes (34 MB, 32 MiB) copied, 0.155974 s, 215 MB/s
mbrtool: MBR of image is invalid, creating a fresh one.
mbrtool: Warning: Partition extends beyond end of file!
dos_std_ops()
dosfs_initialize(3, , 'Haiku Boot', '(null)', 0)
dosfs: size = 33554432 bytes (65536 sectors), 32768 KB, 32 MB, 0 GB
dosfs: fatbits = 16, clustersize = 2048
dosfs: FAT size is 64 sectors
dosfs: disk label: Haiku Boot
dosfs: Writing FAT
dosfs: Writing boot block
dosfs: Writing first FAT sector
dosfs: Writing root directory
dos_std_ops()
dos_std_ops()
fssh:/> fssh:/> dos_std_ops()
dos_std_ops()
fssh:/> fssh:/> dos_std_ops()
dos_std_ops()
fssh:/> Error: Failed to open source path `boot.scr': Bad file descriptor
fssh:/> dos_std_ops()
dos_std_ops()
fssh:/> fssh:/> dos_std_ops()
dos_std_ops()
fssh:/> fssh:/> dos_std_ops()
dos_std_ops()
fssh:/> myfs:
drwxrwxrwx  0  0      16384 2024-02-29 16:42:04 .
drwxr-xr-x  0  0          0 2024-02-29 16:42:04 ..
drwxrwxrwx  0  0       2048 2024-02-29 16:42:04 EFI
-rw-rw-rw-  0  0         54 2024-02-29 16:42:04 uEnv.txt
drwxrwxrwx  0  0       2048 2024-02-29 16:42:04 fdt
fssh:/> dos_std_ops()
...updated 980 target(s)...

The good news is that Iā€™ve got gcc, make and automake installed under Haiku rv64 now. Yay!

The bad news is that python and hence haikuporter donā€™t want to install. I get the error:

Failed to open directory
"/boot/system/packages/administrative/writable-files/python-3.9.1-1/non-packaged/lib/python3.9": No such file or directory ()

When I try to install either haikuporter or python from haikudepot.

The first package I want to try building is SDL. Have you already got SDL to build under rv64 X512?

EDIT

X512 posted about getting an SDL based game running earlier in this thread but SDL hasnā€™t been packaged for rv64 Haiku yet.

Ahoy @danboid,

Python issue you experienced ā€¦ should not surprise you ā€¦

as @512 shared above :

Dear @512,

About this power machine issue ā€¦

Donā€™t you have an access to a strong , workstation grade machine where you could setup a Risc-V Haiku in a VM ā€¦
ā€¦ and build these apps on dozens of some x86_64 cores with huge memory size ?

I was reading earlier more members has monstrous machines they offered in other compiling cases ā€¦

ā€¦ they may help you out with computing power now to have a growing number of apps of Haiku Risc-V version.

I think the Haiku base install packages first, and the most required development libraries/tools.

This way requirement of a ā€œpowerā€ Risc-V config can be postponed or eliminated for introductory building process.

1 Like

Do gcc actually work? What happens if manually compile some simple program?

2 Likes

It seems your haiku devel subpackage is missing.

1 Like