TempleOS Desktop Docs

Kosmos desktop on Aiwnios (native Apple Silicon HolyC JIT)

Edited 2026-10-27aiwnios/README.md

The whole desk3 desktop runs natively on arm64, no QEMU. desk3/0*.HC stays the single source and the x86 build is untouched: build.py generates the Aiwnios source from the current desk3 plus overlay files here, so desk3 changes flow through.

Build and run#

text
git clone https://github.com/nrootconauto/Aiwnios Aiwnios && cd Aiwnios      # the spike used 3cbe5e1
git apply <repo>/apps/templeos-holyc/aiwnios/aiwnios-sdl32.patch
mkdir build && cd build && cmake -DCMAKE_C_FLAGS="-D_DARWIN_C_SOURCE" .. && make -j8 && cd ../..
apps/templeos-holyc/aiwnios/run-desk.sh Aiwnios [--s 2] [--w 1440 --h 900]   # generate, map T:/kosmos, run; Esc quits

run-desk.sh makes the T:/kosmos mapping itself (a symlink in the clone). Other tools: build.py OUT.HC [--desk DIR] [--no-main] [--append FILE], drive.HC / drive-bench.HC / drive-browser.HC (scripted runs, --append), rgb2png.py, kslint.py FILE... (U64 multiplies, continue, zero-assumed locals, $), say.HC (Say for any argument count). Pointer, wheel, keys: SDL events through the runtime key pipeline (shift, F-keys, Esc, Tab, arrows give TempleOS codes).

What is shared, what is overridden#

desk3 part on Aiwnios
01-core renderer, fonts, icons, wallpaper shared; only the asm block is replaced by kernels.HC
02-ui, 03-apps, 05-splash, 04/06 logic, the ten apps and the Browser shared, unchanged
03b-browser serial protocol shared; COM1 is emulated in platform.HC (GET line, KsExec of browser-bridge.py --convert, OK n c reply)
SerStr, BgaSet, Classic* (TempleOS screen app), RunApp, SplashRestart, SplashWait overrides.HC (named list in build.py)
14 one-line edits (FontLoad len=0, Input pointer, Render dirty rect, Main without PCI, loop pump and upload, splash show) PATCHES in build.py; the build stops with the text if desk3 moved under one
frame buffer host buffer, partial KsPresentRect of the union of dirty rectangles per frame
Not on Aiwnios: app 9 (the real TempleOS screen, stays black), Files starts empty (T:/Home), F11/F12 codes differ from x86.

Parity gate (golden.py ISO --clone Aiwnios): desk3 at HEAD, 1440x900, hashes below the menu bar#

Kernels: all 17 kernel cases (aiwnios/kernel-test.py) give the same FNV hash for x86 asm, x86 plain HolyC and Aiwnios plain HolyC. Scenes (13 of them, in golden.HC): | scene | result | note | |---|---|---| | Settings pages 0, 1, 2 (window, text, controls) | identical | | | all 20 Lucide icons at 20, 32, 48 px | identical | same IconLoad and stroke code | | wallpaper and dock, dock hover (magnified icons), window with shadow, Notes and Calculator | differ in wallpaper pixels only | 0.36 percent of sampled wallpaper pixels, each by one level in one channel | | Monitor with fixed data | wallpaper plus 14 of 38800 sampled graph pixels | anti-aliased graph line moves one pixel at a few points | | window in styles 2 to 5 | differ in a few tiles (wallpaper areas; not sampled) | same cause, assumed | Cause: x86 TempleOS evaluates F64 in 80-bit x87 and Aiwnios in IEEE double, so truncations such as the blob falloff in BuildWall and the line position in LineN land one step apart at rare points. Only F64-derived pixels differ. Not fixable without changing desk3 arithmetic (integer or rounded forms would make both builds identical but would change the x86 pixels); left as is. (pxdiff.py on golden-px.HC samples; hashes in out/golden-aiw.txt and out/golden-x86.txt.)

Dialect differences (Aiwnios vs TempleOS HolyC)#

  1. No inline asm: kernels are plain HolyC. 2. U64 multiply truncates to 32 bits on arm64: use I64 (lint rule U64MUL).
  2. Locals are not zeroed: initialise (lint ZEROLOC; FontLoad needs len=0, patched). 4. Natives need extern: one place, platform.HC.
  3. Boot paths are under T: only. 6. PrintF with several arguments fails: Say or StrPrint. 7. StrPrint returns the buffer, not a length.
  4. StrCat does not exist; continue does not exist in either. 9. F64 is IEEE double, x86 TempleOS uses 80-bit x87 (see parity).
  5. Aiwnios hangs at 100 percent CPU on a compile error in -k mode (REPL on closed stdin): run with timeout -s KILL.

Numbers (M-series, 2880x1800, in-engine; scripted drive.HC and the b benchmark, ms a frame)#

Drag the large window: 1.5 ms avg (2.6 worst), small window 1.3, full redraw 3.9 (4.2 worst), open or close a window 1.7, focus change 2.3, dock sweep 0.7, style crossfade 5.2, first style switch 28 ms (wallpaper build), Notes typing 4.0. QEMU x86 drag: 5.7 ms. Boot to desktop (KS-READY): 0.5 to 0.7 s. Partial upload to the Metal texture: about 1.1 ms average a frame (full-frame upload 8 ms, display paced). Whole desktop with ten apps open: 35 frames a second while the scripted drive redraws, idle frames cost nothing.

Remaining gaps#

App 9 and RunApp need a TempleOS screen (none here). The Browser fetch blocks the frame while the host converter runs. F-key codes above F10 differ from x86 in the runtime mapping. desk3 FontLoad should initialise len (lint finds it).

TempleOS Desktop Docs. Built from the Markdown sources; offline, no external requests. Back to top