Overview of Rupa

Rupa, also known as Rūpa, is a fundamental Buddhist concept that refers to the physical form or materiality of sentient beings and the world. It is considered as one of the five aggregates, or skandhas, that constitute a sentient being in accordance with Buddhist teachings. The other four aggregates include sensation, perception, mental formations, and consciousness.

In the context of computing, Rupa serves as the core of Sunyata, an incredibly minimalistic microkernel that consists of a kernel and a small set of userspace services, drivers, and libraries required for essential system functions.

A typical OS Kernel features the following services:

  • IPC
  • Memory Management
  • Scheduler
  • Process Management
  • User Permissions
  • Networking
  • Filesystems
  • Device Drivers

Whereas Rupa only features the following:

  • IPC
  • Memory Management
  • Scheduler
  • Process Management

Jobs, processes, threads

Rupa exposes three main kernel objects (for any running code):

  • Job
  • Process
  • Thread

System calls

In Rupa, userspace code interacts with objects in the kernel space through system calls. Rupa provides system calls for performing low-level operations, including:

  • Hardware support services
  • Exception handling
  • IPC and sync
  • Task management
  • Memory management

The virtual dynamic shared object (vDSO) is a critical component of Rupa. It allows any userspace process to access Rupa's system calls. The Rupa vDSO, in the form of a shared library in elf format, is directly exposed through the kernel image rather than loaded from a file. It serves as a virtual library that is mapped into the address space of every new process, granting access to the system calls.

In Rupa, many system calls operate with one or more handles. Handles are process-local references represented as a 32-bit integer (ru_handle_t) to objects within the kernel space. Each handle specifies the privileges and rights of the holder to perform actions on the referenced object.

Communication between processes

To enable secure communication between isolated processes within Rupa/Sunyata, the kernel provides the following object types for Inter-Process Communication (IPC):

  • Channel
  • Event
  • FIFO
  • Socket
  • Stream
  • FIFO

Channels are well-suited for facilitating the launching of new processes because they can transfer handles to another process.

A channel consists of two endpoint handles, each owned by a different process. Only the owners of these handles can read from or write to the channel. However, ownership of these endpoints can be transferred from one process to another.

Last updated on 12 May 2023