My Haiku RISC-V port progress

It would be nice to have one. I can even switch to RISC-V as main development machine if I have one, it is quite powerful.


Yes, good time for the marketing team and the R1 Beta 3 release will come soon too.


More applications are working. I made some hack to allow threads to exit. Before that threads attempted to directly return to kernel stack (arch_thread_enter_userspace) and failed because they have no permissions to read kernel stack or execure kernel code on return. I added _kern_exit_thread() in and disabled signal handing on kernel side.

Proper implementation will need adding thread exit code in commpage.

Current thread stack looks like this:

Thread 336 "VirtIO tablet watcher" running on CPU 0
FP: 0x807e4a60, PC: <kernel_riscv64> debug_call_with_fault_handler.localalias.7 + 121
FP: 0x807e4af0, PC: <kernel_riscv64> _ZL20kernel_debugger_loopPKcS0_Pvi + 251
FP: 0x807e4b60, PC: <kernel_riscv64> _ZL24kernel_debugger_internalPKcS0_Pvi + 131
FP: 0x807e4ba0, PC: <kernel_riscv64> panic + 93
FP: 0x807e4c40, PC: <kernel_riscv64> user_debug_exception_occurred + 31
FP: 0x807e4d30, PC: <kernel_riscv64> vm_page_fault + 421
FP: 0x807e4e20, PC: <kernel_riscv64> STrap + 571
FP: 0x807e4f20, PC: <kernel_riscv64> SVecU + 109 /* supervisor trap handler for user mode, it switches environment from user to kernel and back, written in assembly */
FP: 0xffffffdb32753fe0, PC: <virtio> _ZN13VirtioHandler7WatcherEPv + 17
FP: 0xffffffdb32754000, PC: <> _thread_do_exit_work + 107 /* actually this is <> thread_entry */
FP: 0x807e4f50, PC: <kernel_riscv64> arch_thread_enter_userspace + 161 /* everybody knows what happens if user thread attempt to return here :) */
FP: 0x807e4f90, PC: <kernel_riscv64> _ZL15enter_userspacePN7BKernel6ThreadEP24UserThreadEntryArguments + 67
FP: 0x807e4fb0, PC: <kernel_riscv64> _ZL19common_thread_entryPv + 77
FP: 0x0, PC: <kernel_riscv64> arch_thread_entry + 3



I’m still waiting for someone to finish that Motorola 68000 port!


Deskbar is running and working. Tracker (freeze) and Terminal (crash on some C++ exception) still not.



I’m so ready to buy RISC-V hardware!

Thank you for outstanding work :grinning:


I’d love to have Haiku on my old PowerBook G4

It’s great to see this happening. I’m also thinking about buying a SiFive Unmatched. Free Software is great but it’s not enough - we need Free Hardware, too. And that’s why I think that RISC-V will be the future.


Frankly this Haiku topics at reddit are the most depressive things to read. Even after 20 years of work and proving in every possible ways they are just like: i would, i‘d like, it would be good, BeOS was great, gimme rpi and the like wishful thinking but never more than that.I call this state simply „ comfort in impotent laziness“. It is terribly sad reading things like this.


Yes I agree, on the other hand there are many readers and lot of attention now regarding Haiku, to be used now!

I have no expectations knowing well how long the attention span is for modern people.

1 Like

Anyway it is a Linux Site, and people there can be informed or corrected reading the Haiku Web-Site and the Haiku Forum.

Getting a lot of attention there leads to the chance to
correct all the mistakes and thinking’s they still have about Haiku!
And feed them with the actual development and Information about Haiku.

Better to invite them to test and use Haiku by themselves.
I am sure some developer there getting interest in Haiku.

EDIT: Reddit is not a Linux Site! Sorry I did not know that by just following the link and not read more about that Site. I appologise for my fast misinterpreting it.

reddit is not a linux site, but an antithesis of the linux philosophy.

1 Like

Really cool to see you working on this port, can only spell good things for our arch support.

As for the media attention, we usually get a lot for a beta release, and those have press releases and cool info, perhaps we should release the next beta. (Not sure if media attention brings any new devs however)

Haiku definitely not follow Linux philosophy with no stable API/ABI and a mess of many libraries and system services banded with tape, often doing the same thing.

Linux looks like advanced DOS or node.js packages that can run on bare metal. Haiku looks like real OS with consistent design.


Reddit isn’t a Linux site; the subreddit where I made that post is the Linux subreddit. However, it allows for posts about non-Linux stuff as long as it is about open source software.

1 Like

I fear you misunderstood me. I meant the phenomenon that they larp as linuxians for likes but they dont care about its philosopy and using it only as a tool for their consumerist lifestyle.

Tracker is often crashing in __gnu_cxx::__exchange_and_add(int volatile*, int), probably NULL dereference. Maybe related to unsupported TLS relocations. I really want libraries compiled with --fno-omit-frame-pointer because currently it is hard to know where crash is caused.

vm_soft_fault: va 0x0 not covered by area in address space
vm_page_fault: vm_soft_fault returned error 'Bad address' on fault at 0x0, ip 0xffffffe0ddae72d8, write 0, user 1, thread 0x176
PANIC: user_debug_exception_occurred(2, 11)
Welcome to Kernel Debugging Land...
Thread 374 "TrackerTaskLoop" running on CPU 0
FP: 0x8083da60, PC: <kernel_riscv64> debug_call_with_fault_handler.localalias.7 + 121
FP: 0x8083daf0, PC: <kernel_riscv64> _ZL20kernel_debugger_loopPKcS0_Pvi + 251
FP: 0x8083db60, PC: <kernel_riscv64> _ZL24kernel_debugger_internalPKcS0_Pvi + 131
FP: 0x8083dba0, PC: <kernel_riscv64> panic + 93
FP: 0x8083dc40, PC: <kernel_riscv64> user_debug_exception_occurred + 31
FP: 0x8083dd30, PC: <kernel_riscv64> vm_page_fault + 421
FP: 0x8083de20, PC: <kernel_riscv64> STrap + 571
FP: 0x8083df20, PC: <kernel_riscv64> SVecU + 109
FP: 0x0, PC: <> _ZN9__gnu_cxx18__exchange_and_addEPVii + 69 /* don't write 0 in FP, please :( */

What about other apps that Haiku doesn’t have by default? Is it possible to compile them now for RISС-V?

Do you mean HaikuPorts? It need to ask people who maintain HaikuPorts build infrastructure. Many apps will already run.