Version 1, Kurono Kintsugi, is on the way

x86_64  /  freestanding C++17 and assembly  /  GPL v2

An operating system, written from scratch.

Kurono has its own kernel, drivers, filesystem, network stack and desktop. It also answers Linux system calls well enough that the normal Linux builds of Firefox 140, Claude Code and OpenCode run on it, unchanged. There is no Linux kernel anywhere underneath.

Kurono
Thu 5 Nov 9:41 PM
Terminal
[kurono] user@kurono-machine:/home/user$
Task Manager
ProcessesPerformanceDetailsServices
CPU4%

Intel(R) Core(TM) Ultra 7 255HX

Memory7%

2318 / 32768 MB

Cores
Disk

read 0 KB/s  write 0 KB/s

Network

down 0 KB/s  up 0 KB/s

fib.kcl
# fibonacci
func fib(n)
  if n < 2 then
    return n
  end
  return fib(n-1) + fib(n-2)
end
for i in 0..10 do
  print(fib(i))
end
Home
Calculator
0
System Settings
Style
Interface
ModernClassic
Icons
ColorfulMinimal
Window motion

ui.style, ui.icons

FIG 0.1

A copy of the Kurono desktop in HTML, using its real icons and window springs. Drag the windows, use the dock, or type help in the terminal. The commands and numbers are made up; the look and the motion are the real thing.

Kurono Kintsugi

Version 1Soon

Kintsugi is the Japanese craft of mending broken pottery with gold. Version 1 carries the name because most of Kurono is being taken apart and rebuilt for it.

  • SchedulerWork spread over every core
  • MemoryCompressed memory with KMemX
  • DriversUnmodified Linux drivers in their own containers
  • DesktopWindows that minimize into the dock

Part 4

What changed since Part 3

Most of this update is groundwork. The laptop uses all 20 of its cores now, Wi-Fi runs on an unmodified Linux driver, Linux VMs put their windows on the desktop, and Kurono can build its own kernel. Kintsugi version 1 isn't out yet.

All 20 cores

Every core on the laptop comes up by default now. Two bugs were in the way. cpu 0's old PIT tick turned into stray interrupts while the other cores signalled each other, and two kernel locks were taken in opposite orders. In QEMU, freezes went from 5 in 94 boots to 0 in 94.

Less time on the big lock

Most system calls used to run under one global kernel lock. Phase 1 moved memory, page faults, fork, exec, signals, poll, files and ptys to locks of their own, and each one has a boot flag to switch it back. In a 140 s fork-and-exec stress test in a VM, time spent waiting on the global lock went from 50.7 s to 2.5 s.

Linux drivers, unmodified

KLD builds an upstream Linux driver as is and runs it in ring 3, with the IOMMU limiting what it can reach. Intel's iwlwifi connects to Wi-Fi on the laptop's BE200. Intel's i915 gets through a mode change against a simulated GPU.

Linux VMs

Alpine 3.23 or Debian 13 runs in the background with 4 vCPUs and sound. Its apps, Firefox ESR included, open as ordinary Kurono windows. The laptop's NVIDIA GPU can be handed to the Debian guest. That part is built, but I haven't tried it on the real card yet.

Building Kurono on Kurono

The devkit has gcc 14, binutils, make and gnu-efi, enough to build Kurono's kernel and UEFI loader on Kurono itself. kos kernel install boots the new kernel as a trial. If it doesn't reach the desktop, the next boot goes back to the old one.

The terminal

It handles mouse reporting, synchronized output and full-screen programs the way xterm does. Ctrl+Shift+N opens another window, each with its own process and pty, and terminals from the Linux VM open next to them.

Crash records and Recovery

A kernel panic saves a crash record that survives the reboot, and kos crash shows it with the stack. If a kernel keeps panicking early in boot, you land in Recovery. From there you can repair startup from those records, boot the previous kernel or start in safe mode.

Boot and lock screen

The boot animation draws the logo, breaks it and mends it with gold. The lock screen has smoke drawn live behind it, and signing in springs straight into the desktop.

Kurono is about 370,000 lines of its own code now, not counting third-party and generated files. An idle desktop uses about 440 MB of RAM in QEMU. Unless something says the laptop, I tested it in QEMU with KVM.

