Notice: Possibly the first self-hosting 'Vibe-Native' stack: A kernel and shell written entirely in a custom programming language that was itself designed and implemented through vibe-coding, capable of compiling its own source.
Farmiga is a UNIX SysV-inspired hobby kernel project with:
aarch64as the primary boot targetx86_64as a planned second target- kernel logic authored in Coatl where practical
This repository currently provides a Stage 0 foundation:
- Bootable AArch64 kernel entry and UART console on QEMU
virt - EL1 trap capture scaffold (
ESR_EL1/ELR_EL1/SPSR_EL1) with SVC classification and syscall-number routing markers - Stable trap snapshot ABI symbols exported for future Coatl trapframe bridge (
trap_snapshot_base..trap_snapshot_end) - SysV-like syscall dispatch core written in Coatl
- In-memory FS + init/exec + shell-command model layer in Coatl (
echo,ls,cat,mount,ps) - Build wiring for incremental migration of low-level kernel paths to Coatl
arch/aarch64/boot.S: reset entry, stack setup, UART console outputarch/aarch64/linker.ld: bare-metal linker scriptkernel/sysv_kernel.coatl: SysV-inspired syscall/process core model in Coatluserland/minish.coatl: minimalinit+ shell-command model smoke in CoatlMakefile: build/run/smoke targetsdocs/SYSV_PLAN.md: staged plan from Stage 0 to multi-process SysV-like kerneldocs/PROGRESS.md: dated implementation log and blockers
- GNU binutils for AArch64 (
aarch64-none-elf-as,aarch64-none-elf-ld,aarch64-none-elf-objcopy) or compatible prefix qemu-system-aarch64- Coatl compiler at
~/Projects/Coatl/coatl(or setCOATL)
The Makefile auto-detects aarch64-none-elf- and aarch64-linux-gnu- prefixes.
If your tools use a different prefix, override it:
make CROSS=<your-prefix> validateBuild AArch64 ELF + raw image:
make aarch64Build experimental x86_64 ELF + raw image (secondary target scaffold):
make x86_64Run x86_64 scaffold build contract smoke:
make test-x86_64-buildRun experimental x86_64 QEMU loader smoke:
make test-x86_64-qemu-smokeRun interactive x86_64 loader path:
make run-x86_64-loaderRun on QEMU:
make run-aarch64You should see:
Farmiga: aarch64 stage0
On normal boot, Farmiga now enters a minimal serial shell prompt:
farmiga-sh>
Line-based demo commands:
helplscatechomountpsexit
exit currently returns to the prompt (no poweroff yet).
Automated QEMU validation (recommended for every change):
make test-aarch64This command boots the kernel in QEMU, captures serial output, and fails if the expected boot banner is missing.
Automated SVC trap/syscall-boundary smoke:
make test-aarch64-svcThis builds a temporary trap-test kernel variant (with a startup svc #0, x8=20) and asserts EL1 syscall-trap classification plus getpid(20) syscall routing marker on serial.
Automated syscall-argument observability smoke:
make test-aarch64-svc-argsThis builds a trap-test kernel variant (x8=4, x0=1, x1=4096, x2=16) and asserts syscall-boundary argument markers on serial.
Automated syscall-return observability smoke:
make test-aarch64-svc-retThis builds a trap-test kernel variant (x8=4, x2=16) and asserts the modeled syscall return marker (x0=16) on serial.
Automated unknown-syscall routing smoke:
make test-aarch64-svc-unknownThis builds a trap-test kernel variant (x8=999) and asserts the unknown-syscall routing marker on serial.
Automated syscall-route matrix smoke:
make test-aarch64-svc-matrixThis runs SVC trap variants for x8=64, x8=1, and x8=4, asserting getppid, exit, and write route markers on serial.
Automated non-syscall trap smoke:
make test-aarch64-brkThis builds a trap-test kernel variant that executes brk #42 and asserts generic EL1 trap handling is observable on serial.
Trap runtime value smoke:
make test-aarch64-trap-runtimeThis asserts trap runtime observability markers from QEMU logs:
- trap kind marker (
sync) for SVC/BRK paths - syscall route markers (
getpid,unknown) - non-syscall route marker (
route none) for BRK path
Trap fixture contract smoke:
make test-aarch64-trap-fixtureThis generates a deterministic trap snapshot fixture from ELF-exported machine constants and validates layout + route fixture values for serialized ingest parity checks.
Coatl fixture parity smoke:
make test-coatl-trap-fixture-parityThis validates the generated fixture values against Coatl trap ABI helper constants in kernel/sysv_kernel.coatl.
Generate Coatl trap ABI constants artifact:
make gen-coatl-trap-abi-constantsThis emits build/trap_abi_generated.coatl from machine-derived fixture constants.
Generated constants sync smoke:
make test-coatl-generated-trap-abi-syncThis checks that generated Coatl constants stay in sync with kernel/sysv_kernel.coatl ABI helper functions.
Trap ABI contract smoke:
make test-aarch64-trap-abiThis verifies required trap snapshot symbols exist in the built AArch64 ELF (last_esr_el1, last_elr_el1, last_spsr_el1, last_x8, last_trap_kind, last_sys_route), checks the fixed layout constants, and enforces parity with Coatl-side ABI helpers in kernel/sysv_kernel.coatl.
Layout constants:
- size:
trap_snapshot_size=80 - offsets:
count=0,kind=8,esr=16,elr=24,spsr=32,x8=40,x0=48,x1=56,x2=64,route=72
Build and run the Coatl SysV core smoke test on x86_64 host:
make coatl-sysv-smokeBuild and run the Coatl userland (init/sh) smoke model on x86_64 host:
make coatl-userland-smokeRun the full validation suite (includes QEMU boot test):
make validateRun standalone environment/toolchain preflight:
make toolchain-preflightThis project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
- Coatl AArch64 codegen is still evolving. This repo keeps the machine-entry path in assembly while growing portable kernel logic in Coatl.
- The goal is to move scheduler, syscall table, VFS, and IPC core progressively into Coatl as backend support hardens.
