Files
samarth 1cc900a8e4 futex2 (#313)
* add util functions for processing waker sets

* data structures for futex queues

* write one core for both futex impl; futex 1 uses futex_wait_multi with 1 waiter

* wire up the futex2 syscalls

* add tests for futex2

* add doc for futex2 changes

* change readme supported syscall number

* tests: additional tests after looking at linux src

* fixes from code review

* fix a bug with the calculation of time

* remove docs

* code formatting

* remove unused function

* update outdated comment about not returning EINVAL when you requeue a futex on itself

* addressing PR comments
2026-07-12 09:25:09 -05:00
..
2026-07-12 09:25:09 -05:00
2026-05-14 08:50:44 -07:00

libkernel

Architecture-independent kernel building blocks for operating systems.

libkernel provides the core abstractions that a kernel needs to manage memory, processes, filesystems, and synchronisation, agnostic of the an underlying CPU architecture. It is designed to run in a no_std environment and uses feature gates to keep the dependency footprint minimal.

Feature gates

Feature Enables Implies
sync Synchronisation primitives (spinlock, mutex, rwlock…)
alloc Memory allocators (buddy, slab) and collection types sync
paging Page tables, PTE helpers alloc
proc Process identity types (UID/GID, capabilities)
fs VFS traits, path manipulation, block I/O proc, sync
proc_vm Process virtual-memory management (mmap, brk, CoW) paging, fs
kbuf Async-aware circular kernel buffers sync
all Everything above all of the above

Quick start

Add libkernel to your Cargo.toml with only the features you need:

[dependencies]
libkernel = { version = "0.1", features = ["sync", "proc"] }

The CpuOps trait

Most synchronisation and memory primitives are generic over a CpuOps implementation. This trait abstracts the handful of arch-specific operations (core ID, interrupt masking, halt) that the portable code depends on.

License

Licensed under the MIT license. See LICENSE for details.