Show HN: Anos – a hand-written ~100KiB microkernel for x86-64 and RISC-V

Anos is an ambitious hand-written microkernel project with a tiny footprint of ~100KiB, supporting preemptive multitasking on up to 16 CPUs. It features a modern 64-bit design, capability-based security, and cross-platform support for x86-64 and RISC-V architectures.
Note
This is not yet an operating system, but definitely has reached "toy kernel" status, since it now supports user mode preemptive multitasking on up to 16 CPUs, provides enough kernel support to run functioning device drivers in userspace, and runs on real hardware 🥳.
Anos is a modern, opinionated, non-POSIX operating system (just a hobby, won't be big and professional like GNU-Linux®) for x86_64 PCs and RISC-V machines.
Anos currently comprises the STAGE3 microkernel, SYSTEM user-mode supervisor, and a base set of servers implementing the base of the operating system. There is a (WIP) toolchain for Anos based on Binutils, GCC (16-experimental) and Newlib (with a custom libgloss).
Anos is free software licensed under the GPLv2, with similar linkage exceptions as other major free operating systems.
- Non-zealous microkernel (
"STAGE3") with scheduling, memory management, and IPC primitives - Strict system-wide capability-based security model
- User-space system management server (
"SYSTEM") provides common OS abstractions - User-space ACPI or Devicetree-based hardware discovery and driver model (WIP)
- Custom software-development toolchain (based on binutils, GCC and Newlib)
- Requirements (theoretical min/max): 1 core, 256MiB RAM / 16 cores, 127TiB RAM
As far as the Kernel is concerned, there's much to still be decided, and most of what has been decided could still change without notice. Since this is being designed as 64-bit from the beginning, there's a lot of things I can do that I wouldn't otherwise be able to, and I'm experimenting with a few different ideas.
Decisions taken so far include a non-zealous microkernel providing only bare-minimum drivers for hardware used in the kernel itself (CPU, Timers like HPET/TSC, Interrupts like LAPIC/MSI). It handles physical/virtual memory management, thread/process management, and synchronous zero-copy IPC.
The system uses a delegatable capability-based syscall control. Most user processes have very limited syscall capability and instead use fast IPC to request services from the user-mode supervisor. The supervisor itself is endowed with all capabilities and is responsible for delegating them appropriately to other processes.
Scheduling is currently handled by a simple prioritised round-robin scheduler. SMP is supported on x86_64 up to 16 cores, while RISC-V SMP is currently a work in progress. The project requires a custom toolchain based on GCC 16-experimental to build.
Source: Hacker News












