How to play with a RiscV version of Haiku in TinyEMU or QEMU?

ah yes, hrev57197 should be the last one before the update to gcc-13.1 toolchain

some more testing gives me the following results:

  • hrev57197: successful boot to desktop
  • hrev57322: rather verbose page table dump, then is stalls when trying to jump to the kernel
  • hrev57453: stalls when trying to jump to the kernel
  • hrev57453+2: after reverting hrev57299 and hrev57298, successful boot to desktop

This gives us a hint: there might be something wrong with the initial page table setup in the boot loader.

8 Likes

Thanks on spending time on testing.

5 Likes

Ok, I’m assuming, if I don’t do a “git checkout” on the build tools, then the version I’m working with is the latest, correct? And, probably doesn’t work, to build Haiku (RISCV) hrev57197 properly, right? Thus, the version that directly precedes Haiku (RISCV) hrev57197 is btrev43203, which is dated 2023/6/20. And the very next btrev is the day AFTER (2023/8/5) the last successful build of Haiku (RISCV) hrev57197 (2023/8/4), so logically, it was being built with the prior revision of the build tools, because you can’t build older revisions of Haiku with newer tools you haven’t created yet.

That seems right.

David Karoly found a bug and fixed it, the fix was just merged. So you may be able to build and use the latest version now. That will be simpler than building older ones :slight_smile:

You can also check the next nightly build and see if that works again.

1 Like

Part of this adventure is the learning process. Doing something you didn’t know how to before. Figuring out how to fix something that was broken before. Learning new things, different things, is what life is all about. This is far from just getting to use Haiku on a different/new platform. Haiku is Haiku on EVERY platform. But, why do we choose one platform over another, to run Haiku? There must be a reason, or else we’re just “spinning teapots”, so to speak. :grin:

Update: Ok, now I’m getting mad. I’ve downloaded the buildtools. I checked out the btrev just prior to the day after the last working build of Haiku (RiscV). And now, the tools won’t build! So, how on earth did anyone create the Haiku (RiscV) hrev57197 image?

See: Progress on running Haiku on VisionFive 2 - Development / OS - Haiku Community (haiku-os.org)

  • Haiku >= hrev57453+2
    I haven’t rebuilt on the latest hrev57475, but review the build notes in the other thread where we covered a lot of the previous build issues.

The other test images (see @X512, @kallisti5, @davidkaroly): RISCV64 - Unsupported Builds | Haiku Files (haiku-os.org)

Most likely certain nightly images may not work, so validate with the main people beforehand… :checkered_flag:

Without a detailed log of the errors, there will be only wild guesses

~/haiku/generated.riscv64> jam -j2 -q @minimum-mmc
Starting build of type minimum …
Building Haiku Minimum Target
build-feature packages unavailable on riscv64: glu mesa fontconfig gutenprint webkit jasper qrencode_kdl tiff openexr libdvdread libdvdnav libraw libavif live555
AddHaikuImagePackages: package icu66 not available!
/boot/home/haiku/src/add-ons/kernel/bus_managers/isa/arch/riscv64/Jamfile: No such file or directory
/boot/home/haiku/src/add-ons/kernel/debugger/disasm/riscv64/Jamfile: No such file or directory
/boot/home/haiku/src/bin/debug/ltrace/arch/riscv64/Jamfile: No such file or directory
Asked for riscv target boot platform
Unknown path to handle adding to image
…patience…
…patience…
…patience…
…patience…
…patience…
…patience…
…patience…
…found 61016 target(s)…
…updating 8358 target(s)…
InitScript1 haiku.image-init-vars
C++ objects/haiku_host/x86_64/release/build/libbe/support/ZstdCompressionAlgorithm.o
InitScript1 objects/haiku/riscv64/packaging/packages_build/minimum/hpkg_-haiku_loader.hpkg/scripts/haiku.package-init-vars
…/src/kits/support/ZstdCompressionAlgorithm.cpp:17:12: fatal error: zstd.h: No such file or directory
17 | #include <zstd.h>
| ^~~~~~~~
compilation terminated.

gcc -c “…/src/kits/support/ZstdCompressionAlgorithm.cpp” -O2 -Wall -Wno-trigraphs -Wno-ctor-dtor-privacy -Woverloaded-virtual -Wpointer-arith -Wcast-align -Wsign-compare -Wno-multichar -include …/headers/build/HaikuBuildCompatibility.h -DZSTD_ENABLED -fPIC -include …/headers/build/BeOSBuildCompatibility.h -DARCH_x86_64 -D_NO_INLINE_ASM -D__NO_INLINE__ -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DHAIKU_HOST_USE_XATTR -DHAIKU_HOST_PLATFORM_HAIKU -DHAIKU_HOST_PLATFORM_64_BIT -DHAIKU_PACKAGING_ARCH="riscv64" -iquote …/build/user_config_headers -iquote …/build/config_headers -iquote …/src/build/libbe/support -iquote objects/common/build/libbe/support -iquote objects/haiku_host/x86_64/common/build/libbe/support -iquote objects/haiku/riscv64/common/build/libbe/support -iquote …/src/kits/support -I …/headers/build/private/app -I …/headers/build/private/interface -I …/headers/build/private/shared -I …/headers/build/private/support -I …/headers/build/host/haiku_host -I …/headers/build -I …/headers/build/os -I …/headers/build/os/add-ons/registrar -I …/headers/build/os/app -I …/headers/build/os/bluetooth -I …/headers/build/os/drivers -I …/headers/build/os/kernel -I …/headers/build/os/interface -I …/headers/build/os/locale -I …/headers/build/os/storage -I …/headers/build/os/support -I …/headers/build/private -o “objects/haiku_host/x86_64/release/build/libbe/support/ZstdCompressionAlgorithm.o”

