NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

First bits of a Haiku compatibility layer



Hello,

Many people here may know that Haiku is an open-source remake of BeOS,
a 90s era desktop OS developed by Be Inc. After ~20 years of
development, it does indeed look like a modernized version of Beos.
What makes it so special is that it is extremely integrated, intuitive
and enjoyable to use. It has a zero-latency, pixel-perfect looking GUI
and follows the design and usability concepts of its commercial
predecessor. That is why I always found it interesting to rebase it on
a mature unixish operating system, especially NetBSD.

While the Be engineers may have incorporated some concepts of Unix
into their OS, it is not so much a Unix or POSIX system. For example,
it has its own error codes, IPC and thread API, data types and generic
lower-level C functions (details later).

Am I the first person having this idea?

No, for example there was a project called cosmoe with the aim of
making the Haiku userland run on top of a POSIX OS. It does so by
emulating BeOS (and thus, Haiku) IPC on SysV IPC, BeOS threads on
pthreads, and other functions on common POSIX or C functions. I tried
this on (I think) NetBSD 6 and got it working to some extent but it
was very unstable.

https://github.com/Ithamar/cosmoe

Secondly, I saw in his personal files that the NetBSD developer kamil@
did some research on this topic. I tried to reach out to him to hear
his findings, but unfortunately none of the E-Mail addresses I found
were working anymore.

http://www.netbsd.org/~kamil/haiku/

Some years ago I already started to work on a compatibility layer for
NetBSD and resumed working on it recently. The original architecture
looks like this

Services / Apps
libbe.so -> C++ Kits
libroot.so -> C runtime, Syscall access, ...
Kernel

I think a compatibility layer would mostly consist of kernel
components and a custom libroot.so.

I have created a libroot that provides functionality missing in libc
and it should behave like the original one. It makes use of libc and
libpthread at the moment as well as syscalls of the kernel components.
The source can be found on Github:

https://github.com/stephanwib/src/tree/trunk/lib/libroot

At the moment I have the Ports IPC mechanism finished as a kernel
driver. It is here:

https://github.com/stephanwib/src/blob/trunk/sys/kern/uipc_port.c

The kernel part follows NetBSD concepts, it uses NetBSD data types
(which were chosen to be very compatible, though) and POSIX errors.
The custom libroot.so translates these as required by higher layers of
the Haiku userland.

More information on these interfaces are described here:

https://www.haiku-os.org/legacy-docs/bebook/TheKernelKit_Overview.html

All of this should be considered a concept or prototype at the moment.
Anyhow, I was able to compile the original Haiku port IPC test
programs and they all ran successfully.

I would like to hear feedback on this topic as well as if other
developers are interested. There is work to do in the kernel, the
library and probably pkgsrc to obtain and build the userland.

Stephan


Home | Main Index | Thread Index | Old Index