Hysen Labs
Open-source project
kazah-png/nyx-os avatar
kazah-png

nyx-os

x86_64 higher-half kernel with multitasking, GUI compositor, TCP/IP networking, EXT2 filesystem, ELF userspace and full app suite

26 stars5 forksCGPL-2.0
DEEP OPEN-SOURCE ANALYSIS

NyxOS: a from-scratch x86_64 operating system with a GUI desktop

NyxOS is a from-scratch x86_64 operating system written in C and Assembly that boots to a windowed desktop and a self-hosting C toolchain.

What NyxOS is

NyxOS is a from-scratch x86_64 operating system written in C and x86_64 Assembly with no external libraries. It boots via Multiboot, which is GRUB, into long mode with 4-level paging and full user and kernel isolation. The kernel provides preemptive multitasking, a ring-3 POSIX-style userspace, a real TCP/IP network stack, a windowed desktop, and an in-OS C compiler that builds and rebuilds itself entirely inside the running system. The README shows a nyxfetch screen with the OS name, kernel version, uptime, shell, resolution, desktop, terminal, CPU, memory, processes, disk, network, keymap, and time. The desktop components share a Nyx family naming: Hemera is the compositor, Erebus is the terminal, Selene is the browser, and nyxsh is the shell. NyxOS is not only a QEMU target. The README states it boots on a physical UEFI machine all the way to the desktop, shown running on an 8-inch Intel Core i5-1035G7 handheld booted from USB and running from RAM. The NyxOS-uefi.iso release image boots via GRUB-EFI into a GOP framebuffer. The project is explicit that it is experimental hobby software provided as is, with no warranty, which sets the right expectation for anyone who tries to run it on real hardware. Running from RAM on real hardware shows the kernel is not just a simulator toy, since it boots a handheld to a usable desktop without any emulation involved.

Kernel, memory, and userspace

The kernel runs x86_64 long mode with a GDT and IDT, 4-level paging, and a higher-half kernel mapping. It uses a bitmap physical allocator plus a 16 MB kernel heap, with per-process page directories. User and kernel page-table isolation uses NX and SMEP, and CR3 switching happens in the interrupt, IRQ, and syscall paths. The scheduler is a preemptive weighted round-robin running at 1000 Hz on the PIT, with fault isolation so a ring-3 fault kills only that process and never the kernel. SMP multi-core support lets application processors run scheduled kernel threads and ring-3 processes in parallel behind real spinlocks with TLB-shootdown inter-processor interrupts. Userspace is ring 3 with an ELF64 loader and initramfs, 57 syscalls through syscall and sysret, copy-on-write fork, execve, waitpid, anonymous pipe, dup2, and POSIX signals. It supports demand-paged sbrk, anonymous and file-backed mmap, munmap, and mprotect, a shared ELF libc mapped once into every process, runtime dlopen and dlsym, and a userspace shell with pipelines, job control, globbing, and quoting. The surface is broad for a from-scratch kernel and shows a real attempt at POSIX compatibility. The 57 syscall count is a concrete measure of how much of a POSIX surface the kernel actually implements for user programs that want to run on the system.

Toolchain, network, and desktop

The in-OS toolchain ports TinyCC to compile C to native ELF entirely inside NyxOS through a cc builtin. It is self-hosting: the in-OS compiler compiles its own source, and cc --self then builds programs with that self-built compiler, rebuilding real coreutils and the shell byte-identically to their cross-compiled originals. A package manager named xbm installs a package from its recipe with cc and places it in a bin directory. The network stack includes an RTL8139 driver, ARP, IPv4, ICMP for ping, a DHCP client, UDP, and a full TCP state machine with retransmission, passive open, and eight concurrent connections. Ring-3 BSD sockets, poll for I/O multiplexing, nc, and an HTTP client round it out. The desktop uses a double-buffered compositor with 32 windows, z-ordering, drag and resize, 4 workspaces, a taskbar, and a start menu, plus a terminal, file manager, text editor, image viewer, paint, settings, and sound test. The Selene browser does HTTP over TLS with HTML and image rendering, and the original DOOM is included. The filesystem uses a ramdisk VFS plus persistent EXT2 read and write auto-mounted at a mount point, with support for 1K, 2K, and 4K blocks and sparse files. The self-hosting compiler means the OS can rebuild its own userspace, which is a strong test that the toolchain and libc are correct enough to produce working binaries.

Build, structure, and license

Building NyxOS needs an x86_64-elf cross-toolchain or host GCC with the 64-bit flag, nasm 2.14 or later, GNU make, and QEMU 8.0 or later. You clone the repo, then run `make -C kernel` on Linux or WSL, or `.uild.ps1` on Windows. Running in QEMU uses qemu-system-x86_64 with the kernel binary and 512 MB of memory, with options for a persistent disk, networking, and sound. The project structure splits the kernel into core, memory management, process, filesystem, drivers, network, crypto, image, auth, and GUI, with a user directory for the C runtime, libc, coreutils, shell, and the TinyCC port, plus tools and build scripts. Documentation covers architecture, security, process model, filesystem, syscalls, toolchain, and testing. NyxOS is free software under the GNU General Public License version 2 or later, and it bundles third-party components under their own licenses, including doomgeneric, TinyCC, web fonts, and public-domain cryptography references. The project notes it does not distribute DOOM game data and tells users to supply their own WAD file, which keeps it clear of copyright issues around game assets. The bundled third-party licenses are listed separately, so a user who ships NyxOS must account for those components as well as the GPL code in the main tree.

Editorial conclusion

NyxOS is written in C, distributed under the GPL-2.0 license, and its repository was last updated on 2026-08-24.

DEEP OPEN-SOURCE ANALYSIS

Official sources

Community notes

Community notes