Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3,839 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DuetOS

Ask DeepWiki

A from-scratch operating system that boots on real PC hardware and runs Windows .exe files natively — not under a VM, not through Wine, not as an emulator on top of Linux. The PE loader, the NT syscall layer, and 44 reimplemented Win32 DLLs (kernel32, ntdll, user32, gdi32, ucrtbase, msvcp140, d3d11, …) live in this repo as a peer ABI alongside the native one.

DuetOS desktop, Duet theme — Calculator, Notepad, Files, Task Manager, Kernel Log, Clock, GFX Demo, island taskbar

Everything in that screenshot is painted in a single compose pass by our kernel-side compositor:

  • Calculator, Notepad, Files, Task Manager, Kernel Log, Clock — native DuetOS apps.
  • GFX Demo (top right) — a native app computing every pixel in its client area on every frame; the same FramebufferPutPixel / FramebufferFillRect primitive set our d3d11 / d3d12 / dxgi DLLs call into when a Windows PE goes D3D11CreateDeviceAndSwapChain → ClearRenderTargetView → Present.
  • Window chrome — the "Aurora" glass look: rounded bodies, an Aero-lineage specular ramp on each title bar that terminates hard at the midpoint, and a sheen hairline on the top edge. Design bundle: docs/aurora-theme/.
  • Taskbar — a centred, inset, rounded island carrying the Start button, pinned apps, tray, and clock, with the desktop showing on every side. Ctrl+Alt+Y hot-swaps to Classic / Slate10 / Amber, which keep their flat, full-width, square chrome. theme=<name> on the kernel cmdline picks one at boot.

Running real Windows binaries

[reg-fopen-test] ProductName="DuetOS" (type=1, size=7)
[reg-fopen-test] /bin/hello.exe first two bytes: 0x4d 0x5a
[reg-fopen-test] all checks passed
Windows Kill 1.1.4 | Windows Kill Library 3.1.3
Not enough argument. Use -h for help.
[I] sys : exit rc val=0x1234

The "Windows Kill" line is not ours. It's windows-kill.exe — a third-party 80 KB MSVC-built PE with 52 imports across 6 DLLs, downloaded as-shipped from its release page. Our PE loader maps it, our import resolver binds every call against the preloaded DLLs' export tables, and the program runs to a clean exit through our ucrtbase / kernel32 / ntdll / advapi32 surface. No source patches, no relinking, no recompile.

Windows binaries that open windows work too. /bin/windowed_hello.exe imports CreateWindowExA, ShowWindow, and MessageBoxA from our user32.dll, then issues int 0x80 with SYS_WIN_CREATE (58) / SYS_WIN_SHOW (60) / SYS_WIN_MSGBOX (61); the kernel handlers land a real window in the compositor next to Calculator and Notepad. See docs/screenshots/07-windowed-hello.png.


How it fits together

Windows PE applications
        ↓ imports
44 Win32 translator DLLs  (userland/libs/, ~1100 exports total)
        ↓ int 0x80
DuetOS kernel  (one VFS, one TCP stack, one compositor, one registry)
        ↓
Kernel-mode drivers  (PCIe, NVMe, AHCI, xHCI/USB, e1000, HDA, GPU)

The Win32 DLLs are translators, not a parallel subsystem. A native DuetOS app and a Windows PE both make the same syscalls to the same kernel, walk the same address-space tables, and paint into the same compositor. There is no second TCP stack, no shadow VFS, no parallel registry. Subsystem isolation rules and the audit checklist live in wiki/kernel/Subsystem-Isolation.md.

Kernel: x86_64 boot through GRUB + Multiboot2 on BIOS or UEFI firmware, 4-level paging, SMP-aware scheduler, W^X + SMEP/SMAP + ASLR + stack canaries + retpoline, capability-based IPC, ~190 numbered syscalls. PCIe enumeration, NVMe, AHCI, xHCI/USB, PS/2, Intel HDA, e1000 NIC. HPET-calibrated LAPIC timer. Kernel-mode breakpoint subsystem with hardware DR gates. Live crash dump with inline symbol resolution.

No Linux kernel under this tree, no GNU userland, no Wine vendoring, no ReactOS fork. The kernel is written from scratch. Supported release images boot through GRUB's Multiboot2 handoff on either BIOS or UEFI firmware. The in-tree direct BOOTX64.EFI loader is experimental: it validates the kernel ELF but does not yet load its segments, call ExitBootServices, construct a versioned BootInfo, or hand off to the kernel.


Try it

Pre-built ISO — boot in QEMU in 30 seconds, no toolchain needed:

wget https://github.com/krilliac/duetos/releases/download/latest-release/duetos-release.iso
qemu-system-x86_64 -bios /usr/share/ovmf/OVMF.fd -cdrom duetos-release.iso -serial stdio

Here OVMF supplies UEFI firmware; the hybrid ISO still runs GRUB, which hands the kernel over through Multiboot2. This is not the experimental direct BOOTX64.EFI path.

From source — clone, configure, build, boot:

git clone https://github.com/krilliac/duetos.git && cd duetos
cmake --preset x86_64-debug
cmake --build build/x86_64-debug --parallel $(nproc)
DUETOS_TIMEOUT=30 tools/qemu/run.sh build/x86_64-debug/duetos.iso

Toolchain: Clang 18+, CMake 3.25+, NASM 2.16+. ISO build needs qemu-system-x86, ovmf, grub-common, grub-pc-bin, grub-efi-amd64-bin, xorriso, mtools. Build flavors (release-asserts for paranoid production, release-audit for forensic capture, release-lto, debug-ubsan, debug-fast) are documented in wiki/tooling/Build-System.md.


What works · what doesn't (yet)

Working today Skeleton / not yet
Freestanding PEs (no CRT, direct int 0x80) ws2_32!socket returns INVALID_SOCKET — kernel net stack is a skeleton
Console PEs with CRT — threads, mutexes, events, atomics, printf, file I/O · client-area GDI paint (FillRect/Rectangle/TextOut/Line/Ellipse/BitBlt, reset per BeginPaint) GDI advanced surface — 8×8 bitmap font only, no clipping regions, Polygon/path fill, or GetPixel readback
Registry queries against a real Win32-shaped hive Per-window message queues — GetMessage returns WM_QUIT so pumps exit immediately
Windowing — CreateWindowExA / ShowWindow / MessageBoxA land in the compositor Keyboard / mouse routing to the focused window (input still goes to the native console)
DirectX v0 — D3D11CreateDeviceAndSwapChain, ClearRenderTargetView, Present BitBlt Real Draw* calls, shaders, fences, cross-DLL DXGI ↔ D3D11/12 swap-chain marriage
Real third-party PE (windows-kill.exe, 52 imports across 6 DLLs) end-to-end CoCreateInstance returns CLASS_E_CLASSNOTAVAILABLE
44 production DLLs preloaded into every Win32 process, ~1100 exports Vulkan ICD

Per-DLL, per-function status: Win32-Surface-Status.


More

You want to Start at
Build, boot, hack on it Getting Started
Understand the layering Architecture Overview
Trace a Win32 call from PE → DLL → syscall → driver Win32 PE Subsystem
Find a syscall number Syscall ABI
See all four themes and every gfxdemo mode docs/screenshots/
Read the project's history slice-by-slice History
Hack the kernel BootMemoryScheduler

Downloads: release ISO · debug ISO · specialized flavors. CLAUDE.md is the authoritative development guide; the wiki is the human-facing digest plus the per-subsystem reference pages.

release lifetime downloads

LICENSE

About

Operating System with native windows application execution in mind

Topics

Resources

Stars

7 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages