From-scratch · x86_64 · long mode

NyxOS

A 64-bit operating system written from scratch in C and x86_64 Assembly — a preemptive kernel, a windowed desktop with the Selene web browser and five games, a real TCP/IP stack, an EXT2 filesystem, and an in-OS C toolchain that self-hosts (a ported TinyCC + the xbm package manager) plus the native N language. No libraries. Just the metal.

◆ v6.4.180 LTS · v5.9.0 GPL-2.0+ 0 build warnings
x86_64long mode · 4-level paging
C + NASMzero external libraries
57syscalls
TCP/IPDHCP · DNS · HTTP · poll()
32 windowscompositor + taskbar
EXT2read / write, auto-mount
cc + xbmself-hosting toolchain + packages
🌙 Nnative language · ncc
55 KATscrypto self-tests in CI
🌙 Seleneweb browser · real HTTP
5 gamesDOOM · Tetris · Snake · Pong · Mines
NX·SMEP·SMAPW^X · ring-3 isolation
Overview

An operating system you can read end to end

NyxOS boots via Multiboot2 (GRUB-compatible), enters long mode with 4-level paging, and provides a clean foundation for kernel development: a preemptive scheduler, ring-3 userspace with ELF64 and syscalls, a windowed GUI, and a from-scratch network stack — all built up one honest, verified increment at a time.

NyxOS Desktop · window compositor
The NyxOS desktop: the Selene web browser on a live page, distinct app icons, wallpaper and taskbar
Features

What's inside the kernel

Every subsystem is written from scratch and verified in QEMU.

Boot & initialization

Multiboot2, x86_64 long mode, GDT/IDT with a full exception set, PIT at 1000 Hz, Local + I/O APIC, and PS/2 keyboard & mouse drivers.

Memory management

Bitmap physical allocator, a 16 MB kernel heap, 4-level paging with a higher-half mapping, per-process page tables, and NX + SMEP hardening.

Processes & scheduler

Preemptive weighted round-robin over kernel threads and ring-3 processes, with full shell job control — exec, spawn, jobs, wait, kill, nice.

ELF userspace

An ELF64 loader, an embedded initramfs, fork() with copy-on-write, 57 syscalls via syscall/sysret, a minimal libc, and isolated per-process file descriptors — a real ring-3 environment.

In-OS C toolchain

A ported TinyCC compiles C inside NyxOS and self-hosts — tcc compiles tcc. The cc command builds & runs C by bare name, and xbm — the package manager — compiles a recipe and installs it to /mnt/bin.

🌙

N & N++ languages

NyxOS's own languages: N (.n, built with ncc) and the typed superset N++ — HolyC-style, first-class, compiled in-OS. xbm install ncc builds the N compiler on the machine itself.

Shell

40+ built-in commands with Tab completion, environment-variable expansion, command history, I/O redirection, pipelines, job control (exec/spawn/jobs/wait/kill), and nice/renice priority control.

🖧

Networking

RTL8139 driver, ARP/IPv4/UDP/ICMP/DHCP/DNS, and a full TCP stack: retransmission with RTO, passive open (listen/accept), loopback, an HTTP client & server, nc full-duplex, and poll() I/O multiplexing.

🗔

GUI compositor

Up to 32 windows with z-ordering, drag & resize, four workspaces, drop shadows, snap-to-edge with a live preview, a taskbar and Start menu — plus a Terminal, File Manager, Text Editor, Image Viewer, Paint, Calculator, Settings and Sound Test, each with its own hand-drawn icon.

Desktop & rendering

A polished 1080p desktop with animated wallpapers (/lava, /matrix, /fire) and real-time render testbeds — Nyx Voxels and Nyx Fractal — with on-screen benchmark HUDs. Fluid, personal, unmistakably Nyx.

🌙

Selene — web browser

NyxOS browses the real internet: Selene resolves DNS, opens a TCP connection and fetches a page over HTTP, then strips the HTML to text and word-wraps it under a URL bar. DHCP, chunked-transfer decoding and scrolling included. Named for the moon goddess.

🎮

Games

A desktop Games folder with five: the original 1993 DOOM (running in a window), Minesweeper, Pong, Snake and Tetris — the last three animated in-kernel by a ~30 fps compositor game-tick.

🖴

Filesystem

