01 Linux ABI is the native ABI
Not an emulation layer bolted on the side. There is no second “own” syscall interface to maintain.
Early development · 6 of 11 phases done
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.
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
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.
Design
Not an emulation layer bolted on the side. There is no second “own” syscall interface to maintain.
All unsafe lives in the HAL and a few audited modules; the rest is #![forbid(unsafe_code)]. No IPC cost per syscall.
DRM/KMS ioctls, evdev and ALSA, so Mesa, libinput and PipeWire work without changes.
A syscall conformance suite compared with real Linux, plus an application ladder from BusyBox up to Steam.
Status
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.
syscall entry, FPU/SSE state per threadmmap, brk/dev devicesls | grep | wc worksfork with copy-on-write, execve, wait4, process groupspoll/select, symbolic links, /proc^Cmount/umount, a block cache, a page cacheMAP_SHARED file mappingse2fsck passes what SegOS writesld-linux.soclone, TLS, a complete futexepoll, eventfd, timerfd, signalfdcurl fetches over HTTPS; ssh logs in to another machineSCM_RIGHTS, netlink for ipmemfd, mremap, flock, a udev-shaped /sysinotify, seccomp, namespacesDone when Firefox and Chromium run.
Try it
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.
sudo apt install qemu-system-x86 ovmf musl-tools git
git clone https://github.com/SegMind25/SegOS
cd SegOS
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