Part 3

Part 3, from November 13

Infrastructure for Kintsugi. Some of it is held back until I've fixed the bugs I know about.

OpenCode

The stock linux-x64-musl build runs, interface and tools included. Type opencode. It needs musl's C++ runtime, which Kurono loads from two files on the KURONO partition.

Claude Code stopped freezing

Its garbage collector stops threads with a signal, and a thread waiting in a futex never woke up for it. A caught signal ends the wait now, and a 2 h 50 min session ran without a freeze. I also fixed a vfork bug that garbled Firefox's environment: 0 of 13 boots crashed with Claude running, against 4 of 12 before.

Everyday Linux fixes

cat printed nothing, cp made empty files, pipes lost everything past 64 KB, symlinks didn't resolve and every file was dated 1970. All fixed. A directory holds 65,536 entries now, up from 512.

Alpine on 4 vCPUs, and Debian 13

On machines with 12 or more CPUs, Alpine gets up to 4 parallel vCPUs, and four jobs ran about 3x faster. Debian 13 boots all the way. Guest RAM is backed on first touch, and guest disks grow in 64 MB chunks.

A nested Kurono

vm kloop builds a kernel inside the Alpine guest and boots it as a nested Kurono. A repeat run takes about 76 s. A PCI device can be passed through to a guest, and kld reload swaps a driver container in about 2 s without a reboot.

amdo

The privilege command is called amdo now. ken, supr and sudo still work as hidden aliases. For now KSA can be switched off in Settings, under Users & Security, Approval.

Intel GPU fixes

A blit batch hazard drew wrong pixels on the real iGPU, and there were stale column and shadow leaks. All fixed. A check that compares partial redraws with full ones at 17 checkpoints finds no mismatches, and dragging a window moves 49 MB/s instead of 184.

Less kernel memory

Kernel allocations of 256 KB and up come straight from page frames. Fifty minutes into a Claude Code session the kernel heap was 196 MB instead of 375 MB, and Firefox settles with about 470 MB more free.

Also in Part 3: Wi-Fi through KLD on the laptop's BE200, a touchpad stack, network time, a boot log on disk that keeps the whole session, and socket tables that grow from 48 to 4096 entries. Tested in QEMU with KVM unless it says otherwise.

Motion

Windows open on four springs

When a window opens, the dock tile becomes the window. One damped spring drives each of x, y, width and height. Y lags x, so the window arcs up out of the dock, and width and height each overshoot once. The tile's colour hands off to the window's, and the real content fades in at full size, clipped to the growing rect.

The constants on this page are copied from src/ui/wm_motion.cpp, where the kernel keeps them as 65-sample tables.

x
0.34 s
0.86
y
0.42 s
0.80
width
0.32 s
0.74
height
0.38 s
0.78
spring
response
damping
FIG 0.2progress over 620 ms
0155310465620 ms
x(t) = 1 - e-ζωt (cos ωdt + ζω/ωd sin ωdt),  ω = 2π / response
Terminal
[kurono] user@kurono-machine:/home/user$
FIG 0.3

Try it

Change the y spring and open the window again. The other three stay at Kurono's values.

settles in 0 ms

How it fits together

Scroll through the stack

  1. The stack

    No Linux kernel, and no libc in the kernel

    Linux programs talk to Kurono's syscall layer, and Kurono's own apps call the kernel directly. Under that are the scheduler, memory, the filesystems, TCP/IP and the compositor, then the drivers, then the hardware. Hover a box to see what it talks to.

  2. Scheduler and cores

    A vruntime scheduler with per-CPU dispatch

    Normal, FIFO, round-robin and idle classes, per-CPU timers, and preemption in ring 3 and at syscall exit. On the laptop all 20 cores run by default, and kernel services keep a core to themselves so programs can't starve them.

  3. Wayland

    Firefox draws into shared memory, and the kernel composites it

    The compositor lives in the kernel. Firefox hands it buffers over a Unix socket with fd passing, commits the damaged region, and gets each buffer back with a release event once the pixels are copied into a per-surface shadow.

  4. Hypervisor

    A Type 1 hypervisor on VT-x and AMD-V

    It runs a guest in VMX non-root mode and handles its exits. It also uses that isolation for privilege prompts, drawn in memory the main OS has no page-table mapping into. It needs VT-x or AMD-V exposed, so inside most VMs that means nested virtualization. It runs Alpine 3.23 or Debian 13 on 4 parallel vCPUs, with sound, and the guests' own apps, Firefox ESR included, open as Kurono windows.

