From-Scratch · x86_64 · Long Mode

NYX OS

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, a real TCP/IP stack, an EXT2 filesystem, and an in-OS C toolchain that self-hosts (TinyCC + xbm) plus the native N language. No libraries. Just the metal.

◆ v6.4.180 LTS · v5.9.0 GPL-2.0+ 57 Syscalls
NyxOS Desktop · Window Compositor 1080p @ 60Hz
RUNNING
NyxOS 1080p Desktop Compositor with Selene Browser and App Suite
nyx:root — terminal (PID 6)
$ uname -a
NyxOS nyx-core 6.4.180 #1 SMP PREEMPT x86_64
CR3: 0x0000000000100000 | PML4[511] HIGHER-HALF
$ selene https://nyxos.cc
HTTP/1.1 200 OK — Decoded chunked stream
57 SYSCALLS ACTIVE APIC: 1000 Hz
Selene Web Browser (DNS + TCP + HTTP)
Taskbar & Process Manager
4 Virtual Workspaces (Z-Ordered Compositor)
nyx:root — shell interactive
nyx:root / #
Quick: nyxfetch uname -a cat /etc/os-release help selene ping 127.0.0.1 ps cc hello.c clear
Core Systems

Kernel Architecture Pipeline

An interrupt-driven higher-half monolithic kernel engineered from first principles in C and NASM Assembly. Zero external runtime libraries.

01

Boot & Initialization

Multiboot2 hand-off with memory map & framebuffer. Enters 64-bit Long Mode, sets up GDT/TSS, IDT with IST stacks, and 1000 Hz APIC timer.

GDT · IDT · APIC · PIT · PS/2
CR0.PG = 1 · EFER.LME = 1
02

Memory Management

Bitmap physical page frame allocator, 16 MB kernel heap, 4-level paging with PML4[511] higher-half mapping, and NX + SMEP page permissions.

PML4 · PDPT · PD · PT · Heap
CR3: 0x100000 (Base)
03

Processes & Scheduler

Preemptive weighted round-robin scheduling over kernel threads and ring-3 processes. Full job control: exec, spawn, jobs, wait, kill, and nice.

Context Switch · TSS · RSP0
APIC IRQ0 Vector 32
04

ELF Userspace & 57 Syscalls

ELF64 loader, embedded initramfs, fork() with COW, 57 atomic syscalls via syscall/sysret, minimal libc, and isolated per-process file descriptors.

ELF64 · Ring-3 · MSR_LSTAR
RCX = RIP · R11 = RFLAGS
05

Filesystem & VFS

Ramdisk VFS with full EXT2 read/write driver auto-mounted at /mnt, write-through sector cache, per-fd offsets, and persistence across reboots.

EXT2 Inodes · VFS Nodes · ATA
Auto-mount: /mnt
06

Network Subsystem

Realtek RTL8139 PCI NIC driver with TX/RX rings, ARP cache, IPv4 routing, ICMP echo, UDP datagrams, and full TCP with exponential RTO.

RTL8139 · TCP · UDP · poll()
DHCP · DNS · Loopback
Hardware Inspector

x86_64 Register & Syscall Transition