A ramdisk VFS with an EXT2 read/write driver auto-mounted at /mnt, a write-through sector cache, per-fd byte offsets, and persistence across reboots on a disk image.

Multimedia

A Bochs VBE framebuffer (1024×768×32), a Sound Blaster 16 driver (DMA + IRQ + mixer), PC-speaker tones, and the original DOOM engine ported to run on the framebuffer.

🛡

Security & isolation

NX + SMEP + SMAP and W^X page permissions, per-process address spaces, a hardened syscall boundary (bounded ELF loads, validated user pointers), ring-3 fault isolation — a crash kills the process, not the kernel — and PBKDF2-HMAC-SHA256 login, backed by a from-scratch crypto library verified by 55 known-answer tests in CI.

Architecture

How it fits together

A higher-half kernel, isolated user address spaces, and an interrupt-driven core.

Boot flow

  1. GRUB / Multiboot2 hands off with a memory map + framebuffer.
  2. Long mode — GDT, 64-bit code/data, TSS, IDT with IST stacks.
  3. Paging — identity-map low memory, mirror the kernel into the higher half.
  4. Drivers — PIT, APIC, PS/2, RTL8139, ATA/EXT2, VBE, SB16.
  5. Login — PBKDF2-hashed credentials (nyx / nyx).
  6. Desktop — the window compositor launches as a scheduled process.

Memory layout

0xFFFFFF80_00000000Higher-half kernel (PML4[511])
0x00000000_00100000Kernel linked low (1 MB)
user halfPer-process, isolated (no identity map)
NX + SMEPUser pages non-exec; kernel can't run user code

Interrupt core

The PIT (ISA IRQ0) is routed via the I/O APIC on pin 2 → vector 32, driving a 1000 Hz tick. The scheduler preempts on that tick; syscalls and IRQs switch CR3 on entry so each process sees only its own address space.

Manual

Getting started

Build the kernel, boot it in QEMU, and log in.

1

Clone & build

bash · Linux / WSL
# cross-compiler (x86_64-elf-gcc) or host gcc -m64
git clone https://github.com/kazah-png/nyx-os.git
cd nyx-os
make -C kernel        # → kernel/nyx-kernel.bin
PowerShell · Windows
.\build.ps1           # WSL cross-compile → kernel + bootable ISO
2

Run in QEMU

bash
# GUI desktop + networking + disk
qemu-system-x86_64 -cdrom NyxOS.iso -m 256M -no-reboot \
  -hda ext2-test.img -nic user,model=rtl8139 -display sdl

Serve HTTP from the guest by forwarding a host port: add hostfwd=tcp::8080-:80 to the NIC, run tcpserve 80, then curl localhost:8080.

3

Log in

The boot animation leads to a framebuffer login screen. The default account is nyx / nyx (PBKDF2-HMAC-SHA256). On success, the NyxOS Desktop launches; with no disk, it falls back to a text shell.

Command reference

The built-in shell — also available in the Terminal window.

CategoryCommands
Systemhelp clear nyxfetch uname date version reboot history env export
Filesls cd pwd cat touch mkdir rm cp mv head tail grep sort wc find tree write which diff hexdump
Processesps mem exec spawn jobs wait kill nice renice usertest pmap free
Toolchaincc xbm ncc tcc · compile & run C in-OS; xbm install <pkg> builds a recipe into /mnt/bin
Networkifconfig dhcp ping setip httpget tcptest tcpdrop tcploop tcpserve nc
Apps & gamesselene doom pong snake tetris · plus a desktop icon for each & a Games folder
Filesystemmount · EXT2 auto-mounts at /mnt
Graphics & soundgui desktop mode fonttest beep play sb16play
Networking

A real TCP/IP stack

From the NIC driver up to an HTTP server — every layer written and debugged from the wire.

HTTP · DNS · Selene · ncweb browser, client, server, full-duplex poll()
TCPretransmit (RTO) · listen/accept · userspace sockets
UDP · ICMPdatagrams · userspace sockets · echo (ping) with RTT
IPv4checksum · routing · loopback delivery
ARP · Ethernetcache · frames
RTL8139PCI NIC · TX/RX rings

