gitwtfhub

wtf is nanokrnl?

msuiche/nanokrnl — explained in plain English

Analysis updated 2026-05-18

22RustAudience · developerSetup · moderate

TL;DR

A Rust rewrite of the Windows NT kernel architecture that boots real Microsoft binaries in QEMU or directly in your browser.

Mindmap

mindmap
  root((nanokrnl))
    What it does
      NT-compatible kernel
      Written in Rust
      Runs real Windows binaries
    Tech stack
      Rust
      WebAssembly
      x86-64
    Use cases
      Browser-based kernel demo
      OS internals study
      Reverse engineering learning
    Audience
      OS developers
      Reverse engineers
    Components
      nanox emulator
      Kernel subsystems
      Self test suite

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Boot a Rust-built NT-compatible kernel in the browser and run real Windows binaries like cmd.exe.

REASON 2

Study how NT kernel internals such as IRQL, dispatcher objects, and syscalls work.

REASON 3

Learn low-level x86-64 concepts through a memory-safe, from-scratch kernel implementation.

REASON 4

Explore the nanox WebAssembly emulator as a lightweight alternative to full PC emulators.

What's in the stack?

RustWebAssemblyx86-64QEMU

How it stacks up

msuiche/nanokrnlbrain0-ai/brain0proxyshard/shardbrowser
Stars222222
LanguageRustRustRust
Setup difficultymoderatemoderatemoderate
Complexity3/53/5
Audiencedeveloperops devopsdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

Browser demo needs an HTTP server, not file://, for the AudioWorklet backdrop to work.

Wtf does this do

nanokrnl is an experimental operating system kernel, written in Rust, that recreates the internal architecture of the Windows NT kernel, the core piece of software Windows is built on. Rather than trying to run existing Windows drivers, the goal is to rebuild the same internal building blocks, data layouts, and constants that NT uses, but in a modern language designed to prevent whole classes of memory safety bugs common in low level code. It boots on real x86-64 hardware and can run actual, unmodified Microsoft programs such as cmd.exe, the Windows command prompt, and more.com, using its own from-scratch implementation of the underlying NT system calls those programs rely on. What makes the project unusual is that it also boots inside a web browser. The author built a companion project called nanox, a compact emulator written in Rust and compiled to WebAssembly, only about 60 kilobytes in size. Instead of emulating an entire generic PC from power on the way larger browser emulators do, nanox boots the kernel directly in 64-bit mode and only emulates the small handful of hardware devices the kernel actually needs, such as a serial port, a keyboard controller, and a timer chip. Because of this narrow scope, the browser demo can run from any ordinary web server without the special security headers that heavier in-browser emulators usually require. Every time the kernel boots, whether under the emulator QEMU or in the browser, it prints a startup banner and runs a suite of self tests that check things like memory allocation, event synchronization, and device input and output, reporting whether each one passed. The project describes its faithfulness to NT in layers. Some pieces are exact matches with how real NT works internally, such as status codes, string formats, and the selector layout used by the processor. Other pieces are faithful in overall shape and behavior without matching Windows byte for byte, such as how the kernel dispatches driver requests or manages background work. Throughout the codebase, the parts that must bypass Rust's normal safety checks are kept narrow and explicitly documented, so entire categories of bugs common in traditional kernel code are prevented by the compiler. The codebase is organized into subsystems that mirror the layout of the real Windows kernel, covering memory management, scheduling, object handling, process and thread creation, drivers and input/output, and a loader for Windows executable files. It is aimed at people interested in operating systems, emulation, and reverse engineering who want to see a real kernel architecture rebuilt from scratch in a memory-safe language.

Yoink these prompts

Prompt 1
Explain how nanox boots nanokrnl directly into long mode without emulating a full PC.
Prompt 2
Walk me through building nanox.wasm and serving the browser demo locally.
Prompt 3
What parts of nanokrnl are bit-exact with real Windows NT, and what parts only match in shape?
Prompt 4
How does nanokrnl use Rust's safety features to prevent classic kernel bugs?

Frequently asked questions

wtf is nanokrnl?

A Rust rewrite of the Windows NT kernel architecture that boots real Microsoft binaries in QEMU or directly in your browser.

What language is nanokrnl written in?

Mainly Rust. The stack also includes Rust, WebAssembly, x86-64.

How hard is nanokrnl to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is nanokrnl for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.