MSR_LSTAR (0xC0000082)
sys_write (#1) sys_read (#0) sys_fork (#57) sys_poll (#7) sys_socket (#41)
RAX (Syscall ID)
0x0000000000000001
RDI (Arg 1)
0x0000000000000001 (fd = STDOUT)
RSI (Arg 2)
0x0000000040001080 (buf)
RDX (Arg 3)
0x000000000000002A (count = 42)
R10 (Arg 4)
0x0000000000000000
R8 (Arg 5)
0x0000000000000000
sys_write (Syscall #1) Ring 3 (Userspace) ➔ Ring 0 (Kernel)

Writes up to count bytes from buffer to open file descriptor. Checks user-space memory pointers before committing to VFS/framebuffer driver.

Memory Management Unit

4-Level Paging (PML4 ➔ PT Translation)

64-bit Virtual Address:
Level 4 (Bits 47:39)
PML4[511]
Level 3 (Bits 38:30)
PDPT[510]
Level 2 (Bits 29:21)
PD[0]
Level 1 (Bits 20:12)
PT[256]
Page Offset (11:0)
Offset: 0x000
Mapped Physical Frame: 0x0000000000100000 [Present · R/W · NX=0]
Human Interface

The 1080p Desktop & Selene Browser

NyxOS renders a double-buffered 1080p compositor with live window dragging, drop shadows, and Selene — a native web browser that fetches live web pages over TCP/IP.

NyxOS Desktop Compositor Running Live Applications
32
Z-Ordered Windows
Double-buffered compositor with snap-to-edge preview, drag, resize, and drop shadow blending.
4
Virtual Workspaces
Switch seamlessly between application workflows with instant state caching.
1080p
High-DPI Framebuffer
Powered by Bochs VBE driver with 32-bit true color palette and smooth 60fps refresh.
SB16
Audio Subsystem
Sound Blaster 16 driver with DMA transfer, IRQ routing, and multi-channel mixing.
← → ↻
GET
Status: 200 OK RTL8139 · TCP Sockets · HTML Tokenizer
Wire Protocol

A Real TCP/IP Stack

Every layer from PCI NIC ring descriptors up to an HTTP/1.1 server. Includes full-duplex nc and poll() I/O multiplexing.

L7 HTTP · DNS · Selene · tcpserve
Browser, Web Server, Chunked Transfer
L4 TCP (Transmission Control Protocol)
Exponential RTO, Listen/Accept, Sockets
L4b UDP · ICMP
Datagrams, Ping Echo with RTT Statistics
L3 IPv4 (Internet Protocol)
Header Checksum, Routing, Loopback (127.0.0.1)
L2 ARP & Ethernet II
Dynamic ARP Cache, MAC Framing
L1 Realtek RTL8139 Driver
PCI Configuration, TX/RX Ring Buffers
Interactive Packet Dispatcher LIVE WIRE
[00:00:01] rtl0: Link up 100Mbps full-duplex (PCI 00:03.0)
[00:00:02] DHCP: Bound IP 10.0.2.15 Netmask 255.255.255.0 Gateway 10.0.2.2
[00:00:03] TCP Stack ready. Listening on socket 0.0.0.0:80 (tcpserve)
Developer Ecosystem

In-OS C Toolchain & Compilers

NyxOS self-hosts. A ported TinyCC 0.9.27 compiles C code directly inside the operating system (tcc compiles tcc), paired with the xbm package manager and native N compiler.

[C]
Self-Hosting C

TinyCC 0.9.27 Compiler

Ported to run inside NyxOS ring-3 userspace. Emits 64-bit ELF executables directly to the EXT2 filesystem. Compiles and executes C applications in milliseconds with zero host dependencies.

tcc compiles tcc ELF64 Generator 0 Host Dependency
[PKG]
Package Manager

xbm Package Manager

The native binary package manager for NyxOS. Resolves recipe dependencies, manages disk storage in /mnt/bin, and installs user applications with checksum validation.

xbm install Recipe Engine EXT2 /mnt/bin
[N]
Native Language

The N & N++ Language

The native programming language designed specifically for NyxOS low-level applications. Compiled via ncc into fast, statically verified native machine code.

ncc Compiler Strict Typing Zero Runtime Overhead
[VFS]
VFS & Graphics

EXT2 VFS & Bochs VBE Graphics

Persistent EXT2 filesystem with inode caching, sector write-through buffers, and hardware-accelerated 32-bit RGB framebuffer drawing primitives for graphics development.

EXT2 Inodes VBE 32-bit RGB DMA Audio SB16
In-Browser Compiler Sandbox TinyCC 0.9.27 + ncc
Ready to compile. Press "[RUN] Compile & Run".
Target: ELF64 · Isolated Ring-3 Memory
Formal Verification
55
Known-Answer Tests in CI

Every build executes an exhaustive cryptographic test suite verifying PBKDF2-HMAC-SHA256, AES Key Wrap (RFC 3394), and SHA-256 primitives against NIST CAVP standards with zero warnings.

nyx-crypto-testbed (FIPS 180-4 / RFC 3394) 55/55 Verified
[PASS] PBKDF2-HMAC-SHA256 (Iteration 4096) 100% OK (RFC 6070)
[PASS] AES-128 Key Wrap (RFC 3394) 40-byte payload 100% OK (NIST CAVP)
[PASS] SHA-256 FIPS 180-4 1M "a" Repetition 100% OK (FIPS 180-4)
[PASS] HMAC-SHA256 Variable Key (128-byte pad) 100% OK (RFC 4231)
[PASS] Chroot Path Normalization & User Pointer Check 100% OK (Kernel Ring-3)
Documentation

Getting Started with NyxOS

Build the kernel, boot the ISO in QEMU, forward network ports, and log in to the desktop.

1

Clone & Compile

Requires x86_64-elf-gcc or host GCC with 64-bit support.

bash
git clone https://github.com/kazah-png/nyx-os.git
cd nyx-os
make -C kernel
2

Run in QEMU

Launches with GUI desktop, RTL8139 NIC, and EXT2 disk image.

QEMU Command
qemu-system-x86_64 -cdrom NyxOS.iso \
-m 256M -nic user,model=rtl8139 \
-display sdl
3

Log In to Desktop

PBKDF2-HMAC-SHA256 authenticated default credentials.

Default Credentials
Username: nyx
Password: nyx
One-Click Hardware Setup

QEMU Launch Command Generator

qemu-system-x86_64 -cdrom NyxOS.iso -m 256M -smp 2 -nic user,model=rtl8139 -audiodev dsound,id=snd0 -device sb16,audiodev=snd0 -vga std -display sdl
Category Commands Description
System
help clear nyxfetch uname date version reboot
System information, kernel version, diagnostics, clock, and ACPI reboot.
Files
ls cd pwd cat touch mkdir rm cp mv grep
VFS & EXT2 file manipulation, searching, directory traversal, and stream output.
Processes
ps mem free exec spawn jobs kill
Preemptive process monitoring, memory layout inspect, job control, and signal dispatch.
Toolchain
cc xbm ncc tcc
In-OS C compiler & runner, package manager (xbm install), and N language toolchain.
Network
ifconfig dhcp ping setip tcptest tcpserve nc
IP configuration, DHCP lease, ICMP echo with RTT, TCP client/server, and full-duplex netcat.
Applications
selene editor paint calc gui
Launch Selene web browser, graphical text editor, paint studio, and window compositor.
The Bare-Metal Manifesto

BUILD IT. UNDERSTAND IT. OWN IT.

NyxOS. From scratch. No libraries. Just the metal.