Skip to content
isenePublic

About

CHasm — CHange to ASM. Pure x86_64 assembly Linux tools (bare, show, glass, tile).

Resources

Stars

109 stars

Watchers

2 watching

Forks

Repository files navigation

CHasm: CHange to ASM

A small suite of Linux tools written entirely in x86_64 assembly. No libc. No toolkits. No dynamic linking. No runtime. Just NASM source, direct syscalls, the X11 wire protocol, and, since frame, DRM/KMS and evdev straight to the hardware.

Each tool is a single static ELF binary. None of them depend on each other or on anything else outside the kernel. The X server they talk to is in here too.

Landing page: isene.org/chasm

The reason for releasing these tools into the Public Domain is not that you should use them. They are released for inspiration. Your use cases and preferences are different from mine.

So instead of installing these and adopt your ways of working to these tools, you should rather: clone the repos, fire up Claude Code, prompt the changes you want and make the tools fit you.


CHasm desktop

Every binary on this screen is x86_64 assembly: tile holds the layout, strip + the asmites (the per-segment programs in chasm-bits) drive the status row, glass renders each pane (pseudo-transparency picks up the wallpaper), bare is the shell behind every prompt, and show is rendering syntax-highlighted source in both the left and bottom-right panes.

No libc, no toolkit: the whole desktop talks straight to the kernel and the X server. These days that server is frame, so the assembly now reaches all the way down to DRM/KMS.

The tools

Tool Purpose Lines Binary
bare Interactive shell with line editing, history, completion, nicks, multi-pipes, redirects, here-strings, abbreviations, undo, smart hotkeys ~20k 175KB
show Pager / file viewer with syntax highlighting, ESC sanitisation, cat/pane/pipe modes ~3.9k 45KB
glass Terminal emulator: X11 wire protocol, kitty graphics, color emoji via XRender, pseudo-transparency, configurable fonts/keys ~21k 199KB
tile Tiling window manager: 10 workspaces, per-workspace tabs, row-of-squares bar, smart cycling, stash. Bundles strip, the X11 status bar that hosts the asmites (a further ~5.9k lines, 81KB) ~14k 133KB
frame X11 display server: serves the wire protocol straight onto DRM/KMS and evdev: window tree, damage-driven compositor, RENDER, SHAPE, XKB, RandR, MIT-SHM, XInput2, XFIXES. Runs the whole CHasm desktop plus Firefox, GIMP and Discord, with no Xorg, no libdrm and no Mesa anywhere in the path ~25k 192KB
chasm-bits "Asmites" fed into strip: clock, cpu, mem, disk, battery, brightness, network, mailbox, moonphase, wintitle, … each one a tiny static binary ~2k ~5KB each
glyph TrueType font rasterizer: TTF/OpenType parser, quadratic Bezier flatten, scanline NZW with 4x4 supersample AA, composite glyphs, UTF-8, variable fonts (fvar+gvar+IUP) ~5.7k 47KB
bolt Screen locker: fullscreen override-redirect, keyboard + pointer grab, baked raw-RGB lock-screen image, suid-root C helper for crypt()/shadow auth ~3.2k 29KB
spot Presenter tools, four modes from one binary: spotlight (dimmed snapshot, circular hole tracks the cursor), draw (click-drag annotation, colour + width configurable), highlight (drag-rect that stays bright on a dim surround), ocr (drag-rect text grab to clipboard, works on unselectable GUI text) ~2.4k 23KB
hyperlist-display Claude Code MessageDisplay hook: renders every answer as a tab-indented HyperList, one idea per line, numbered by depth. Display-only, the transcript keeps the markdown. /hl toggles it. Replaced a 52 ms Python hook that fired per streamed chunk ~4.8k 50KB

Stack them all together and you get a complete X session, display server included, in under 1 MB of executable code, with zero shared libraries to update, patch, or break.

What that costs at the battery, whole desktop up on frame, wifi on, four idle Claude Code sessions open (Dell XPS 14, Core Ultra 7 255H, measured 10 September 2026):

Screen Watts
at 60 % 2.63
blank 1.64

The CHasm programs themselves add about 7 mW. The rest is the screen, the chipset and the radios.

Try it

Three commands, one desktop:

git clone https://github.com/isene/chasm
cd chasm
./chasm-install

chasm-install fetches the prebuilt static binaries from the latest release into /usr/local/bin. The whole suite is a 300 KB download, checked against the release's SHA-256 sum before anything is installed. An update keeps the binaries it replaced, and ./chasm-install --rollback puts them back. It installs the few fonts the suite reads and drops default config files into your home (yours are kept if you have them).

It adds five wallpapers, bakes the first, and puts a CHasm entry in your login screen's session list. It asks one question: whether to make bolt-greet the login screen. Say no and nothing about your boot changes.