An illustration of per-CPU dispatch on eight cores, not a recorded trace. Dotted lines are futex wakes reaching another core.

Linux programs

Linux programs, unmodified

Kurono implements the Linux syscall ABI in its own kernel and loads ELF64 programs with its own dynamic linker, ld-kurono. None of the programs below were patched or rebuilt for it.

  1. Firefox 140 ESR

    Firefox, drawing through Kurono's compositor

    The musl and Wayland build, with its 174 MB libxul.so, content processes and several cores. One of my test pages for it was an earlier version of this site, so that's what it's loading here.

  2. Claude Code and OpenCode

    Claude Code and OpenCode in Kurono's terminal

    Both are the stock linux-x64-musl builds. Claude Code is a 300 MB fixed-address executable that wants the addresses where Kurono's kernel used to live, so the kernel links itself above it now. The terminal is xterm-class on a real pty, so the full interface works. The exchange here is from one of my test runs.

  3. Kurono's shell

    Kurono's own userland around them

    150+ commands across Kurono, Linux and Windows-flavored environments, kpkg for packages, and KCL, Kurono's own scripting language. Stock Debian busybox-static and other prebuilt glibc and musl binaries run too.

Kurono OS - Nightly
Kurono OS×+
←  →  ↻Not Securehttp://10.0.2.2/kurono/
KuronoHow it worksHardwareBugs
Written fromscratch.
Terminal
Claude Code v2.1.316
/home/user
> what operating system are you running on? check with uname and ls /, keep it short
Ran 1 shell command
Terminal

            
  • threads and futexes
  • epoll
  • pidfd
  • inotify
  • ptys
  • Unix sockets with fd passing
  • close-on-exec
  • ELF64 dynamic linking

Most of the work was finding what my kernel got slightly wrong. A few of those are in the notes further down.

Real hardware

It runs on my laptop

A Lenovo Legion Pro 7 with a Core Ultra 7 255HX and 32 GB, the only real machine I've tested Kurono on. All 20 cores come up, Wi-Fi connects through an unmodified Linux driver, and Firefox and Claude Code run. Not everything works yet; the table has the details. The log is from the laptop's own boot.

KURONO.LOG0 lines

      
In QEMUOn my laptop
UEFI boot to desktopyesyes
SMPup to 20 CPUs testedall 20 by default
USB keyboard and mouseyesyes
NVMeyesyes
Ethernete1000, 82576, I225/I226I226-V at 1 Gbps with DHCP
USB audioUAC1AirPods Max over USB-C (UAC2)
Intel HD AudioyesALC287, speakers need an amp driver
Files that survive a rebootyesyes
Claude Codefull interface, a 3 hour session with no freezeruns
Firefox 140yes, also next to Claude nowopens and loads sites
OpenCodeyes, interface and toolsnot tried yet
Alpine and Debian guestsyes, Alpine on 4 vCPUsyes, Alpine and Debian
NVIDIA GPU in a Linux guestnobuilt, not run on the card yet
Wi-FinoBE200, upstream iwlwifi through KLD
GPU accelerationflag only, off by defaultflag only, off by default

The write guard

On real hardware Kurono refuses every disk write outside the files on its own KURONO partition, on NVMe, SATA and USB storage alike. It turns on by itself for UEFI boots. It exists because a test build could otherwise have formatted my real SSD. Still, don't run it on a computer you care about.

Inside

The rest of the system

Hybrid kernel

A driver framework (KDF), a scheduler with per-CPU timers that runs all 20 cores by default on the laptop, and KMemX, a memory compressor. KMemX is built and tested, but it doesn't compress anything in real boots yet.

Storage

KFS, my own on-disk filesystem, plus ext4, FAT32 and NTFS. NVMe, AHCI and USB mass storage drivers.

Networking

A TCP/IP stack written from scratch, with DHCP, window scaling and out-of-order reassembly.

Audio

