aplus is a Unix-like operating system built almost entirely from scratch — a hybrid kernel with loadable kernel modules, its own drivers, and a small userspace on top. The kernel is written in C, with assembly for the architecture-specific parts; the cross toolchain builds C and C++ programs to run on it.
It started in September 2013 as a way to learn low-level and systems programming, and it is still a hobby project rather than a production system. Today it boots on x86_64 and provides a Linux-like syscall layer, a VFS with several filesystems, an lwIP TCP/IP stack, SMP multitasking and an early graphical stack — with a good deal still unimplemented.
- Hybrid kernel: modular design with loadable kernel objects, see drivers/*
- Cross-platform: arch/*, designed for cross-platform environment targets.
x86_64is the target that boots and runs today;i686andaarch64are placeholders - Multitasking: processes and threads (
fork,vfork,clone,execve) with SMP support - Virtual memory: on-demand paging with
mmap,mprotectandbrk - Filesystems: kernel/fs/, a VFS with ext2, ISO 9660, tmpfs, procfs and bindfs
- Network: kernel/network/, almost full TCP/IP Network Stack by lwIP, reachable through BSD sockets — ordinary file descriptors, so
dup2,forkinheritance andpollwork on them like any other, withgetsockname,getpeernameandget/setsockopttranslating the Linux option numbers lwIP does not share - Unix-like: Signals, Pipes, Futex, Unix domain sockets, TTY and PTY
- I/O Multiplexing:
poll,ppoll,selectandpselect - ELF: static executables; dynamic linking is not supported yet
- Linux Syscalls: Linux-like syscall layer, see SYSCALLS.md
- Linux Framebuffer: Linux-like framebuffer support, with damage-based flushing and a hardware cursor plane on adapters that provide one
- Virtio: Virtio devices (gpu, net, input, console, random) over Virtio PCI
- GUI: a display server that owns the framebuffer and the input devices, draws window decorations itself, and hands out windows to clients over a Unix socket
See FEATURES.md for more information about features.
More screenshots, from the v0.4 text console to the themed desktop, are in the screenshot timeline.
The kernel provides a basic unix environment with a minimal subset of posix stuff. It is a hybrid kernel: core subsystems are built in, while drivers are loadable kernel objects linked and started at runtime by the module loader.
- Tasking, per-CPU run queues with SMP support, signal delivery and futex-based sleeping
- Memory, kernel/mm/, physical memory manager and kernel heap on top of on-demand paging
- IPC, kernel/ipc/, spinlocks, semaphores, futexes and Unix domain sockets
- VFS, kernel/fs/, inode-based virtual filesystem with a dentry cache, and a
/procthat exposes per-process state down to the open descriptors in/proc/<pid>/fd - Network, kernel/network/, the lwIP stack wired up to the socket syscalls
- Syscalls, kernel/syscalls/, one file per entry, numbered from syscalls.json
It currently boots and runs on x86_64; support for other architectures such as i686 and aarch64 is still to be written.
Userspace is still under development. It is built from this repository plus prebuilt packages that ./configure fetches from aplus-packages, and runs as a multi-user system on a unix-like filesystem with /proc and /dev.
- Init, apps/core/init, runs the init.sh boot script
- Package manager, apps/core/pkg,
pkginstalls, upgrades and removes packages from the aplus-packages releases, tracking them in a local SQLite index - Desktop, aplus-wm, a display server that owns the framebuffer and the input devices and draws every window frame, with libui for its clients
- Audio, aplus-audiod, a sound server that mixes every client's stream onto
/dev/dsp, with libaudio for its clients - Applications, apps/sysutils, terminal, file manager, text editor, PDF and image viewer, music player, calculator, and a launcher with an optional AI assistant
- Extras, apps/extra,
kilo,nyancat, an IRC client and MesaGL demos - Tests, tests, guest-side integration tests run from the shell
- Packages, BusyBox,
dashandbash, OpenSSH,curl,git, Python, the graphics, font (fontconfig) and TLS libraries, MesaGL, NetSurf, MuPDF, Doom, a NES emulator, the Bochs PC emulator and a nativegcctoolchain
Networking works end to end: below, BusyBox httpd serves a page from the guest to a browser on the host, through port 8080 forwarded by run-qemu.
Drivers are loadable kernel objects: one directory with a main.c per module, each declaring its identity and dependencies through MODULE_NAME()/MODULE_DEPS() and exporting init/dnit entry points. The tree currently builds 37 of them, covering device-class interfaces, char and block devices, terminals, input, USB, network, video and virtio.
- Device Interface, dev/*, provides a standard interface for drivers (block, char, network, video, pci)
- AC97, platform/pc/audio/ac97, AC'97 sound card behind the OSS
/dev/dspand/dev/mixerof dev/audio - AHCI (Advanced Host Controller Interface), platform/pc/block/ahci, almost full SATA/SATAPI driver
- Bochs VGA, platform/pc/video/bochs-vga, Bochs Virtual VGA Adapter
- VMware VGA, platform/pc/video/vmware, VMware SVGA II Adapter
- Intel e1000 (Network device), platform/pc/network/e1000, Intel NIC driver
- PCNET (Network device), platform/pc/network/pcnet, AMD PCnet NIC driver
- PS/2, platform/pc/input/ps2, keyboard and mouse
- TTY, tty/*, terminal devices,
/dev/ptmxand pseudo-terminal pairs - USB, usb/*, an xHCI host stack — core enumeration and hubs, the xHCI controller, and HID boot-protocol keyboards and mice feeding
/dev/kbdand/dev/mouse - VirtIO, virtio/*, VirtIO device interfaces over VirtIO PCI — gpu with damage flushing and a cursor plane, input for absolute pointing devices, net feeding the lwIP stack and following the link state, plus console and random
Every push to main is built by the release workflow and published as the latest development release.
- Download the latest release:
release-aplus-<commit>-x86_64holds the disk image and run.sh - Requirements:
qemu-system-x86_64and UEFI firmware (ovmforedk2-ovmf)
tar xf release-aplus-*-x86_64.tar.xz
cd release-aplus-*-x86_64
./run.shFirst run prompts for:
- Architecture, disk image, UEFI firmware
- CPUs, RAM
- Virtio or emulated devices
- KVM support
- Display mode (local window or VNC)
- Opening the web dashboard (
http://localhost:8080) in the browser at boot
Settings are saved to config.txt. Edit the file or run ./run.sh --reconfigure to change settings; ./run.sh --defaults skips the questions, ./run.sh --dry-run prints the QEMU command line without running it. Use ./run.sh --help for all available options.
The guest console is written to console.log, the QEMU monitor listens on telnet 127.0.0.1:4444, and the host port 8080 is forwarded to the guest's 8080, where pymonitor serves its web dashboard.
-
Download the latest live image from the releases page. The archive is named
release-aplus-<commit>-x86_64-live.tar.xz. -
Extract it and write the image to a USB drive:
tar -xf release-aplus-*-x86_64-live.tar.xz cd release-aplus-*-x86_64-live sudo dd if=aplus.img of=/dev/sdX bs=4M status=progress conv=fsync
[!WARNING] Replace
/dev/sdXwith your USB drive's device path, such as/dev/sdb. Use the whole disk, not a partition like/dev/sdb1. Runlsblkto find the right device first. Everything on the drive will be erased. -
Boot your machine from the USB drive.
-
When the GRUB menu appears, select Advanced options and then choose an entry with built-in graphics.
Clone this repository and change working directory.
$ git clone https://github.com/kwrx/aplus
$ cd aplusNOTE: It's recommended you use a recent Linux host environment with this method.
Some packages are required for the build system; ./configure checks for all of them but xz and QEMU:
git,make,autoconf,automake(orbuild-essentialon Ubuntu/Debian)gcc,ldto compile sources and link objectspython3, withpipandvenv:./configurecreates a.venvand installs requirements.txt into itmke2fs,mkfs.vfat,mcopy,mmd,sgdisk,grub-mkstandalone,fakeroot,dd,truncate,fc-cacheto generate the hdd image —grub-mkstandalonealso needs itsx86_64-efimodules, packaged apart on some distributions (grub-efi-amd64-binon Ubuntu/Debian)tar,gzip,zip,find,awk,odfor the remaining build steps, andxzfor the archives made by./makew distqemu-system-x86_64with UEFI firmware (ovmforedk2-ovmf) to run it
On Ubuntu/Debian, you can install all of them with:
$ sudo apt install -y \
git \
build-essential \
automake \
autoconf \
dosfstools \
e2fsprogs \
mtools \
gdisk \
fakeroot \
grub-common \
grub-efi-amd64-bin \
fontconfig \
gzip \
tar \
zip \
xz-utils \
python3 \
python3-pip \
python3-venv \
qemu-system-x86 \
ovmfThen:
- Configure and check environment
$ ./configureThis opens the Kconfig menu. To build a preset from build/setup without it:
$ ./configure --kconfig x86_64- Build it
$ ./makew all- Run it
$ ./makew runUse ./makew run-headless to run without a graphical display, which is handy to capture console output.
Once booted, pymonitor serves a web dashboard to monitor and control the guest at http://localhost:8080.
- FEATURES.md — per-architecture and per-subsystem feature matrix
- SYSCALLS.md — the syscall table
- REPORT.md — outstanding
TODO/FIXMEmarkers in the tree - docs/ui/ — the display server, the wire protocol, and writing a graphical application against libui
aplus uses and depends on a large number of third-party open-source tools and libraries which are outside of this repository.
Two of them are vendored in the tree and keep their own licenses:
- lwIP (BSD-3-Clause), the TCP/IP stack under kernel/network/
- libpayload from coreboot (BSD-3-Clause), whose USB core, hub and xHCI drivers were ported to drivers/usb/
The look of the aplus-wm taskbar, with its popups growing out of the bar, was inspired by Caelestia Shell.
The graphical userspace, namely the system applications under apps/sysutils (display server, terminal, file explorer, ...) and the libui library they are built on, has been written mostly with AI coding assistants. The rest of the project is mostly hand-written, with AI assistance used here and there.
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.