Then log out and pick CHasm. Or, from a text console with the login screen stopped, run sudo chasm-session to get the whole thing on frame, the assembly X server, with no Xorg anywhere. Inside, Mod4+Return opens a glass, Mod4+? shows every key, Mod4+w cycles wallpapers, Mod4+Escape locks.

Debian, Ubuntu and Mint get their packages through apt, Arch through pacman; on other distros install DejaVu fonts and ImageMagick yourself first. Every change to the installer is tried on clean Ubuntu, Debian and Arch machines by test/install-check.sh. ./chasm-install --build builds everything from source instead of downloading (needs nasm, ld, gcc). ./chasm-install --help lists the rest.

In a browser, with nothing installed

docker run --rm -p 127.0.0.1:6080:6080 ghcr.io/isene/chasm-try

Then open http://localhost:6080. That is the same desktop, frame included, drawn in memory and sent to the browser tab. It is slower than on real hardware. Mod4 is the Super key; on a Mac it is Cmd, but Cmd+Q and Cmd+W go to the browser. try/ has how it is built.

The keys

The suite shares one keyboard scheme: plain Mod4 is the desktop (workspaces, tabs, spot, frame's toggles), Mod4+Shift acts on a window or restarts a component, and Alt belongs to glass (unbound Alt+keys pass through to terminal apps as Meta).

Mod4+? opens the key reference: tile's keys action paints every combo on a full-screen overlay, in columns, one colour per group. The text comes from chasm-keys, a builtins-only bash script that reads ~/.tilerc, ~/.framerc and ~/.glassrc on every open, so a rebound key shows up the next time you look.

Type to search: matching rows light up, the rest fade. Tab flips between what a key does and the command behind it. Esc closes. A tile bind's description is the # comment on its line in ~/.tilerc, so a comment there is what the popup shows.

The same table in a terminal:

chasm-keys

Why?

Modern software stacks are deep. A terminal emulator routinely loads 30+ shared libraries before drawing a single character. A shell pulls in Python, GLib, OpenSSL transitively. Window managers depend on a toolkit that depends on a compositor that depends on... CHasm strips all of that away to find out what you actually need.

The answer turns out to be: surprisingly little. The Linux kernel gives you syscalls. X11 is just a Unix socket and a documented wire protocol. Everything else is a choice. CHasm is the choice to write everything yourself, from scratch, in the smallest reasonable language.

Shared aesthetic

Every CHasm tool follows the same conventions:

  • Pure x86_64 NASM, no libc, no int 0x80 (only syscall)
  • Single static ELF, no dynamic linking, no .so dependencies
  • Build pattern: nasm -f elf64 file.asm -o file.o && ld file.o -o file
  • All BSS, no malloc: every buffer is statically allocated
  • Zero-waste rule: features that aren't used pay no cost. Optional code paths are gated to be cold at rest.
  • Plain config files: ~/.barerc, ~/.glassrc, ~/.tilerc: line- based key=value, no JSON/TOML/YAML parsers needed
  • Unlicense: public domain

Build them all

for t in bare show glass tile frame chasm-bits glyph bolt spot; do
  git clone https://github.com/isene/$t.git
  (cd $t && make)
done

Each make runs the same two-step build (nasm → ld). Total wall time on a modern laptop: under 3 seconds for the entire suite. The release tarball that chasm-install fetches is made the same way, by chasm-release in this repo.

Configuration tools

The CHasm tools are paired with optional Rust TUI configurators (crust-based) that make their config files easier to edit interactively:

Configurator Edits Status
bareconf ~/.barerc shipped
glassconf ~/.glassrc shipped
tileconf ~/.tilerc shipped
stripconf ~/.striprc shipped

All four use the same ~/.<tool>rc.tmp → .bak → publish atomic-save dance, so a kill mid-write can never blank a config; mv ~/.<tool>rc.bak ~/.<tool>rc always restores the previous good state.

These are the only CHasm-adjacent tools written in something other than asm; they exist because writing a TUI configurator in pure asm would defeat the whole point.

Status

All six tools are usable today. tile + strip + the chasm-bits asmites form the daily-driver desktop. glyph is the newest: a pure-asm TTF rasterizer that already renders OpenType variable fonts (interpolating between weight masters via gvar deltas + IUP), with the eventual goal of replacing glass's X core bitmap fonts so the whole desktop renders TTF without dynamic linking. The next milestone is glyph's integration into glass; after that, tile's multi-monitor phase.

License

Unlicense: public domain. Take it, fork it, strip it for parts.

About

CHasm — CHange to ASM. Pure x86_64 assembly Linux tools (bare, show, glass, tile).

Resources

Stars

109 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages