Waozi

Waozi

9xe Execution Layer

9xe - Plan 9 Binary Execution Layer

9xe is a Plan 9 binary execution layer written in Go. It provides CPU emulation, 66 Plan 9 syscalls, and SDL2 graphics backend for running Plan 9 a.out binaries across different platforms.

Developed under Kryon Labs

Architecture

Plan 9 Binaries (a.out)
         ↓ CPU Emulation (Unicorn)
       9xe Syscall Layer (66 syscalls)
         ↓ Draw Protocol
       SDL2 Graphics Backend

Features

Directory Structure

9xe/
├── cmd/9xe/main.go       # Main emulator entry point
├── lib/aout/            # Plan 9 a.out parser
├── lib/draw/            # Draw protocol implementation
├── lib/memdraw/         # In-memory pixel operations
└── lib/sys/             # Syscall implementations

Syscalls Implemented (66)

Plan 9 syscalls including: sysr1, errstr, bind, mount, wstat, chdir, fork, fd2path, pipe, create, dup, open, close, fd2path, read, write, seek, fstat, stat, brk_, removedir, notify, noted, segbrk, sleep, alarm, execl, exited, _forkstat, rendezvous, openfd, mount, die, wait, await, nsec, ttstub, sysmount, unmount, getpid, atnotify, segattach, _p9usetextfregs, segflush, fpactivate, rfork, pendattr, _dmarf, _sysr1, lane, laneattach, lanesum, laneschdup, laneendchild, lanechild, lanestart, lanecheckpoint, lanerecover

Draw Protocol

/dev/draw/
├── new        # Allocate new image
├── [n]/       # Image directory
│   ├── ctl    # Image control
│   ├── data   # Image data
│   └── refresh # Refresh display

Usage

# Build 9xe
cd 9xe
go build -o bin/9xe ./cmd/9xe

# Run Plan 9 binary
./bin/9xe /path/to/plan9/binary

Dependencies

Links

GitHub Repository | Back to Waozi