Highlights

  • 🌙 Selene web browser — resolves DNS, connects over TCP and fetches a real page by HTTP, decodes chunked transfer encoding, and renders the HTML to scrollable text under a URL bar.
  • DHCP client — DISCOVER → OFFER → REQUEST → ACK, auto-configures IP, netmask & gateway.
  • ping with statistics — real round-trip timing, per-packet sequencing, and a min/avg/max + loss summary. NyxOS also answers echo requests.
  • TCP retransmission — each connection buffers its outstanding segment and resends it on an RTO with exponential backoff; a lost SYN or data segment recovers automatically.
  • Passive openlisten/accept spawn per-client connections. tcpserve answers a real curl from the host with HTTP/1.1 200 OK.
  • Userspace socketssocket/connect/sendto/recvfrom/bind/listen/accept for both TCP and UDP from ring 3.
  • poll() I/O multiplexingSYS_POLL (syscall 43) waits on sockets, pipes, and stdin with timeout. Powers full-duplex nc.
  • nc (netcat) — full-duplex TCP/UDP client and TCP server, bridging stdin/stdout via poll().
  • Loopback — a self-contained 127.0.0.1 path lets the whole stack be tested in-guest (tcploop, ping 127.0.0.1).
Releases

The road so far

Every increment from a from-scratch kernel to a networked desktop OS with a web browser and five games.

v1.x

Foundations

Base kernel, ramdisk VFS + shell commands, and the first real networking (RTL8139, ARP/IP/UDP/ICMP).

v2.x

Multitasking, GUI & disks

Preemptive multitasking, a full TCP stack, the window compositor, PC-speaker audio, EXT2 read support, and a Sound Blaster 16 driver.

v3.x

Userspace

ELF loader, initramfs, per-process paging, ring-3 execution, syscalls, an RTC driver and a minimal libc.

v4.x

64-bit & hardening

Full x86_64 long mode, a higher-half kernel, user/kernel page-table isolation, and NX + SMEP with APIC init.

v5.0–5.7

Apps, login, ring-3 & the network arc

A full GUI app suite, a boot animation + login screen, syscall-boundary hardening, ring-3 userspace that actually runs, preemptive scheduling with job control, and a networking sprint — loopback + ICMP, TCP retransmission, passive open, and an HTTP server that answers real clients.

v5.8

A complete ring-3 environment

The native language runtime, waitpid(), anonymous pipes & blocking IPC, signals with setjmp/longjmp recovery, poll() I/O multiplexing, nc, persistent EXT2 accounts, and the root-cause fix of the pipeline-corruption Heisenbug (a firmware-hole page-allocator bug).

v5.9.0 · LTS

The stable baseline — P0.1 closed

The one release-blocking bug root-caused and fixed with a single cli, closing the preemptible window between the user-CR3 reload and iretq. Plus a GUI/VFS/ext2 hardening sweep and the first SMP stages (per-CPU TSS, spinlocks, TLB-shootdown IPIs). The long-term-support release.

v5.9.x

"Nightfall" desktop · DOOM · five games · Selene

A central GUI palette in brand purple, modern window chrome (shadows, gradients, rounding), keyboard window management & snapping. The original 1993 DOOM ported and playable in a window, joined by Tetris, Snake, Pong and Minesweeper. And 🌙 Selene — the NyxOS web browser — fetches and renders real pages over DHCP + DNS + TCP + HTTP.

v6.0–6.1

daedalOS pivot — Phase 1: the desktop

The push toward a fully-functional daedalOS-style desktop OS: a polished 1080p desktop, visual file management, a Windows-like clean menu, and multi-session groundwork — all keeping the Nyx night-goddess identity.

v6.2–6.3

Phase 2: an in-OS C toolchain that self-hosts

TinyCC 0.9.27 ported to run inside NyxOS — tcc compiles tcc. The cc command and the xbm package manager compile C from a recipe and install it to /mnt/bin, runnable by bare name. The everyday install/remove/update/search/list verb set is complete.

v6.4.180

Languages, IRQ-driven networking & render testbeds — current

The native N language (.n / ncc) and the typed superset N++ with static checks; RTL8139 moved toward interrupt-driven RX/TX with a real retransmit queue and SMP-safe TCP; the Nyx Voxels and Nyx Fractal render benchmarks and animated wallpapers; AES Key Wrap (RFC 3394) landing a 55-KAT crypto battery in CI; and a steady security issue burn-down — one honest, verified increment at a time.

Follow the build

NyxOS is developed in the open, one verified increment at a time. Join the Discord for kernel-dev chat, or dive into the source and status report on GitHub.