Early development · 6 of 11 phases done

A new operating system in Rust that speaks Linux.

SegOS is a kernel written from scratch whose native interface is the Linux system call ABI. The goal: run the applications people already use, unmodified, and Windows programs through Wine and Proton. Today it boots with its own bootloader, runs on every CPU, and gives you a shell: BusyBox, exactly as Ubuntu ships it, with pipes, job control and ^C. Real disks are next.

A BusyBox shell session on the SegOS screen console. uname -a prints: Linux segos 6.6.0-segos-0.1.0 #1 SegOS 0.1.0 x86_64 GNU/Linux. ls /bin | grep sh | wc -l prints 3. hello prints Hello, world! echo $((6 * 7)) | tee /tmp/answer; cat /tmp/answer prints 42 twice. sleep 1 & ps lists init, two shells and ps. free -m shows 502 MB total, 485 free. cat /proc/version prints: Linux version 6.6.0-segos-0.1.0 (SegOS 0.1.0, a kernel written in Rust that speaks Linux).
SegOS today, in QEMU: Ubuntu’s BusyBox shell on the kernel’s own screen console. ls /bin | grep sh | wc -l is the Phase 3 demo; ps and free read /proc; hello is a musl program built on Linux. Full 1280×800 screenshot.

The idea

Why the Linux ABI means “runs every application”

The programs people actually use (Steam, Firefox, Chromium, Discord, Blender, LibreOffice) already exist as Linux x86-64 binaries. Nobody is going to port them to a new operating system. So instead of asking applications to change, SegOS changes the kernel.

The kernel loads the same ELF files and answers the same system calls, with the same numbers, structures and error codes, and provides the same /proc, /sys and /dev files programs read. Unmodified glibc or musl sits on top, and the application cannot tell the difference.

Windows software then comes along the same way it does on Linux today: Wine and Proton are Linux programs.

This is the route taken by gVisor, Asterinas, Kerla and Maestro, and by FreeBSD’s and Windows’ (WSL1) Linux layers. It is the realistic way for a new kernel to reach real software.

  1. Unmodified applicationsbash, coreutils, Mesa, Firefox, Steam, Wine/Proton
  2. glibc / muslunmodified C libraries
  3. syscall boundary · Linux ABI
  4. written in Rustsegkernellinux-abi · process · mm · vfs · net · drivers · sched
  5. the small unsafe coresegkernel-halx86-64: GDT/IDT, APIC, ACPI, PCI(e)
  6. written in Rustsegbootits own UEFI bootloader

Design

Four decisions that shape everything

01 Linux ABI is the native ABI

Not an emulation layer bolted on the side. There is no second “own” syscall interface to maintain.

02 Monolithic, small unsafe core

All unsafe lives in the HAL and a few audited modules; the rest is #![forbid(unsafe_code)]. No IPC cost per syscall.

03 Drivers speak Linux’s interfaces

DRM/KMS ioctls, evdev and ALSA, so Mesa, libinput and PipeWire work without changes.

04 Measured against real software

A syscall conformance suite compared with real Linux, plus an application ladder from BusyBox up to Steam.

Status

Where it is right now

Each phase ends with a demo that has to work in QEMU and in CI. Phases 0 to 7 have passed; Phase 8, desktop applications, is next.

Phases 0–1 · Bring-up, multitasking Done

  • Boots on UEFI with segboot, its own bootloader
  • No third-party crates: all of the OS is in the repository
  • Exceptions, frame allocator, paging, kernel heap
  • APIC timer, preemptive scheduler on every CPU
  • Spinlocks, sleeping mutexes, wait queues

Phase 2 · First user program Done

  • Ring 3, syscall entry, FPU/SSE state per thread
  • Address spaces with demand paging, mmap, brk
  • ELF loader and the Linux initial stack (argv, envp, auxv)
  • initramfs unpacked into tmpfs; /dev devices
  • A musl hello world built on Linux runs unmodified

Phase 3 · A shell Done

  • Ubuntu’s BusyBox runs unmodified; ls | grep | wc works
  • fork with copy-on-write, execve, wait4, process groups
  • Signals delivered to handlers, SA_RESTART, stop and continue
  • Pipes, poll/select, symbolic links, /proc
  • A terminal: keyboard and serial input, line editing, ^C
  • 140 Linux system call numbers; 3 tests match Linux byte for byte

Phase 4 · Real storage Done

  • Boots from an ext4 root file system on disk, read-write
  • PCI; virtio-blk, NVMe and AHCI (SATA) drivers
  • GPT partitions; ext2/3/4 with journal replay; FAT32
  • mount/umount, a block cache, a page cache
  • Real MAP_SHARED file mappings
  • Linux’s e2fsck passes what SegOS writes

Phase 5 · The full Linux userland Done

  • Unmodified bash, GNU coreutils, Python 3.13 and gcc run
  • gcc compiles a C program on SegOS, and it runs
  • glibc programs, dynamically linked by ld-linux.so
  • Threads: clone, TLS, a complete futex
  • epoll, eventfd, timerfd, signalfd
  • Interrupt-driven disk I/O (MSI-X)

Phase 6 · Networking Done

  • Ubuntu’s curl fetches over HTTPS; ssh logs in to another machine
  • Its own TCP/IP stack in Rust: Ethernet, ARP, IPv4, ICMP, UDP, TCP, DHCP
  • A virtio-net driver with MSI-X interrupts
  • Sockets: AF_INET, AF_UNIX with SCM_RIGHTS, netlink for ip

Phase 7 · Graphics and input Done

  • Ubuntu’s weston (Wayland) runs, kiosk and desktop shells, with clients
  • DRM/KMS on the firmware framebuffer: dumb buffers, page flips
  • evdev keyboard and PS/2 mouse, found by libudev and libinput
  • memfd, mremap, flock, a udev-shaped /sys

Phase 8 · Desktop apps Next

  • Sound, inotify, seccomp, namespaces
  • GPU drivers (virtio-gpu, then AMD/Intel)

Done when Firefox and Chromium run.

All 11 phases, from bring-up to Steam →

Try it

Build it yourself

You need Rust (the version is pinned in rust-toolchain.toml), QEMU, OVMF and musl-gcc. The bootloader, the kernel and the tool that writes the disk image are all in the repository, in Rust. What runs on it is ordinary Linux software: the first build fetches Ubuntu’s busybox-static with apt-get download, and musl-gcc builds the test programs in userland/.

What you will see is the console above: a shell, on the QEMU window and on your terminal. Everything lives in memory (no disk yet), and poweroff -f turns it off.

Dependencies on Debian or Ubuntu
sudo apt install qemu-system-x86 ovmf musl-tools git
Get the source
git clone https://github.com/SegMind25/SegOS
cd SegOS
Build, boot and test
cargo xtask run          # build the disk image, boot it: a shell
cargo xtask test         # tests on Linux, in the kernel, in the shell
cargo xtask image        # target/segos.img, for a USB stick