Skip to content
DivByDiamondPublic

About

Userland applications for OnyxOS (vim editor, ...) — compiled to .onx with OnyxCC

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

37 Commits

Folders and files

Repository files navigation

OnyxApps CI

RISC-V 64 C99 OnyxCC GPL-3.0

    ███████
  ███▒▒▒▒▒███
 ███     ▒▒███ ████████   █████ ████ █████ █████
▒███      ▒███▒▒███▒▒███ ▒▒███ ▒███ ▒▒███ ▒▒███
▒███      ▒███ ▒███ ▒███  ▒███ ▒███  ▒▒▒█████▒
▒▒███     ███  ▒███ ▒███  ▒███ ▒███   ███▒▒▒███
 ▒▒▒███████▒   ████ █████ ▒▒███████  █████ █████
   ▒▒▒▒▒▒▒    ▒▒▒▒ ▒▒▒▒▒   ▒▒▒▒▒███ ▒▒▒▒▒ ▒▒▒▒▒
                           ███ ▒███
                          ▒▒██████
                           ▒▒▒▒▒▒
 ████████
██▒▒▒▒▒▒███ ████ █████  █████████  █████████
███▒▒▒▒▒███▒▒███ ▒▒███ ▒██▒▒▒▒▒▒███▒▒███▒▒▒▒███
███████████ ▒███  ▒███ ▒██▒▒▒▒▒▒███▒██████████
██▒▒▒▒▒▒███ █████ █████▒██▒▒▒▒▒▒███ ▒▒███████
██▒▒▒▒▒▒███▒███▒▒▒ ▒███ ▒██▒▒▒▒▒▒███  ████████
███▒▒▒▒▒███▒███▒▒▒ ▒███ ███████████▒███▒▒▒▒▒
███▒▒▒▒▒███▒███▒▒▒ ▒███ ▒███▒▒▒▒▒▒ ▒███▒▒▒▒▒
 ▒▒███████▒ ▒▒███████▒  ▒▒█████████  ▒▒███████
  ▒▒▒▒▒▒▒    ▒▒▒▒▒▒▒    ▒▒▒▒▒▒▒▒▒    ▒▒▒▒▒▒▒

Optional userland applications for OnyxOS, written in C99


OnyxApps is the single repository for every optional userspace program of OnyxOS, written in C99 and compiled to .onx executables by the project's own self-hosting compiler (OnyxCC) against libonyxc (stdio / termios / string / stdlib).

One repo for all apps: every program is a self-contained directory under apps/, the CI builds all of them with the same pinned compiler and publishes .onx artifacts, so there is no per-app repository and no artifact-sync overhead. The system components stay in their own repos: OnyxKernel, OnyxBoot, OnyxShell, OnyxCompiller and the OnyxOS image orchestrator.


Key Features

  • One repo, many apps - a new program is a directory, not a repository
  • OnyxCC pipeline - onyxcc links libonyxc automatically, no extra flags
  • Enforced layout - max 4 files per folder, max 200 lines per file, KISS/DRY
  • CI-built artifacts - every push rebuilds all apps and uploads .onx files

Apps

App Source Docs Description
vim apps/vim apps/vim/README.md Modal text editor (vim-inspired)
lua apps/lua apps/lua/README.md Standard Lua 5.5.1 interpreter
luac apps/luac apps/luac/README.md Standard Lua 5.5.1 bytecode compiler
mux apps/mux apps/mux/README.md PTY terminal multiplexer
otop apps/otop apps/otop/README.md System monitor reading /proc
osnake apps/osnake apps/osnake/README.md Snake in the ANSI terminal
obrowse apps/obrowse apps/obrowse/README.md Text-mode HTTP page viewer (experimental)
ochat, ochat-gui apps/ochat, apps/ochat-gui - OC2R radio chat, CLI and framebuffer GUI
otablet apps/otablet apps/otablet/README.md Framebuffer UI toolkit and tablet demo

Full documentation lives in each app's own README.md; this file covers the monorepo only.

Layout rules (project-wide)

  • max 4 files per folder - one folder = one subsystem
  • max 200 lines per file - one responsibility per file
  • KISS / DRY - shared logic lives in exactly one place

Reference structure (apps/vim):

apps/vim/
├── vim.h            shared state (extern) + full API
├── main.c           program entry: args + editor loop
├── core/            state.c  buffer.c  undo.c  fileio.c
│                    (buffer state, edit primitives, undo/redo, load/save)
├── ops/             registers.c  operators.c
│                    (yank/paste registers, d/c/y operators, indent)
├── text/            motions.c  search.c
│                    (word motions, %, pattern search, f/F/t/T)
├── mode/            keys.c  keys_motion.c  keys_edit.c  command.c
│                    (NORMAL dispatcher, motion keys, edit keys, : commands)
└── ui/              render.c  input.c
                     (drawing, cursor, raw term, key decoding)

Build

Requires onyxcc (built from OnyxCompiller: make -C OnyxCompiller).

make                                  # build every app into build/
make vim                              # build one app
ONYXCC=/path/to/onyxcc make           # custom compiler path

Apps can provide apps/<name>/build.py for verified vendored upstream sources; Make and OnyxOS invoke it with --compiler and --output. Lua and luac use this path. Their archives are compiled by the real-build CI matrix; the C-only syntax-check matrix remains for directly stored C apps.

Each apps/<name>/ tree compiles to build/<name>.onx; run it on OnyxOS as vim [file].

Adding an app

  1. mkdir apps/myapp and put your *.c files there (self-contained; onyxcc links libonyxc automatically, no extra flags needed)
  2. CI picks it up automatically: syntax-check + real onyxcc build + .onx artifact. Add the app to the matrix lists in .github/workflows/ci.yml

CI

  • syntax-check - gcc -fsyntax-only against libonyxc headers (fast feedback, no toolchain build)
  • build - builds OnyxCC from source, compiles every app into .onx, validates the ONX1 magic, uploads artifacts


Related Projects

Project Description
OnyxOS RISC-V operating system (kernel + shell + bootloader + compiler)
OnyxKernel RISC-V 64-bit kernel for OnyxOS
OnyxShell POSIX-like shell for OnyxOS
OnyxBoot RISC-V bootloader for OnyxOS
OnyxCompiller Self-hosting C compiler used to build the apps

Licensed under GPL-3.0-or-later. The vendored Lua distribution retains its MIT license; see apps/lua/vendor/LICENSE.txt.

About

Userland applications for OnyxOS (vim editor, ...) — compiled to .onx with OnyxCC

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages