Expand description

This library provides a common interface for applications that want to talk to the Twizzler kernel, and defines that interface for both applications and the kernel to follow. It’s made of several parts:

  1. The Runtime – see rt1, aux, and exec
  2. System Calls – see syscall and arch::syscall
  3. The rest, acting as support for the rust standard library.

Should I use these APIs?

All of these interfaces are potentially unstable and should not be used directly by most programs. Instead, the twizzler crate can be used to access standard Twizzler object APIs, and the rust standard library should be used for general rust programming. Both of these wrap calls to this library in better, more easily consumed APIs.

Modules

Global allocation. Used by the Rust standard library as the global allocator. Similar to malloc() and friends.
Architecture-dependent code, will include submodules for the appropriate arch that expose the _start symbol and the raw_syscall symbol.
When running a new program (and thus, initializing a new runtime), the new program expects to receive some information about how it was started, including arguments, env vars, etc. These are passed to the new program through the _start function as an array of AuxEntries as its only argument.
APIs for accessing the device tree and device representation objects.
Some runtime-available executable information. Mostly used for backtracing.
Functions to deal with Kernel State Objects (KSOs). These are objects created by the kernel to describe the running state of the system and expose device memory to userspace.
Functions to start new executable programs.
Marker traits used to indicate safety for storing data in objects and using a struct as a base type.
Types that make up object metadata.
Low-level object APIs, mostly around IDs and basic things like protection definitions and metadata.
Runtime functions for Twizzler userspace. This part of the code is a bit arcane and somewhat tricky, so buckle up.
Very simple and unsafe Mutex for internal locking needs. DO NOT USE, USE THE RUST STANDARD LIBRARY MUTEX INSTEAD.
Manage slots in the address space. Currently not finished.
Wrapper functions around for raw_syscall, providing a typed and safer way to interact with the kernel.
Functions for manipulating threads.
Raw time handling, provides a way to get a monotonic timer and the system time. You should use the rust standard library’s time functions instead of these directly.
Functions for handling upcalls from the kernel.
Simple support for volatile memory access.

Functions

Simple callback into twizzler_abi made by the standard library once it has initialized the environment. No panic runtime is available yet.