Nexus

Nexus is the Vitruvian kernel subsystem that bridges the Linux kernel with the BeOS/Haiku runtime. It’s implemented as a set of Linux kernel modules (loaded at boot) that emulate the IPC and filesystem APIs Haiku provides natively in its monolithic kernel.

Native V applications expect ports, semaphores, shared memory areas, thread control, virtual file references, and node monitoring. None of these exist in Linux in BeOS-compatible form. Nexus fills that gap.

Device layout

Each Nexus subsystem is exposed as a character device:

Device Subsystem
/dev/nexus ports, semaphores, threads
/dev/nexus_area shared memory areas
/dev/nexus_node_monitor filesystem watches

Every process opens its own file descriptors to these devices at startup via BKernelPrivate::Team::Init(). File descriptors are process-local and not inherited across fork; children re-initialize via a constructor.

IPC primitives

Ports

Haiku-style message ports: bounded queues with read/write operations.

Limits: max queue depth 4096, max message size 256 KB.

Semaphores

Standard counting semaphores:

Threads

Thread lifecycle and communication:

Note: Haiku spawns threads in suspended state; resume_thread() starts them. Vitruvian’s pthread_create starts immediately, so the run-state model differs.

Areas

Shared memory regions backed by memfd_create + mmap:

Cloning an area maps the same memfd into the target process.

Node monitor

Provides filesystem event notifications compatible with the BeOS node_monitor API:

Nexus hooks into Linux’s fsnotify subsystem and translates events into B_NODE_MONITOR messages. This is what allows Tracker to watch directories and respond to changes in real time, exactly as it would on Haiku.

Team registration

Every process that uses Nexus opens the devices and registers itself as a team. On process exit, the kernel module cleans up all resources owned by that team (ports, semaphores, areas, vrefs).

Deployment

Nexus ships as a DKMS package (nexus-dkms). It auto-rebuilds on kernel update. The DKMS source copy at debian/nexus-dkms/usr/src/nexus-1/nexus/ must be kept in sync with the main nexus/ tree: every ioctl addition and every fix goes in both places.

Further reading

V\OS Docs