A mixer and audio server, a PulseAudio-compatible server for Linux apps, HD Audio and USB audio.

Desktop

Its own compositor and window manager, plus a Wayland compositor in the kernel. Terminal, Files, Editor, Calculator, Media Player, Task Manager and Settings.

KCL

Kurono's own scripting language, plus small built-in Python and JavaScript interpreters.

kpkg

A package manager that can update at boot, and 150+ shell commands.

Hypervisor

Type 1, on VT-x or AMD-V, so inside most VMs it needs nested virtualization. It runs Alpine 3.23 or Debian 13 on 4 vCPUs with sound, and the guests' apps open as Kurono windows. An NVIDIA GPU can be passed through to the Debian guest.

Notes

Bugs I found along the way

  1. 01

    The disk driver gave up too early

    NVMe reads timed out after a few tens of milliseconds. The late completion stayed in the queue, the next read took it as its own and returned before its data arrived, and the queue stayed off by one forever. It showed up as a "broken FAT chain" on a healthy disk.

  2. 02

    USB input only worked when nothing was running

    A background kernel task read USB keyboards and mice, and it starved the moment a program took over the CPU. All my tests typed through PS/2, so it only showed up on the real laptop, as a frozen OS.

  3. 03

    One sleep loop broke sound and typing

    A kernel task sleeping for 5 seconds held up every other task that came due. That overflowed the keyboard queue and ran audio at 7% speed.

  4. 04

    Exiting a process corrupted memory

    Teardown freed the shared vDSO time page, so everything after the first exit used memory that was already freed. That was Bun's random crashes.

  5. 05

    sysinfo used the 32-bit layout on x64

    Total RAM read as 0, so Bun's garbage collector ran nonstop. Fixing it took Claude Code's startup from 3 minutes to 6 seconds.

  6. 06

    A kernel pointer leaked in %rdx

    The SysV ABI says that register is the exit handler, so every glibc binary called into kernel memory on exit.

  7. 07

    socketpair() gave both ends the same fd

    That's why Firefox's content process kept dying after navigation.

  8. 08

    A missing volatile meant no NVMe command ever completed

    The compiler hoisted the completion check out of the polling loop.

  9. 09

    A CPU let go of a thread while still standing on its stack

    It marked the thread free before it had left the thread's kernel stack. Another core picked the thread up and wrote over that stack, and the first core returned through the overwritten stack. That was the RIP=0x3 crash I chased for months.

  10. 10

    One flag bit kept most of a program's memory after it exited

    Freeing a page masked off the low bits of its page-table entry but kept the no-execute bit, so most pages were never given back. Long Claude Code sessions lost gigabytes.

  11. 11

    fork() made Firefox's shared memory private

    Pages mapped shared turned copy-on-write in the child, so the renderer kept reading stale drawing data and crashed. Shared pages now stay shared.

  12. 12

    One uint32 broke SQLite

    fcntl kept its argument in a 32-bit variable, so every file lock read its struct flock from a chopped-off address. OpenCode died with "locking protocol" until that became a uint64.

  13. 13

    Pipes lost everything past 64 KB

    A blocking write into a full pipe returned "try again" instead of waiting, so long output was cut off. Pipes now wait the way Linux's do, and a write with no reader raises SIGPIPE. 50 MB goes through in about 0.6 s.

  14. 14

    Every nested Kurono froze 10 seconds in

    My virtual timer chip lost its mode whenever the guest latched the counter, which Kurono does on every poll, and the virtual interrupt controller cleared the wrong interrupt. Linux guests never hit either one.

Next

What I'm working on

  • Intel GPU acceleration, on by default.
  • Hardware video decoding.
  • Moving more of the system out of the kernel, audio and networking first.
  • More unmodified Linux drivers under KLD.
  • The rest of the global kernel lock. Phase 1 is done, and ext4 reads, stat and directory listing have come off it since. Writes and renames are next.
  • Trying NVIDIA passthrough on the real card, so the Debian guest can use the laptop's GPU.
  • Getting KMemX to compress memory in real boots.
  • Faster Firefox startup. First paint is down from about 13 s to about 6 s in a VM.

Kurono is GPL v2

The source, the build steps and a README that lists what doesn't work are on GitHub.