…failed C++ objects/haiku_host/x86_64/release/build/libbe/support/ZstdCompressionAlgorithm.o …
AddVariableToScript1 objects/haiku/riscv64/packaging/packages_build/minimum/hpkg_-haiku_loader.hpkg/scripts/haiku.package-init-vars

BUILD FAILURE:
…failed updating 1 target(s)…
…skipped 68 target(s)…
…updated 3 target(s)…
~/haiku/generated.riscv64>


I deleted both /haiku and /buildtools, then redownloaded everything and built the buildtools as-is. Ran jam -j2 @minimum-mmc (no -q) and got a lot further before it failed. Then ran jam -j2 -q @minimum-mmc and got only this far. Is this the first fault point or did I possibly mess things up by running jam without -q?

Run pkgman install zstd_devel in Terminal.

3 Likes

Thank you, X512! That did the trick! Had to remove -q in the jam command line, for it to complete successfully, but I am also happy to report that Haiku (RiscV) hrev57475 boots to the desktop in QEMU!

3 Likes

Now, next on my list is to figure out how to remove or add apps to the image. I’ve spent a while digging through the /haiku folder and the Jam files and such, but not seeing any direct connection. Nothing that says, “put these applications/applets/preferences in this platform image”. Or is there something I overlooked?

1 Like

Aside from the default apps that come with the image you won’t be able to install anything there (I presume) because there is no buildmaster running builds for third party packages there.
You could setup haikuporter and build there yourself I think (think I saw @X512 doing something like that before).

4 Likes

  • build/jam/images/definitions/minimum
  • build/jam/images/definitions/regular

This will show you the apps and packages usually included during the jam build process - but more info may be in the Haiku docs for riscv64. I think the packages are built during the jam process and/or prebuilt from X512’s repo.

Where is X512’s repo? I think I saw it mentioned in one thread, but don’t recall which one… or where. :grin:

Review your build log for the downloaded riscv64 packages during the jam build - although, I don’t know if this repo was/is official…

It have RVVM and VisionFive 2 SD card boot support.

1 Like

Whoa… wait a second… you say your latest revisions have VisionFive 2 SD card boot support? As in, you can now boot Haiku off of an SD card on the VisionFive 2?!? This is the one thing I’ve been wanting/waiting for, to pull the trigger on buying a VisionFive 2!

Ok, can you detail the steps I need to go through, once I get a VisionFive 2, in order to get Haiku running on the VisionFive 2? I mean, I’ve read you gotta do this and that to get the latest firmware and all whatnot. So, I want to make sure I do everything EXACTLY in the right order. :grin:

2 Likes

Thank you. Indeed, I was able to make the changes I wanted, looking through …/minimum.

1 Like

I am also pleased to report, I’ve gotten QEMU running in Haiku now! I was using the Windows version before. However, after a few hours, I finally figured out how to get QEMU (I pronounce it “Chem-You” but maybe it could be pronounced “Keem-You”, but probably not “Queem-You”… unless you’re planning on pummeling someone, but you have an Elmer Fudd speech impediment… “You waskely wabbit… I’m gonna queem you!” :rofl: ) running.

But it functions a bit different than the Windows version. Here is my command line for it:

qemu-system-riscv64 -kernel /boot/home/Desktop/u-boot.bin -M virt -m 2048 -device ati-vga -device virtio-blk-device,drive=x0,bus=virtio-mmio-bus.0 -drive file=/boot/home/Desktop/haiku-mmc.image,if=none,format=raw,id=x0 -device usb-ehci,id=ehci -device usb-tablet -device usb-kbd -device ramfb -serial stdio

As you’ll notice, I had to tell it the path to both the u-boot.bin file as well as the haiku-mmc.image file. I think this is because I was completely unable to copy the files to where I think they would normally go in the system directory (Windows 11 protests, only slightly, asking that I give it Admin privilage to copy files). I kept being told I couldn’t put files there, as it was a read-only directory, and I could not find a way to override that. So… whatever works! :man_shrugging:

2 Likes

Is there a complete guide somewhere about firmware updates (for the VisionFive 2) and what order to do things, or is it the “sitting up all night and searching the internet game” as usual ?[quote=“Luposian, post:33, topic:14369, full:true”]

Whoa… wait a second… you say your latest revisions have VisionFive 2 SD card boot support? As in, you can now boot Haiku off of an SD card on the VisionFive 2?!? This is the one thing I’ve been wanting/waiting for, to pull the trigger on buying a VisionFive 2!

Ok, can you detail the steps I need to go through, once I get a VisionFive 2, in order to get Haiku running on the VisionFive 2? I mean, I’ve read you gotta do this and that to get the latest firmware and all whatnot. So, I want to make sure I do everything EXACTLY in the right order. :grin:
[/quote]